text: !function(e){function t(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}e.fn.ajaxSubmit=function(r){function a(){function a(){var t=m.attr("target"),r=m.attr("action");i.setAttribute("target",s),"POST"!=i.getAttribute("method")&&i.setAttribute("method","POST"),i.getAttribute("action")!=o.url&&i.setAttribute("action",o.url),o.skipEncodingOverride||m.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),o.timeout&&setTimeout(function(){d=!0,n()},o.timeout);var a=[];try{if(o.extraData)for(var c in o.extraData)a.push(e('<input type="hidden" name="'+c+'" value="'+o.extraData[c]+'" />').appendTo(i)[0]);l.appendTo("body"),u.attachEvent?u.attachEvent("onload",n):u.addEventListener("load",n,!1),i.submit()}finally{i.setAttribute("action",r),t?i.setAttribute("target",t):m.removeAttr("target"),e(a).remove()}}function n(){if((g=u.contentWindow?u.contentWindow.document:u.contentDocument?u.contentDocument:u.document)&&g.location.href!=o.iframeSrc){u.detachEvent?u.detachEvent("onload",n):u.removeEventListener("load",n,!1);var r=!0;try{if(d)throw"timeout";var a="xml"==o.dataType||g.XMLDocument||e.isXMLDoc(g);if(t("isXml="+a),!a&&window.opera&&(null==g.body||""==g.body.innerHTML)&&--b)return t("requeing onLoad callback, DOM not available"),void setTimeout(n,250);c.responseText=g.body?g.body.innerHTML:g.documentElement?g.documentElement.innerHTML:null,c.responseXML=g.XMLDocument?g.XMLDocument:g,c.getResponseHeader=function(e){return{"content-type":o.dataType}[e]};var i=/(json|script)/.test(o.dataType);if(i||o.textarea){var s=g.getElementsByTagName("textarea")[0];if(s)c.responseText=s.value;else if(i){var m=g.getElementsByTagName("pre")[0],p=g.getElementsByTagName("body")[0];m?c.responseText=m.textContent:p&&(c.responseText=p.innerHTML)}}else"xml"!=o.dataType||c.responseXML||null==c.responseText||(c.responseXML=x(c.responseText));h=T(c,o.dataType,o)}catch(a){t("error caught:",a),r=!1,c.error=a,o.error.call(o.context,c,"error",a),f&&e.event.trigger("ajaxError",[c,o,a])}c.aborted&&(t("upload aborted"),r=!1),r&&(o.success.call(o.context,h,"success",c),f&&e.event.trigger("ajaxSuccess",[c,o])),f&&e.event.trigger("ajaxComplete",[c,o]),f&&!--e.active&&e.event.trigger("ajaxStop"),o.complete&&o.complete.call(o.context,c,r?"success":"error"),setTimeout(function(){l.removeData("form-plugin-onload"),l.remove(),c.responseXML=null},100)}}var i=m[0];if(e(":input[name=submit],:input[id=submit]",i).length)return void alert('Error: Form elements must not have name or id of "submit".');var o=e.extend(!0,{},e.ajaxSettings,r);o.context=o.context||o;var s="jqFormIO"+(new Date).getTime(),l=e('<iframe id="'+s+'" name="'+s+'" src="'+o.iframeSrc+'" />'),u=l[0];l.css({position:"absolute",top:"-1000px",left:"-1000px"});var c={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1,l.attr("src",o.iframeSrc)}},f=o.global;if(f&&!e.active++&&e.event.trigger("ajaxStart"),f&&e.event.trigger("ajaxSend",[c,o]),o.beforeSend&&!1===o.beforeSend.call(o.context,c,o))return void(o.global&&e.active--);if(!c.aborted){var d=0,p=i.clk;if(p){var v=p.name;v&&!p.disabled&&(o.extraData=o.extraData||{},o.extraData[v]=p.value,"image"==p.type&&(o.extraData[v+".x"]=i.clk_x,o.extraData[v+".y"]=i.clk_y))}o.forceSync?a():setTimeout(a,10);var h,g,b=50,x=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},y=e.parseJSON||function(e){return window.eval("("+e+")")},T=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=y(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o}}}if(!this.length)return t("ajaxSubmit: skipping submit process - no element selected"),this;"function"==typeof r&&(r={success:r});var n=this.attr("action"),i="string"==typeof n?e.trim(n):"";i&&(i=(i.match(/^([^#]+)/)||[])[1]),i=i||window.location.href||"",r=e.extend(!0,{url:i,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},r);var o={};if(this.trigger("form-pre-serialize",[this,r,o]),o.veto)return t("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(r.beforeSerialize&&!1===r.beforeSerialize(this,r))return t("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s,l,u=this.formToArray(r.semantic);if(r.data){r.extraData=r.data;for(s in r.data)if(r.data[s]instanceof Array)for(var c in r.data[s])u.push({name:s,value:r.data[s][c]});else l=r.data[s],l=e.isFunction(l)?l():l,u.push({name:s,value:l})}if(r.beforeSubmit&&!1===r.beforeSubmit(u,this,r))return t("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[u,this,r,o]),o.veto)return t("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=e.param(u);"GET"==r.type.toUpperCase()?(r.url+=(r.url.indexOf("?")>=0?"&":"?")+f,r.data=null):r.data=f;var m=this,d=[];if(r.resetForm&&d.push(function(){m.resetForm()}),r.clearForm&&d.push(function(){m.clearForm()}),!r.dataType&&r.target){var p=r.success||function(){};d.push(function(t){var a=r.replaceTarget?"replaceWith":"html";e(r.target)[a](t).each(p,arguments)})}else r.success&&d.push(r.success);r.success=function(e,t,a){for(var n=r.context||r,i=0,o=d.length;i<o;i++)d[i].apply(n,[e,t,a||m,m])};var v=e("input:file",this).length>0,h="multipart/form-data",g=m.attr("enctype")==h||m.attr("encoding")==h;return!1!==r.iframe&&(v||r.iframe||g)?r.closeKeepAlive?e.get(r.closeKeepAlive,a):a():e.ajax(r),this.trigger("form-submit-notify",[this,r]),this},e.fn.ajaxForm=function(r){if(0===this.length){var a={s:this.selector,c:this.context};return!e.isReady&&a.s?(t("DOM not ready, queuing ajaxForm"),e(function(){e(a.s,a.c).ajaxForm(r)}),this):(t("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return this.ajaxFormUnbind().bind("submit.form-plugin",function(t){t.isDefaultPrevented()||(t.preventDefault(),e(this).ajaxSubmit(r))}).bind("click.form-plugin",function(t){var r=t.target,a=e(r);if(!a.is(":submit,input:image")){var n=a.closest(":submit");if(0==n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!=t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)})},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t){var r=[];if(0===this.length)return r;var a=this[0],n=t?a.getElementsByTagName("*"):a.elements;if(!n)return r;var i,o,s,l,u,c,f;for(i=0,c=n.length;i<c;i++)if(u=n[i],s=u.name)if(t&&a.clk&&"image"==u.type)u.disabled||a.clk!=u||(r.push({name:s,value:e(u).val()}),r.push({name:s+".x",value:a.clk_x},{name:s+".y",value:a.clk_y}));else if((l=e.fieldValue(u,!0))&&l.constructor==Array)for(o=0,f=l.length;o<f;o++)r.push({name:s,value:l[o]});else null!==l&&void 0!==l&&r.push({name:s,value:l});if(!t&&a.clk){var m=e(a.clk),d=m[0];s=d.name,s&&!d.disabled&&"image"==d.type&&(r.push({name:s,value:m.val()}),r.push({name:s+".x",value:a.clk_x},{name:s+".y",value:a.clk_y}))}return r},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;i<o;i++)r.push({name:a,value:n[i]});else null!==n&&void 0!==n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;a<n;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(o<0)return null;for(var s=[],l=t.options,u="select-one"==n,c=u?o+1:l.length,f=u?o:0;f<c;f++){var m=l[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),u)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(){return this.each(function(){e("input,select,textarea",this).clearFields()})},e.fn.clearFields=e.fn.clearInputs=function(){return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();"text"==e||"password"==e||"textarea"==t?this.value="":"checkbox"==e||"radio"==e?this.checked=!1:"select"==t&&(this.selectedIndex=-1)})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})}}(jQuery);