(function(d){d.fn.ajaxSubmit=function(a){if(!this.length)return this;if(typeof a=="function")a={success:a};var b=d.trim(this.attr("action"));if(b)b=(/^([^#]+)/.exec(b)||{})[1];b=b||window.location.href||"";a=d.extend({url:b,type:this.attr("method")||"GET"},a||{});if(a.beforeSerialize&&a.beforeSerialize(this,a)===false)return this;b=this.serializeArray();if(a.data){a.extraData=a.data;for(var c in a.data)if(a.data[c]instanceof Array)for(var e in a.data[c])b.push({name:c,value:a.data[c][e]});else b.push({name:c,
value:a.data[c]})}if(a.beforeSubmit&&a.beforeSubmit(b,this,a)===false)return this;a.data=b;d.ajax(a);this.trigger("form-submit-notify",[this,a]);return this}})(jQuery);
