/* jQuery Form Plugin version: 3.51.0-2014.06.20 Requires jQuery v1.5 or later Copyright (c) 2014 M. Alsup Examples and documentation at: http://malsup.com/jquery/form/ Project repository: https://github.com/malsup/form Dual licensed under the MIT and GPL licenses. https://github.com/malsup/form#copyright-and-license */ (function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(a){function b(g){var n=g.data;g.isDefaultPrevented()||(g.preventDefault(),a(g.target).ajaxSubmit(n))}function c(g){var n=g.target,v=a(n);if(!v.is("[type=submit],[type=image]")){n=v.closest("[type=submit]");if(0===n.length)return;n=n[0]}var t=this;t.clk=n;"image"==n.type&&(void 0!==g.offsetX?(t.clk_x=g.offsetX,t.clk_y=g.offsetY):"function"==typeof a.fn.offset?(v=v.offset(), t.clk_x=g.pageX-v.left,t.clk_y=g.pageY-v.top):(t.clk_x=g.pageX-n.offsetLeft,t.clk_y=g.pageY-n.offsetTop));setTimeout(function(){t.clk=t.clk_x=t.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var g="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(g):window.opera&&window.opera.postError&&window.opera.postError(g)}}var e=void 0!==a("").get(0).files;var f=void 0!==window.FormData;var k=!!a.fn.prop;a.fn.attr2=function(){if(!k)return this.attr.apply(this, arguments);var g=this.prop.apply(this,arguments);return g&&g.jquery||"string"===typeof g?g:this.attr.apply(this,arguments)};a.fn.ajaxSubmit=function(g){function n(l){l=a.param(l,g.traditional).split("&");var p=l.length,r=[],w;for(w=0;w').val(u.extraData[O].value).appendTo(x)[0]):Q.push(a('').val(u.extraData[O]).appendTo(x)[0]));u.iframeTarget||T.appendTo("body");P.attachEvent?P.attachEvent("onload",w):P.addEventListener("load",w,!1);setTimeout(C,15);try{x.submit()}catch(S){document.createElement("form").submit.apply(x)}}finally{x.setAttribute("action",J),x.setAttribute("enctype",N),D?x.setAttribute("target", D):q.removeAttr("target"),a(Q).remove()}}function w(C){if(!z.aborted&&!ba)if(I=p(P),I||(d("cannot access response document"),C=2),1===C&&z)z.abort("timeout"),R.reject(z,"timeout");else if(2==C&&z)z.abort("server abort"),R.reject(z,"error","server abort");else if(I&&I.location.href!=u.iframeSrc||L){P.detachEvent?P.detachEvent("onload",w):P.removeEventListener("load",w,!1);C="success";var D;try{if(L)throw"timeout";var J="xml"==u.dataType||I.XMLDocument||a.isXMLDoc(I);d("isXml="+J);if(!J&&window.opera&& (null===I.body||!I.body.innerHTML)&&--da){d("requeing onLoad callback, DOM not available");setTimeout(w,250);return}var N=I.body?I.body:I.documentElement;z.responseText=N?N.innerHTML:null;z.responseXML=I.XMLDocument?I.XMLDocument:I;J&&(u.dataType="xml");z.getResponseHeader=function(W){return{"content-type":u.dataType}[W.toLowerCase()]};N&&(z.status=Number(N.getAttribute("status"))||z.status,z.statusText=N.getAttribute("statusText")||z.statusText);var Q=(u.dataType||"").toLowerCase(),O=/(json|script|text)/.test(Q); if(O||u.textarea){var S=I.getElementsByTagName("textarea")[0];if(S)z.responseText=S.value,z.status=Number(S.getAttribute("status"))||z.status,z.statusText=S.getAttribute("statusText")||z.statusText;else if(O){var V=I.getElementsByTagName("pre")[0],Z=I.getElementsByTagName("body")[0];V?z.responseText=V.textContent?V.textContent:V.innerText:Z&&(z.responseText=Z.textContent?Z.textContent:Z.innerText)}}else"xml"==Q&&!z.responseXML&&z.responseText&&(z.responseXML=ea(z.responseText));try{ca=fa(z,Q,u)}catch(W){C= "parsererror",z.error=D=W||C}}catch(W){d("error caught: ",W),C="error",z.error=D=W||C}z.aborted&&(d("upload aborted"),C=null);z.status&&(C=200<=z.status&&300>z.status||304===z.status?"success":"error");"success"===C?(u.success&&u.success.call(u.context,ca,"success",z),R.resolve(z.responseText,"success",z),H&&a.event.trigger("ajaxSuccess",[z,u])):C&&(void 0===D&&(D=z.statusText),u.error&&u.error.call(u.context,z,C,D),R.reject(z,"error",D),H&&a.event.trigger("ajaxError",[z,u,D]));H&&a.event.trigger("ajaxComplete", [z,u]);H&&!--a.active&&a.event.trigger("ajaxStop");u.complete&&u.complete.call(u.context,z,C);ba=!0;u.timeout&&clearTimeout(M);setTimeout(function(){u.iframeTarget?T.attr("src",u.iframeSrc):T.remove();z.responseXML=null},100)}}var x=q[0],y,H,L,M,R=a.Deferred();R.abort=function(C){z.abort(C)};if(l)for(y=0;y'),T.css({position:"absolute",top:"-1000px",left:"-1000px"});var P=T[0];var z={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(C){var D="timeout"===C?"timeout":"aborted";d("aborting upload... "+D);this.aborted=1;try{P.contentWindow.document.execCommand&& P.contentWindow.document.execCommand("Stop")}catch(J){}T.attr("src",u.iframeSrc);z.error=D;u.error&&u.error.call(u.context,z,D,C);H&&a.event.trigger("ajaxError",[z,u,D]);u.complete&&u.complete.call(u.context,z,D)}};(H=u.global)&&0===a.active++&&a.event.trigger("ajaxStart");H&&a.event.trigger("ajaxSend",[z,u]);if(u.beforeSend&&!1===u.beforeSend.call(u.context,z,u))return u.global&&a.active--,R.reject(),R;if(z.aborted)return R.reject(),R;(l=x.clk)&&(y=l.name)&&!l.disabled&&(u.extraData=u.extraData|| {},u.extraData[y]=l.value,"image"==l.type&&(u.extraData[y+".x"]=x.clk_x,u.extraData[y+".y"]=x.clk_y));l=a("meta[name=csrf-token]").attr("content");(y=a("meta[name=csrf-param]").attr("content"))&&l&&(u.extraData=u.extraData||{},u.extraData[y]=l);u.forceSync?r():setTimeout(r,10);var ca,I,da=50,ba,ea=a.parseXML||function(C,D){window.ActiveXObject?(D=new ActiveXObject("Microsoft.XMLDOM"),D.async="false",D.loadXML(C)):D=(new DOMParser).parseFromString(C,"text/xml");return D&&D.documentElement&&"parsererror"!= D.documentElement.nodeName?D:null},ha=a.parseJSON||function(C){return window.eval("("+C+")")},fa=function(C,D,J){var N=C.getResponseHeader("content-type")||"",Q="xml"===D||!D&&0<=N.indexOf("xml");C=Q?C.responseXML:C.responseText;Q&&"parsererror"===C.documentElement.nodeName&&a.error&&a.error("parsererror");J&&J.dataFilter&&(C=J.dataFilter(C,D));"string"===typeof C&&("json"===D||!D&&0<=N.indexOf("json")?C=ha(C):("script"===D||!D&&0<=N.indexOf("javascript"))&&a.globalEval(C));return C};return R}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"), this;var q=this;"function"==typeof g?g={success:g}:void 0===g&&(g={});var A=g.type||this.attr2("method");var B=g.url||this.attr2("action");(B=(B="string"===typeof B?a.trim(B):"")||window.location.href||"")&&(B=(B.match(/^([^#]+)/)||[])[1]);g=a.extend(!0,{url:B,success:a.ajaxSettings.success,type:A||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},g);B={};this.trigger("form-pre-serialize",[this,g,B]);if(B.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this;if(g.beforeSerialize&&!1===g.beforeSerialize(this,g))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var G=g.traditional;void 0===G&&(G=a.ajaxSettings.traditional);var K=[],E=this.formToArray(g.semantic,K);if(g.data){g.extraData=g.data;var F=a.param(g.data,G)}if(g.beforeSubmit&&!1===g.beforeSubmit(E,this,g))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[E,this,g,B]);if(B.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this;B=a.param(E,G);F&&(B=B?B+"&"+F:F);"GET"==g.type.toUpperCase()?(g.url+=(0<=g.url.indexOf("?")?"&":"?")+B,g.data=null):g.data=B;var U=[];g.resetForm&&U.push(function(){q.resetForm()});g.clearForm&&U.push(function(){q.clearForm(g.includeHidden)});if(!g.dataType&&g.target){var aa=g.success||function(){};U.push(function(l){var p=g.replaceTarget?"replaceWith":"html";a(g.target)[p](l).each(aa,arguments)})}else g.success&&U.push(g.success);g.success=function(l,p,r){for(var w=g.context||this,x=0,y=U.length;x< y;x++)U[x].apply(w,[l,p,r||q,q])};if(g.error){var X=g.error;g.error=function(l,p,r){X.apply(g.context||this,[l,p,r,q])}}if(g.complete){var h=g.complete;g.complete=function(l,p){h.apply(g.context||this,[l,p,q])}}F=0q)return null;n=[];g=g.options;v=(t="select-one"==t)?q+1:g.length;for(q=t?q:0;q").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").addBack().last();this.tagInput=a('').addClass("ui-widget-content");this.options.readOnly&&this.tagInput.attr("disabled","disabled");this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex);this.options.placeholderText&&this.tagInput.attr("placeholder", this.options.placeholderText);this.options.autocomplete.source||(this.options.autocomplete.source=function(f,k){var g=f.term.toLowerCase();f=a.grep(this.options.availableTags,function(n){return 0===n.toLowerCase().indexOf(g)});this.options.allowDuplicates||(f=this._subtractArray(f,this.assignedTags()));k(f)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(f,k){b._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength= 0));a.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=a.proxy(this.options.autocomplete.source,this));a.isFunction(this.options.tagSource)&&(this.options.tagSource=a.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('
  • ').append(this.tagInput)).click(function(f){var k=a(f.target);k.hasClass("tagit-label")?(k=k.closest(".tagit-choice"),k.hasClass("removed")||b._trigger("onTagClicked", f,{tag:k,tagLabel:b.tagLabel(k)})):b.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=a(this.options.singleFieldNode),e=d.val().split(this.options.singleFieldDelimiter);d.val("");a.each(e,function(f,k){b.createTag(k,null,!0);c=!0})}else this.options.singleFieldNode=a(''),this.tagList.after(this.options.singleFieldNode);c||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")|| (b.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(f){if(f.which==a.ui.keyCode.BACKSPACE&&""===b.tagInput.val()){var k=b._lastTag();!b.options.removeConfirmation||k.hasClass("remove")?b.removeTag(k):b.options.removeConfirmation&&k.addClass("remove ui-state-highlight")}else b.options.removeConfirmation&&b._lastTag().removeClass("remove ui-state-highlight");if(","===f.key&&!1===f.shiftKey||f.which===a.ui.keyCode.ENTER||f.which==a.ui.keyCode.TAB&& ""!==b.tagInput.val()||f.which==a.ui.keyCode.SPACE&&!0!==b.options.allowSpaces&&('"'!=a.trim(b.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(b.tagInput.val()).charAt(0)&&'"'==a.trim(b.tagInput.val()).charAt(a.trim(b.tagInput.val()).length-1)&&0!==a.trim(b.tagInput.val()).length-1))f.which===a.ui.keyCode.ENTER&&""===b.tagInput.val()||f.preventDefault(),b.options.autocomplete.autoFocus&&b.tagInput.data("autocomplete-open")||(b.tagInput.autocomplete("close"),b.createTag(b._cleanedInput()))}).blur(function(f){b.tagInput.data("autocomplete-open")|| b.createTag(b._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(f,k){b.createTag(k.item.value);return!1}},a.extend(d,this.options.autocomplete),d.source=this.options.tagSource||d.source,this.tagInput.autocomplete(d).bind("autocompleteopen.tagit",function(f,k){b.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(f,k){b.tagInput.data("autocomplete-open",!1)}),this.tagInput.autocomplete("widget").addClass("tagit-autocomplete")}, destroy:function(){a.Widget.prototype.destroy.call(this);this.element.unbind(".tagit");this.tagList.unbind(".tagit");this.tagInput.removeData("autocomplete-open");this.tagList.removeClass("tagit ui-widget ui-widget-content ui-corner-all tagit-hidden-field");this.element.is("input")?(this.element.removeClass("tagit-hidden-field"),this.tagList.remove()):(this.element.children("li").each(function(){a(this).hasClass("tagit-new")?a(this).remove():(a(this).removeClass("tagit-choice ui-widget-content ui-state-default ui-state-highlight ui-corner-all remove tagit-choice-editable tagit-choice-read-only"), a(this).text(a(this).children(".tagit-label").text()))}),this.singleFieldNode&&this.singleFieldNode.remove());return this},_cleanedInput:function(){return a.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var b=this,c=[];this.options.singleField?(c=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter), ""===c[0]&&(c=[])):this._tags().each(function(){c.push(b.tagLabel(this))});return c},_updateSingleTagsField:function(b){a(this.options.singleFieldNode).val(b.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(b,c){for(var d=[],e=0;e=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:d}),!1;var f=a(this.options.onTagClicked?'':'').text(b),k=a("
  • ").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(c).append(f); this.options.readOnly?k.addClass("tagit-choice-read-only"):(k.addClass("tagit-choice-editable"),c=a("").addClass("ui-icon ui-icon-close"),c=a('\u00d7').addClass("tagit-close").append(c).click(function(g){e.removeTag(k)}),k.append(c));this.options.singleField||(f=f.html(),k.append(''));!1!==this._trigger("beforeTagAdded",null,{tag:k,tagLabel:this.tagLabel(k), duringInitialization:d})&&(this.options.singleField&&(f=this.assignedTags(),f.push(b),this._updateSingleTagsField(f)),this._trigger("onTagAdded",null,k),this.tagInput.val(""),this.tagInput.parent().before(k),this._trigger("afterTagAdded",null,{tag:k,tagLabel:this.tagLabel(k),duringInitialization:d}),this.options.showAutocompleteOnFocus&&!d&&setTimeout(function(){e._showAutocomplete()},0))},removeTag:function(b,c){c="undefined"===typeof c?this.options.animate:c;b=a(b);this._trigger("onTagRemoved", null,b);if(!1!==this._trigger("beforeTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(b);d=a.grep(d,function(k){return k!=e});this._updateSingleTagsField(d)}if(c){b.addClass("removed");c=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"];var f=this;c.push(function(){b.remove();f._trigger("afterTagRemoved",null,{tag:b,tagLabel:f.tagLabel(b)})});b.fadeOut("fast").hide.apply(b,c).dequeue()}else b.remove(), this._trigger("afterTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})}},removeTagByLabel:function(b,c){var d=this._findTagByLabel(b);if(!d)throw"No such tag exists with the name '"+b+"'";this.removeTag(d,c)},removeAll:function(){var b=this;this._tags().each(function(c,d){b.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var e=c.call(this),f=e.parentNode,k=f.insertBefore(document.createTextNode(""),e.nextSibling);return function(){if(f===this)throw Error("You can't sort elements if any one is a descendant of another.");f.insertBefore(this,k);f.removeChild(k)}});return a.call(this,b).each(function(e){d[e].call(c.call(this))})}}();/* jQuery Cookie Plugin v1.4.0 https://github.com/carhartl/jquery-cookie Copyright 2013 Klaus Hartl Released under the MIT license */ (function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){function b(f){f=e.json?JSON.stringify(f):String(f);return e.raw?f:encodeURIComponent(f)}function c(f,k){if(e.raw)var g=f;else a:{0===f.indexOf('"')&&(f=f.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{f=decodeURIComponent(f.replace(d," "))}catch(n){g=void 0;break a}try{g=e.json?JSON.parse(f):f;break a}catch(n){}g=void 0}return a.isFunction(k)?k(g):g}var d=/\+/g,e=a.cookie=function(f,k,g){if(void 0!== k&&!a.isFunction(k)){g=a.extend({},e.defaults,g);if("number"===typeof g.expires){var n=g.expires,v=g.expires=new Date;v.setDate(v.getDate()+n)}return document.cookie=[e.raw?f:encodeURIComponent(f),"=",b(k),g.expires?"; expires="+g.expires.toUTCString():"",g.path?"; path="+g.path:"",g.domain?"; domain="+g.domain:"",g.secure?"; secure":""].join("")}g=f?void 0:{};n=document.cookie?document.cookie.split("; "):[];v=0;for(var t=n.length;v'),p=h.attr("multiple")||1\u00a0");var x=parseInt(w.find(".selectBox-options A:first").html(" ").outerHeight());w.remove();l.height(x*p)}}else p=a(''),w=a(''),p.attr("class",n(h)).text(v(h)),r=g(h,"dropdown"),r.appendTo("BODY"),l.data("selectBox-options",r).addClass("selectBox-dropdown").append(p).append(w).bind("mousedown.selectBox", function(y){l.hasClass("selectBox-menuShowing")?A():(y.stopPropagation(),r.data("selectBox-down-at-x",y.screenX).data("selectBox-down-at-y",y.screenY),q(h))}).bind("keydown.selectBox",function(y){F(h,y)}).bind("keypress.selectBox",function(y){U(h,y)}).bind("open.selectBox",function(y,H){H&&!0===H._selectBox||q(h)}).bind("close.selectBox",function(y,H){H&&!0===H._selectBox||A()}).insertAfter(h),w=l.width()-w.outerWidth()-parseInt(p.css("paddingLeft"))-parseInt(p.css("paddingLeft")),p.width(w);X(l); h.addClass("selectBox").data("selectBox-control",l).data("selectBox-settings",m).hide()},g=function(h,m){var l=function(w,x){w.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0"),M=a("");L.addClass(y.attr("class"));L.data(y.data());M.attr("rel",y.val()).text(y.text());L.append(M);y.attr("disabled")&&L.addClass("selectBox-disabled");y.attr("selected")&&L.addClass("selectBox-selected");H.append(L)}else x.append("
  • \u00a0
  • "); else y=a('
  • '),y.text(a(this).attr("label")),x.append(y),x=l(a(this),x)});return x};switch(m){case "inline":var p=a('