function pushToGa(a,b,c){_gaq.push(["_trackEvent",a,b,c])}function validateImei(a,b,c){return 0===a||c.length>0}function rawurlencode(a){return a=(a+"").toString(),encodeURIComponent(a).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function alerts(){var a=FK.getTemplate("alerts_dialog"),b=$(a());$("body").append(b),b.on("hidden",function(){b.detach()}),b.modal()}function unreadAlerts(){$.ajax({url:"onboarding/alerts/seller/"+FK.getSellerId()+"/latest-messages"}).success(function(a){var b=FK.getTemplate("unread-alerts-template"),c=$(b({alerts:a}));$("#unread-alerts").html(c)})}function markDownloaded(a){$.ajax({url:"onboarding/seller/"+FK.getSellerId()+"/bulk_rts?is_downloaded=true",type:"GET",success:function(){"use strict";a&&$(a.srcElement).click(function(a){a.stopPropagation(),window.open(a.srcElement.href)})},error:function(){"use strict"}})}function hideShownOfferPopOvers(a){$(a.target).hasClass("offers")||($(".offers").length>0?$(".offers").popover("hide"):$(".offerPopOver").remove())}function handleClickOnDownloadErrorsOrPDF(a){return a.srcElement.href&&-1==a.srcElement.href.indexOf("javascript")&&(window.open(a.srcElement.href),a.srcElement.hasAttribute("data-notify-label-pdf-download")?markDownloaded(a):a.srcElement.hasAttribute("data-notify-error-csv-download")&&markDownloaded(a)),!1}function fixFooter(){"use strict";var a=$(window).height()-$("#mainContainer .navigation-header").eq(0).height(),b=$("#outer-tab-content").height();a>b&&$("#footer").css({position:"fixed",bottom:0})}!function(a,b,c){function d(a){return a}function e(a){return decodeURIComponent(a.replace(f," "))}var f=/\+/g,g=a.cookie=function(f,h,i){if(h!==c){if(i=a.extend({},g.defaults,i),null===h&&(i.expires=-1),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}return h=g.json?JSON.stringify(h):String(h),b.cookie=[encodeURIComponent(f),"=",g.raw?h:encodeURIComponent(h),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l,m=g.raw?d:e,n=b.cookie.split("; "),o=0;l=n[o]&&n[o].split("=");o++)if(m(l.shift())===f){var p=m(l.join("="));return g.json?JSON.parse(p):p}return null};g.defaults={},a.removeCookie=function(b,c){return null!==a.cookie(b)?(a.cookie(b,null,c),!0):!1}}(jQuery,document),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();var _gaq=_gaq||[];if(_gaq.push(["_setAccount",sellerTracking.googleAnalyticsId]),_gaq.push(["_trackPageview"]),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}(),"seller.flipkart.com"===window.location.hostname){var pageURL=window.location.href;window.onerror=function(a,b,c){_gaq&&_gaq.push&&_gaq.push(["_trackEvent","JavascriptError on "+window.location.hostname,pageURL,a+" on line "+c+" for "+b+" for sellerId "+FK.getSellerId()])}}!function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"),void 0;var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){if(a(this[0]).is("form"))return this.validate().form();var b=!0,c=a(this[0].form).validate();return this.each(function(){b&=c.element(this)}),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d=this[0];if(b){var e=a.data(d.form,"validator").settings,f=e.rules,g=a.validator.staticRules(d);switch(b){case"add":a.extend(g,a.validator.normalizeRule(c)),f[d.name]=g,c.messages&&(e.messages[d.name]=a.extend(e.messages[d.name],c.messages));break;case"remove":if(!c)return delete f[d.name],g;var h={};return a.each(c.split(/\s/),function(a,b){h[b]=g[b],delete g[b]}),h}}var i=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(d),a.validator.classRules(d),a.validator.attributeRules(d),a.validator.staticRules(d)),d);if(i.required){var j=i.required;delete i.required,i=a.extend({required:j},i)}return i}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+b.value)},filled:function(b){return!!a.trim(""+b.value)},unchecked:function(a){return!a.checked}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),c)}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(a)).hide())},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastActive)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required",remote:"Please fix this field",email:"Please enter a valid email address",url:"Please enter a valid URL",date:"Please enter a valid date",dateISO:"Please enter a valid date (ISO)",number:"Please enter a valid number",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number",allowedCharacters:"Your input seems to have some invalid characters",equalTo:"Please enter the same value again",maxlength:a.validator.format("Please enter no more than {0} characters"),minlength:a.validator.format("Please enter at least {0} characters"),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long"),range:a.validator.format("Please enter a value between {0} and {1}"),max:a.validator.format("Please enter a value less than or equal to {0}"),min:a.validator.format("Please enter a value greater than or equal to {0}")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,"");c.settings[d]&&c.settings[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c=this.groups={};a.each(this.settings.groups,function(b,d){a.each(d.split(/\s/),function(a,d){c[d]=b})});var d=this.settings.rules;a.each(d,function(b,c){d[b]=a.validator.normalizeRule(c)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",b).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.validationTargetFor(this.clean(b)),this.lastElement=b,this.prepareElement(b),this.currentElements=a(b);var c=this.check(b)!==!1;return c?delete this.invalid[b.name]:this.invalid[b.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),c},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0;for(var c in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.replace(" ",".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c=a(b).attr("type"),d=a(b).val();return"radio"===c||"checkbox"===c?a('input[name="'+a(b).attr("name")+'"]:checked').val():"string"==typeof d?d.replace(/\r/g,""):d},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d=a(b).rules(),e=!1,f=this.elementValue(b);for(var g in d){var h={method:g,parameters:d[g]};try{if(c=a.validator.methods[g].call(this,f,b,h.parameters),"dependency-mismatch"===c){e=!0;continue}if(e=!1,"pending"===c)return this.toHide=this.toHide.not(this.errorsFor(b)),void 0;if(!c)return this.formatAndAdd(b,h),!1}catch(i){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+h.method+"' method",i),i}}return e?void 0:(this.objectLength(d)&&this.successList.push(b),!0)},customMetaMessage:function(b,c){if(a.metadata){var d=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return d&&d.messages&&d.messages[c]}},customDataMessage:function(b,c){return a(b).data("msg-"+c.toLowerCase())||b.attributes&&a(b).attr("data-msg-"+c.toLowerCase())},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b;for(a=0;this.errorList[a];a++){var c=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d=this.errorsFor(b);d.length?(d.removeClass(this.settings.validClass).addClass(this.settings.errorClass),d.attr("generated")&&d.html(c)):(d=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:!0}).addClass(this.settings.errorClass).html(c||""),this.settings.wrapper&&(d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b))),!c&&this.settings.success&&(d.text(""),"string"==typeof this.settings.success?d.addClass(this.settings.success):this.settings.success(d,b)),this.toShow=this.toShow.add(d)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")===c})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find('[name="'+b+'"]')},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0},allowedCharacters:{allowedCharacters:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c={},d=a(b);for(var e in a.validator.methods){var f;"required"===e?(f=d.get(0).getAttribute(e),""===f&&(f=!0),f=!!f):f=d.attr(e),f?c[e]=f:d[0].getAttribute("type")===e&&(c[e]=!0)}return c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength,c},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return delete b[d],void 0;if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength","min","max"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){b[this]&&(b[this]=[Number(b[this][0]),Number(b[this][1])])}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b.messages&&delete b.messages,b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e=this.previousValue(c);if(this.settings.messages[c.name]||(this.settings.messages[c.name]={}),e.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=e.message,d="string"==typeof d&&{url:d}||d,this.pending[c.name])return"pending";if(e.old===b)return e.valid;e.old=b;var f=this;this.startRequest(c);var g={};return g[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:g,success:function(d){f.settings.messages[c.name].remote=e.originalMessage;var g=d===!0||"true"===d;if(g){var h=f.formSubmitted;f.prepareElement(c),f.formSubmitted=h,f.successList.push(c),delete f.invalid[c.name],f.showErrors()}else{var i={},j=d||f.defaultMessage(c,"remote");i[c.name]=e.message=a.isFunction(j)?j(b):j,f.invalid[c.name]=!0,f.showErrors(i)}e.valid=g,f.stopRequest(c,g)}},d)),"pending"},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},allowedCharacters:function(a,b){return this.optional(b)||/^[\\\n\?a-zA-Z0-9\s,.:_@#!$%&*()/+\-\"\']+$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c=0,d=0,e=!1;a=a.replace(/\D/g,"");for(var f=a.length-1;f>=0;f--){var g=a.charAt(f);d=parseInt(g,10),e&&(d*=2)>9&&(d-=9),c+=d,e=!e}return c%10===0},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()}}}),a.format=a.validator.format}(jQuery),function(a){var b={};if(a.ajaxPrefilter)a.ajaxPrefilter(function(a,c,d){var e=a.port;"abort"===a.mode&&(b[e]&&b[e].abort(),b[e]=d)});else{var c=a.ajax;a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(b[f]&&b[f].abort(),b[f]=c.apply(this,arguments)):c.apply(this,arguments)}}}(jQuery),function(a){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||a.each({focus:"focusin",blur:"focusout"},function(b,c){function d(b){return b=a.event.fix(b),b.type=c,a.event.handle.call(this,b)}a.event.special[c]={setup:function(){this.addEventListener(b,d,!0)},teardown:function(){this.removeEventListener(b,d,!0)},handler:function(b){var d=arguments;return d[0]=a.event.fix(b),d[0].type=c,a.event.handle.apply(this,d)}}}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})}(jQuery),function(){function a(a){return a.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("maxWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length<=d},jQuery.validator.format("Please enter {0} words or less.")),jQuery.validator.addMethod("minWords",function(b,c,d){return this.optional(c)||a(b).match(/\b\w+\b/g).length>=d},jQuery.validator.format("Please enter at least {0} words.")),jQuery.validator.addMethod("rangeWords",function(b,c,d){var e=a(b),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},jQuery.validator.format("Please enter between {0} and {1} words."))}(),jQuery.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'\"\s]+$/i.test(a)},"Letters or punctuation only please"),jQuery.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),jQuery.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),jQuery.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),jQuery.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx"),jQuery.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/\d{5}-\d{4}$|^\d{5}$/.test(a)},"The specified US ZIP Code is invalid"),jQuery.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),jQuery.validator.addMethod("vinUS",function(a){if(17!=a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8==b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8==c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10==f&&(f="X"),f==g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),jQuery.validator.addMethod("dateITA",function(a,b){var c=!1,d=/^\d{1,2}\/\d{1,2}\/\d{4}$/;if(d.test(a)){var e=a.split("/"),f=parseInt(e[0],10),g=parseInt(e[1],10),h=parseInt(e[2],10),i=new Date(h,g-1,f);c=i.getFullYear()==h&&i.getMonth()==g-1&&i.getDate()==f?!0:!1}else c=!1;return this.optional(b)||c},"Please enter a correct date"),jQuery.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(a)},"Vul hier een geldige datum in."),jQuery.validator.addMethod("time",function(a,b){return this.optional(b)||/^([0-1]\d|2[0-3]):([0-5]\d)$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),jQuery.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(a)},"Please enter a valid time, between 00:00 am and 12:00 pm"),jQuery.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number"),jQuery.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:(?:\d{5}\)?\s?\d{4,5})|(?:\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3}))|(?:\d{3}\)?\s?\d{3}\s?\d{3,4})|(?:\d{2}\)?\s?\d{4}\s?\d{4}))$/)},"Please specify a valid phone number"),jQuery.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),jQuery.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),jQuery.validator.addMethod("postcodeUK",function(a,b){return a=a.toUpperCase().replace(/\s+/g,""),this.optional(b)||a.match(/^([^QZ][^IJZ]{0,1}\d{1,2})(\d[^CIKMOV]{2})$/)||a.match(/^([^QV]\d[ABCDEFGHJKSTUW])(\d[^CIKMOV]{2})$/)||a.match(/^([^QV][^IJZ]\d[ABEHMNPRVWXY])(\d[^CIKMOV]{2})$/)||a.match(/^(GIR)(0AA)$/)||a.match(/^(BFPO)(\d{1,4})$/)||a.match(/^(BFPO)(C\/O\d{1,3})$/)
},"Please specify a valid postcode"),jQuery.validator.addMethod("strippedminlength",function(a,b,c){return jQuery(a).text().length>=c},jQuery.validator.format("Please enter at least {0} characters")),jQuery.validator.addMethod("email2",function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)},jQuery.validator.messages.email),jQuery.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},jQuery.validator.messages.url),jQuery.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16==a.length:2&d&&/^(4)/.test(a)?16==a.length:4&d&&/^(3[47])/.test(a)?15==a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14==a.length:16&d&&/^(2(014|149))/.test(a)?15==a.length:32&d&&/^(6011)/.test(a)?16==a.length:64&d&&/^(3)/.test(a)?16==a.length:64&d&&/^(2131|1800)/.test(a)?15==a.length:128&d?!0:!1},"Please enter a valid credit card number."),jQuery.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),jQuery.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),jQuery.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),jQuery.validator.addMethod("require_from_group",function(a,b,c){var d=this,e=c[1],f=$(e,b.form).filter(function(){return d.elementValue(this)}).length>=c[0];if(!$(b).data("being_validated")){var g=$(e,b.form);g.data("being_validated",!0),g.valid(),g.data("being_validated",!1)}return f},jQuery.format("Please fill at least {0} of these fields.")),jQuery.validator.addMethod("skip_or_fill_minimum",function(a,b,c){var d=this;numberRequired=c[0],selector=c[1];var e=$(selector,b.form).filter(function(){return d.elementValue(this)}).length,f=e>=numberRequired||0===e;if(!$(b).data("being_validated")){var g=$(selector,b.form);g.data("being_validated",!0),g.valid(),g.data("being_validated",!1)}return f},jQuery.format("Please either skip these fields or fill at least {0} of them.")),jQuery.validator.addMethod("accept",function(a,b,c){var d,e,f="string"==typeof c?c.replace(/,/g,"|"):"image/*",g=this.optional(b);if(g)return g;if("file"===$(b).attr("type")&&(f=f.replace("*",".*"),b.files&&b.files.length))for(d=0;d<b.files.length;d++)if(e=b.files[d],!e.type.match(new RegExp(".?("+f+")$","i")))return!1;return!0},jQuery.format("Please enter a value with a valid mimetype.")),jQuery.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},jQuery.format("Please enter a value with a valid extension.")),jQuery.validator.addMethod("imeiCount",function(a,b){"use strict";var c=a.split(","),d=parseInt($(b).attr("imei-count"),10);return validateImei(d,c,a)},"Incorrect number of serial/imei numbers(numbers must be separated by a comma ',')"),jQuery.validator.addMethod("mobileDigits",function(a,b){return this.optional(b)||/^[0-9+]+$/.test(a)},"Mobile number contains invalid characters"),jQuery.validator.addMethod("mobileLength",function(a){return 0==a.indexOf("+91")?13==a.length:0==a.indexOf("0")?11==a.length:a.indexOf("+")>=0?!1:10==a.length},"Please enter a valid 10-digit number"),jQuery.validator.addMethod("displayNameCharacters",function(a,b){return this.optional(b)||/^[a-zA-Z0-9]{3,22}$/.test(a)},"Display name contains invalid characters"),jQuery.validator.addMethod("invoiceValidation",function(a,b){return this.optional(b)||/^(?=.*\d)[a-zA-Z\d\\/#-]{1,29}$/.test(a)},"Invoice number contains invalid charachters"),jQuery.validator.addMethod("doesNotHaveFlipKart",function(a){"use strict";var b=a.toLowerCase();return-1===b.indexOf("flip")&&-1===b.indexOf("kart")},"Display name cannot have 'flip' or 'kart'"),jQuery.validator.addMethod("panFormat",function(a,b){return this.optional(b)||/^[A-Za-z]{3}[CHFATBLJGPchfatbljgp]{1}[A-Za-z]{1}\d{4}[A-Za-z]{1}$/.test(a)},"PAN ID must belong to a company, firm, trust, or local authority"),jQuery.validator.addMethod("noURLinDescription",function(a,b){return this.optional(b)||!/(https:\/\/|http:\/\/|www|\w\w+\.com|\w\w+\.org|\w\w+\.in|\w\w+\.net)/.test(a)},"Links not allowed in description"),jQuery.validator.addMethod("passwordCheck",function(a,b){return this.optional(b)||/\d/.test(a)&&/[a-zA-Z]/.test(a)},"Your password should contain atleast one digit and one alphabet"),jQuery.validator.addMethod("passwordLength",function(a){return a.length>=4},"Your password must be at least 4 characters long"),jQuery.validator.addMethod("letters",function(a,b){return this.optional(b)||/^[a-zA-Z]+$/.test(a)},"This field should contain only letters and no spaces"),jQuery.validator.addMethod("sameAsOldPassword",function(a){return $("#oldPassword").val()!==a},"Enter a different password"),jQuery.validator.addMethod("notAccountNumber",function(a,b){return this.optional(b)||/^(?=.*[a-zA-Z]).+$/.test(a)},"You seem to have entered your account number instead of account name"),jQuery.validator.addMethod("taxLessThanAmt",function(a,b){var c=parseFloat(a),d=parseFloat($(b).parents("fieldset").find(".invoice-amount").val());return d>=c},"Tax is more than invoice amount"),jQuery.validator.addMethod("startDateLessThan",function(a){var b=$("#toDate").val(),c=moment(a,"DD/MM/YYYY"),d=moment(b,"DD/MM/YYYY");return d.isAfter(c)||d.isSame(c)?!0:!1},"Start Date should be less than End Date and start date and end date is mandatory"),jQuery.validator.addMethod("uploadTin",function(a){return a!==$("#vatIdStatic").text()&&a!==$("#invoiceCSTNumberLabel").text()?$(".cst-file").show():$(".cst-file").hide(),!0},"Please upload your new CST certificate");var FK=window.FK||{};FK.sellerObject={},FK.mainStart=FK.mainStart||(new Date).getTime(),FK.localStart=(new Date).getTime();var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],banks,bankBranches;FK.getTemplate=function(){var a={};return function(b){return"undefined"==typeof a[b]&&$.ajax("templates/"+b+".jade",{async:!1,success:function(c){a[b]=jade.compile(c)}}),a[b]}}(),FK.addPageContent=function(a){"use strict";$("outer-tab-content").html(a),$("#processingContainer").hide()},FK.getSellerId=function(){var a=FK.searchToObject();return a.hasOwnProperty("sellerId")?(this.debug(a.sellerId),a.sellerId):$.cookie("sellerId")||"abc"},FK.getSellerIdFromQuery=function(){return FK.searchToObject().sellerId},FK.getSellerObjectBySellerId=function(a){$.ajax({type:"GET",cache:!1,headers:{"cache-control":"no-cache",pragma:"no-cache"},url:"seller/"+FK.getSellerId(),success:function(b){a(b)},error:function(b){a(null,b)}})},FK.getCityByPincode=function(a,b){$.ajax("onboarding/fkl/"+encodeURIComponent(a)+"/get_city",{success:function(a){if(1e3===JSON.parse(a).code){var c=JSON.parse(a).data;b(c,null)}},error:function(a){b(null,a)}})},FK.getPincodeServiceability=function(a,b){$.ajax("onboarding/fkl/"+encodeURIComponent(a)+"/check_serviceability",{success:function(a){b(a,null)},error:function(a){b(null,a)}})},FK.getSellerBank=function(a){$.ajax({type:"GET",headers:{"cache-control":"no-cache"},url:encodeURI("seller/"+FK.getSellerId()+"/bank"),success:function(b){a(b)},error:function(b){a(null,b)}})},FK.getBanks=function(a,b){$.ajax({type:"GET",url:encodeURI("manageProfile/banks"),success:function(c){banks=c,a(c),FK.getStatesByBankName(b,setBankStatesDropdown)}})},FK.getStatesByBankName=function(a,b){var c=FK.getBankId(a);$.ajax({type:"GET",url:encodeURI("manageProfile/banks?bankId="+c),success:function(c){b(c),sellerBankState&&FK.getCitiesByBankAndState(a,sellerBankState,setBankCitiesDropdown)}})},FK.getCitiesByBankName=function(a,b){var c=FK.getBankId(a);$.ajax({type:"GET",url:encodeURI("manageProfile/banks?bankId="+c),success:function(c){b(c),sellerBankCity&&FK.getBankBranches(a,sellerBankCity,setBankBranchesDropdown)}})},FK.getCitiesByBankAndState=function(a,b,c){var d=FK.getBankId(a);$.ajax({type:"GET",url:encodeURI("manageProfile/banks?bankId="+d+"&state="+b),success:function(b){c(b),sellerBankCity&&FK.getBankBranches(a,sellerBankCity,setBankBranchesDropdown)}})},FK.getBankBranches=function(a,b,c){var d=FK.getBankId(a);$.ajax({type:"GET",url:encodeURI("manageProfile/banks?bankId="+d+"&city="+b),success:function(a){bankBranches=a,c(a)}})},FK.getBankId=function(a){for(var b,c=0;c<banks.length&&banks[c].name!==a;)c++;return b=banks[c].id},FK.removeCookies=function(){$.removeCookie("is_login"),$.removeCookie("sellerId"),FK.loggedIn=!1},FK.logout=function(){return FK.debug("LogOut Called"),$.ajax({type:"GET",url:"logout",success:function(a){if(a){var b="/";$(location).attr("href",b)}}}),FK.removeCookies(),!1},FK.isDefined=function(a){return null!=a&&"undefined"!=typeof a},FK.apply=function(a,b,c){if(c&&FK.apply(a,c),a&&b&&"object"==typeof b)for(var d in b)FK.isDefined(b[d])&&(a[d]=b[d]);return a},FK.applyIf=function(a,b){if(a)for(var c in b)FK.isDefined(a[c])||(a[c]=b[c]);return a},FK.extend=function(a,b){return"function"==typeof a?function(c){var d={};if(void 0!=b)for(var e in b)b.hasOwnProperty(e)&&(d[e]={value:b[e],enumerable:!0,writable:!0});var f=new a,g=Object.create(f,d);return g.init&&"function"==typeof g.init&&g.init(c),g}:!1},FK.Bus=function(){var a={};return{on:function(b,c){a[b]=c},fire:function(b,c){a[b](c)}}}(),FK.searchToObject=function(){var a,b,c=window.location.search.substring(1).split("&"),d={};for(b=0;b<c.length;b++)""!==c[b]&&(a=c[b].split("="),d[decodeURIComponent(a[0])]=decodeURIComponent(a[1]));return d},FK.formToJSON=function(a){a instanceof jQuery||(a=$(a));var b={},c=a.serializeArray();return $.each(c,function(){void 0!==b[this.name]?(b[this.name].push||(b[this.name]=[b[this.name]]),b[this.name].push(this.value||"")):b[this.name]=this.value||""}),b},FK.encodePassword=function(a){var b,c=rawurlencode(a),d=[["@","%40"],["*","%2A"],["/","%2F"],["+","%2B"],["%7E","~"]];for(b=0;b<d.length;b++)c=c.replace(d[b][1],d[b][0]);return c=$.trim(c),MD5(c)},FK.debug=function(a){"undefined"!=typeof console&&console.log(a)},FK.disableSellerMenu=function(){$("#listings, #accountingLinkAnchor, #ordersLinkAnchor").addClass("disabled").click(function(a){a.preventDefault()}),$("#accountingCaret, #ordersCaret").addClass("disabled")},FK.nullLinkHandler=function(a){a.preventDefault()},"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),FK.setUpWarnings=function(){var a={},b=jQuery.parseJSON($("#featureConfigsDashboard").val()),c=b&&b.bankAccountVerification||!1;c&&$.ajax({type:"GET",headers:{"cache-control":"no-cache"},url:"seller/"+FK.getSellerId()+"/status?sellerId="+FK.getSellerId(),success:function(b){a=b.data.checklist,$.ajax({type:"GET",headers:{"cache-control":"no-cache"},url:"manageProfile/verification/bankAccount/transferData?sellerId="+FK.getSellerId(),success:function(b){var c=jQuery.parseJSON(b);c.content&&c.content.length>0&&"SCHEDULED"===c.content[0].disbursement_status?FK.alert.persist("Please go to your Profile and confirm your Bank Account.","bank-info"):1e3==c.code&&"verification_success"!=a.bank&&c.data&&c.data.length>0&&"INITIATED"==c.data[0].state&&FK.alert.persist("Please go to your Profile and confirm your Bank Account.","bank-info")}})}})},FK.alert={_alert:function(a,b){var c=$('<div class="alert '+b+'" data-target="#message-area"><button type="button" class="close" data-dismiss="alert">×</button>'+a+"</div>"),d=$("#message-area");c.hasClass("persistent-message")&&c.find(".close").remove(),-1!=b.indexOf("error")&&d.find(".alert-error").remove(),$("#message-area").append(c).show(),c.alert().trigger("fk.alert"),b.indexOf("alert-success")>-1&&setTimeout(function(){c.alert("close")},5e3)},error:function(a,b){this._alert(a,"alert-error "+b)},success:function(a){this._alert(a,"alert-success")},information:function(a){this._alert(a,"alert-info")},warning:function(a){"use strict";this._alert(a,"alert-warning")},persist:function(a,b){"use strict";this._alert(a,"alert-warning persistent-message "+b)},remove:function(a){"use strict";$("#message-area").find("."+a).remove()},allowLink:function(a,b){"use strict";this._alert(a,"alert-"+b+" with-link")}},FK.getQueryParameterByName=function(a){var b=RegExp("[?&]"+a+"=([^&]*)").exec(window.location.search);return b&&decodeURIComponent(b[1].replace(/\+/g," "))},FK.getUrlParameterByName=function(a){var b=RegExp(a+"\\/(.+)").exec(window.location.href);return b&&decodeURIComponent(b[1].replace(/\+/g," "))},FK.getAllUrlParameterByName=function(a){var b=RegExp(a+"\\/([a-zA-Z0-9-_]*)").exec(window.location.href);return b&&decodeURIComponent(b[1].replace(/\+/g," "))},FK.formatDate=function(a){if("-"!=a&&null!=a){var a=new Date(a);return monthNames[a.getMonth()]+" "+a.getDate()+", "+ +a.getFullYear()}},FK.autoCommaMoneyValues=function(a){"use strict";"string"!=typeof a&&(a=a.toString());var b=",",c=a.split(".",2),d=c[1],e=parseInt(c[0]),f="",g=new String(e),h="";if(isNaN(e))return"";for(0>e&&(f="-"),e=Math.abs(e),c=[],h=g.substr(g.length-3),c.unshift(h),g=g.substr(0,g.length-3);g.length>2;)h=g.substr(g.length-2),c.unshift(h),g=g.substr(0,g.length-2);return g.length>0&&c.unshift(g),g=c.join(b),a=void 0===d||d.length<1?g:g+"."+d,a=f+a},FK.checkBulkRTS=function(){FK.checkProcessingStatus()},FK.checkProcessingStatus=function(){$.ajax({url:"onboarding/seller/"+FK.getSellerId()+"/bulk_rts/is_processed",dataType:"json",success:function(a){1e3==a.code&&("DONE"===a.data.processed?$("#orders-acknowledged").trigger({type:"processed_rts",error_count:a.data.error_count,success_count:a.data.success_count,order_item_ids:a.data.order_item_ids}):"PROCESSING"===a.data.processed&&($("#orders-acknowledged").trigger("processing_rts"),FK.alert.information("Please refresh your page to check if the uploaded file has been processed.")))}})},FK.getQueryParams=function(a){var b="";for(var c in a)a[c]&&(b+="&"+c+"="+a[c]);return b},FK.getErrorsURLInBulkRTS=function(){"use strict";var a=new Date,b=FK.getQueryParams({url:encodeURIComponent("/proxy/seller/"+FK.getSellerId()+"/bulk_rts/errors"),fields:"orderId,orderItemId,orderCreatedDate,sku,imei,productId,quantity,invoiceNo,invoiceDate,invoiceAmount,taxAmount,status,errors",headerFields:"Order Id,Order Item Id,Order Date,SKU,IMEI,Product Id,Quantity,Invoice No,Invoice Date,Invoice Amount,Tax Amount,Status,ERRORS",root:"data.errors",filename:"errors-confirmed-orders-"+a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()});return b},FK.compareByField=function(a){return function(b,c){return b[a]<c[a]?-1:b[a]>c[a]?1:0}};var issueTypes={listing:["Unable to download template","Unable to upload listings","Error in listing","Listing rejected","Unable to see listings online","Others"],order:["Unable to confirm order","Unable to print label","Unable to cancel order","Others"],payments:["Payment not received","Wrong payments received","Wrong invoice raised","Others"],account:["Address not updated","Phone number not updated","Others"]};$("#contactUsSubmitButton, #chatSubmitButton").attr("disabled",!0),$("#logout").click(function(){FK.logout()}),$("#contactUs").click(function(){$("#contactUsMessage").val(""),$("#contactUsModal .alert, #chatLoadingButton").hide(),$("#chatSubmitButton,#contactUsSubmitButton").attr("disabled","disabled"),$("#chatSubmitButton").show(),$("#issueTypeSelect").val("select"),$("#issueSubTypeSelect").html("").append("<option selected='true' value='select' disabled='true'>--- Select an Option ---</option>")}),$("#chatSubmitButton").click(function(){$("#chatSubmitButton, #contactUsSubmitButton").attr("disabled","disabled").eq(1).hide(),$("#chatLoadingButton").show();var a=FK.getSellerId(),b="issueType="+encodeURIComponent($("#issueTypeSelect").val())+"&issueSubType="+encodeURIComponent($("#issueSubTypeSelect").val()),c="onboarding/seller/"+a+"/chat?"+b;$.ajax({type:"GET",url:c,success:function(a){if(1e3==jQuery.parseJSON(a).code){{var b=jQuery.parseJSON(a).url;window.open(b,"RightNowChat","toolbar=no, location=no, directories=no, status=no, resizable=yes, copyhistory=no, width=600, height=500,left="+(screen.width/2-300)+",top="+(screen.height/2-300))}return $("#chatSubmitButton").show().attr("disabled","disabled"),$("#chatLoadingButton").hide(),$("#contactUsModal").modal("hide"),void 0}$("#chatLoadingButton").hide(),$("#chatSubmitButton").show().removeAttr("disabled"),$("#chatFailureMessage").html("Chat initiation failed. Please try again later"),$("#chatFailure").show()},error:function(){$("#chatLoadingButton").hide(),$("#chatSubmitButton").show().removeAttr("disabled"),$("#chatFailureMessage").html("Chat initiation failed. Please try again later"),$("#chatFailure").show()}})}),$("#issueTypeSelect, #issueSubTypeSelect").append("<option selected='true' value='select' disabled='true'>--- Select an Option ---</option>"),$("#issueTypeSelect").change(function(){var a=$("#issueTypeSelect").val();$("#issueSubTypeSelect").html(""),$("#contactUsSubmitButton").attr("disabled","disabled"),$("#chatSubmitButton").attr("disabled","disabled");for(var b in issueTypes[a])$("#issueSubTypeSelect").append("<option>"+issueTypes[a][b]+"</option>");$("#issueSubTypeSelect").append("<option selected='true' value='select' disabled='true'>--- Select an Option ---</option>")}),$("#issueSubTypeSelect").change(function(){$("#chatSubmitButton").removeAttr("disabled")}),$("#contactUsForm").validate({rules:{issueType:{required:!0},issueSubType:{required:!0},contactUsMessage:{required:!0}},submitHandler:function(){$("#contactUsSubmitButton").data("type","button"),$("#contactUsSubmitButton").html('<img src="images/btn-primary-loader.gif">'),$("#chatSubmitButton").attr("disabled","disabled");var a={};a.subject=$("#issueTypeSelect").val()+" | "+$("#issueSubTypeSelect").val(),a.message=$("#contactUsMessage").val(),a=JSON.stringify(a),$.ajax({type:"POST",data:a,headers:{"content-type":"application/json"},url:"onboarding/seller/"+FK.getSellerId()+"/sendMessage",success:function(a){1e3==jQuery.parseJSON(a).code?($("#contactUsSuccessMessage").html("Your message was successfully sent."),$("#contactUsSuccess").show(),$("#contactUsSubmitButton").data("type","submit"),$("#contactUsSubmitButton").html("Submit message"),$("#chatSubmitButton").removeAttr("disabled")):($("#contactUsFailureMessage").html("Your message couldn't be sent. Please try again later."),$("#contactUsFailure").show(),$("#contactUsSubmitButton").data("type","submit"),$("#contactUsSubmitButton").html("Submit message"),$("#chatSubmitButton").removeAttr("disabled"))},error:function(){$("#contactUsFailureMessage").html("Your message couldn't be sent. Please try again later."),$("#contactUsFailure").show(),$("#contactUsSubmitButton").data("type","submit"),$("#contactUsSubmitButton").html("Submit message"),$("#chatSubmitButton").removeAttr("disabled")}})}}),0!==$("#alerts").length&&($.ajax({url:"onboarding/alerts/seller/"+FK.getSellerId()+"/unreadCount"}).success(function(a){$("#alerts .message-count").html(a.totalCount)}),$("#messages").click(alerts),$("#alerts").click(unreadAlerts)),$("body").on("click",".with-link",handleClickOnDownloadErrorsOrPDF),$("body").on("click",hideShownOfferPopOvers),$(".container").on("click",".alert",function(a){var b=a.target||a.srcElement;return"with-link"!==b.className?!1:!0}),$("body").on("click",".popover .close",function(a){var b=a.target||a.srcElement;b.hasAttribute("data-popover-src")&&$(b.getAttribute("data-popover-src")).popover("destroy")}),$(".alert .close").click(function(a){a.preventDefault(),a.target.parentNode.className+=" hide"}),$(document).bind("ajaxSend",function(a,b,c){"GET"===c.type&&"undefined"==typeof c.timeout&&(c.timeout=9e4)}),$(document).bind("ajaxError",function(a,b,c,d){if(""!==d){var e=["^settings$","^dashboard/payments$","^dashboard/invoices$","^dashboard/listings$","^dashboard/som/active_orders$","^dashboard/som/completed_orders$","^dashboard/som/searched_orders","^dashboard/som/searched_order_item?order_item_id="].map(function(a){return new RegExp(a)}),f=e.some(function(a){return c.url.match(a)});null!==f&&FK.alert.error("Something went wrong. Please try again later.",c.url)}}),$(function(){function a(a,b,c){$.ajax({type:"POST",data:$(c).serialize(),url:"/login",timeout:e,success:function(b){var c=b||{};if(1e3==c.code)if($.cookie("is_login","true",{path:"/"}),$.cookie("sellerId",c.data.sellerId,{path:"/"}),5===c.data.redirectState){var d=FK.searchToObject("referral_url").referral_url,e=/^(?:\/{1}(?:([^\/\\?#]+)))+(?:\/)?(?:\?([^#]*))?(?:#(.*))?$/;window.location.href=d&&e.test(d)?d+window.location.hash:c.data.isActivitiOnboardingEnabled&&"PENDING"===c.data.state?"selfSignup":"dashboard"}else window.location.href=4===c.data.redirectState?c.data.isActivitiOnboardingEnabled?"selfSignup":"dashboard#settings":c.data.isActivitiOnboardingEnabled?"selfSignup":"seller_registration";else 500==c.code?($(".login-err").html("Something went wrong, please try again.").show(),$(a).val("")):($(".login-err").html(c.message).show(),$(a).val(""))},error:function(){return $(".login-err").html("Something went wrong, please try again.").show(),$("#password").val(""),!1}})}function b(){var b=$("#password").val();return a("#password",b,"#loginForm"),!1}function c(){var b=$("#password").val();return a("#password",b,"#slp_login_form"),!1}function d(){var b=$("#password-small").val();return a("#password-small",b,"#loginForm-small"),!1}var e=2e3,f=location.search;$(".start-selling-btn").each(function(){$(this).attr("href",$(this).attr("href")+f)}),$(".slp_seller_form").each(function(){$(this).validate({rules:{email:{required:!0,email:!0},phone:{required:!0,phoneNumber:!0}}})}),$(".slp_seller_form").on("submit",function(a){if(a.preventDefault(),$(this).valid()){for(var b=$(this).serializeArray(),c=0;c<b.length;c++)sessionStorage.setItem(b[c].name,b[c].value);location.href="/selfSignup/create"+f}}),$.validator.addMethod("phoneNumber",function(a){return/^[1-9][0-9]{9}$/.test(a)},"Please enter a valid phone number"),$.ajax("/sellerRegistrationConfigs",{success:function(a){var b=jQuery.parseJSON(a).data;e=b.configs.ajaxCallTimeOut}}),$.ajax("/accessControl",{timeout:e,success:function(a){var b=jQuery.parseJSON(a).data,c=b.invitationOnly;c?$("#sellerInvitationText").show():($("#startSellingButton").show(),$("#signUpLink").show(),$("#division").show())}}),$("#loginInModalLink").click(function(){$("#loginError").hide(),$("#password").val(""),$("#username").val("")}),$("#loginForm-small").validate({rules:{username:{required:!0,allowedCharacters:!0},password:{required:!0}},messages:{username:{required:""},password:{required:""}},submitHandler:d}),$("#loginForm").validate({rules:{username:{required:!0,allowedCharacters:!0},password:{required:!0}},messages:{username:{required:""},password:{required:""}},submitHandler:b,errorPlacement:function(a){a.appendTo($("#errorContainer"))}}),$("#slp_login_form").validate({rules:{username:{required:!0,allowedCharacters:!0},password:{required:!0}},messages:{username:{required:""},password:{required:""}},submitHandler:c,errorPlacement:function(a){a.appendTo($("#errorContainer"))}}),$("#forgotPasswordForm").validate({rules:{forgotPasswordEmail:{email:!0,required:!0}},messages:{forgotPasswordEmail:{email:"Please enter a valid email address"}},submitHandler:function(a){return $.ajax({type:"POST",data:$(a).serialize(),url:"/forgot",timeout:e,success:function(){$("#forgotPasswordError").hide(),$("#forgotPasswordSuccess").html("An email is sent to "+$("#emailId").val()+". Please check your email.").show()},error:function(a){a=jQuery.parseJSON(a.responseText),1008===a.code?($("#forgotPasswordSuccess").hide(),$("#forgotPasswordError").html("Account does not exist").show()):($("#forgotPasswordSuccess").hide(),$("#forgotPasswordError").html("Something went wrong. Please try again").show())}}),!1}})}),$(function(){$("#forgotPasswordLink").click(function(){$("#forgotPasswordError").hide(),$("#forgotPasswordSuccess").hide(),$("#forgotPasswordForm")[0].reset()}),$("#forgotPasswordForm").validate({rules:{forgotPasswordEmail:{email:!0,required:!0}},messages:{forgotPasswordEmail:{email:"Please enter a valid email address"}},submitHandler:function(a){return $("#forgotPasswordButton").data("type","button"),$("#forgotPasswordButton").html('<img src="images/btn-primary-loader.gif">'),$.ajax({type:"POST",data:$(a).serialize(),url:"/forgot",success:function(){$("#forgotPasswordButton").data("type","submit"),$("#forgotPasswordButton").html("Send Email"),$("#forgotPasswordError").hide(),$("#forgotPasswordSuccess").html("The link to create a new password has been sent to your email address at "+$("#emailId").val()+". Please check your inbox").show()},error:function(a){$("#forgotPasswordButton").data("type","submit"),$("#forgotPasswordButton").html("Send Email"),a=jQuery.parseJSON(a.responseText),1008===a.code?($("#forgotPasswordSuccess").hide(),$("#forgotPasswordError").html("Account does not exist").show()):($("#forgotPasswordSuccess").hide(),$("#forgotPasswordError").html("Something went wrong. Please try again").show())}}),!1}})});