window.FormValidation||(window.FormValidation={});window.FormValidation.Application=function(){"use strict";function t(){this.submit=!1;this.valid=!0}String.prototype.toBool=function(){return!/^(false|0)$/i.test(this)};var i=function(i,r){var y=!1,e=i,l=null,ft=null,k=null,ht=null,ct=null,vt=null,u={form:new t,segs:[],activeSeg:0,id:"modForm_"+r,customRules:{},disabledSegs:0},et={data:[]},s=null,o=void 0,ot=void 0,d=void 0,w=!0,b={},h=void 0,a=[],g=0,nt=0,tt=!1,st=!1,it={},yt=function(){for(var t,r=FormValidation.Manifest.Externals.manifest,i=0;i<r.length;i+=1)t=r[i],"undefined"==typeof FormValidation.Manifest[t.className]&&n.handle(n.fact.loadRuleExtensionFile+": "+t.className),n.safe(f.extensions.registerRule,[t.className],{msg:"ruleExtension",param:t.filename});f.set();f._dom();wt()},f={inline:void 0,summary:void 0,instantFeedback:void 0,serverErrorMessage:void 0,extensions:{registerRule:function(n){var i=new window.FormValidation.Manifest[n],t;for(t in i)"function"==typeof i[t]&&(rt.rules[t]=i[t])}},set:function(){f.inline=e.attr("data-inline-errors");f.summary=e.attr("data-error-summary").toBool();f.instantFeedback=e.attr("data-instant-feedback").toBool();f.serverErrorMessage=e.attr("data-server-error-message");f.disableSubmit=e.attr("data-disable-submit");l=e.find(".form-section");ft=l.find(".form-field");k=l.find('[data-type="multiline"] textarea, [data-type="select"] select, [data-type="selectGroup"] select, [data-type="hidden"] input, [data-type="number"] input, [data-type="text"] input, [data-type="email"] input, [data-type="radio"] input, [data-type="checkbox"] input, [data-type="multi"] input, [data-type="password"] input');ct=e.find("[data-custom-regex]");vt=e.find(".error-summary");for(var n=0;n<l.length;n+=1)u.segs.push(new t);b={};b.full=new Function;e.attr("data-id",u.id);i.find(".form-section").each(function(n){var t="batch_"+(n+1);$(this).attr("data-id",t);b[t]=new Function})},_status:{get:function(n,t){return u.segs[n][t]},set:function(n,t,i){if("undefined"!=typeof i)return void(u.segs[i][n]=t);for(var r in u.segs)u.segs[r][n]=t},setSubmitted:function(n,t){this.set("submit",n,t)},setValidity:function(n,t){this.set("valid",n,t)}},_dom:function(){ct.each(function(n){var t=$(this),r=new RegExp(t.data("custom-regex")),i=(n+1+(new Date).getTime()).toString().split("").sort(function(){return.5-Math.random()}).join("");u.customRules[i]=r;t.data("custom-regex",i)});l.each(function(){$(this).attr("data-section-id",arguments[0])})}},pt={complexObject:function(n){function r(n,t){for(var i in t)try{n[i]=t[i].constructor==Object?r(n[i],t[i]):t[i]}catch(u){n[i]=t[i]}return n}function u(n,t){for(var r={},u=r,i=0;i<n.length;i+=1)r[n[i]]=i===n.length-1?t:{},r=r[n[i]];return u}var i={},t;for(t in n)-1!==t.indexOf(".")?i=r(i,u(t.split("."),n[t])):i[t]=n[t];return i}},wt=function(){function h(){i=!0;setTimeout(function(){i=!1},100)}function c(n){i||(ht=n,o="blur",u.disabledSegs=0,v.formSection(n.closest(".form-section")))}function r(n){o="partial";h();f._status.setSubmitted(!0,n.data("section-id"));u.disabledSegs=0;v.formSection(n)}function s(){o="full";g=0;u.disabledSegs=l.filter(".disabled").length;f._status.setSubmitted(!0);v._formValid()}var n,i=!1,t=!1;k.on({change:function(){c($(this))},focus:function(){u.activeSeg=$(this).closest(".form-section").data("section-id");n=$(this)},blur:function(){n=void 0}});e.find(".partial-submit").on({click:function(n){return n.preventDefault(),t?void(t=!1):void r($(this).closest(".form-section"))},mousedown:function(i){i.preventDefault();t=!0;"undefined"!=typeof n&&n.blur();r($(this).closest(".form-section"))}});e.find(".full-submit").on({click:function(n){return n.preventDefault(),t?void(t=!1):void s()},mousedown:function(i){i.preventDefault();t=!0;"undefined"!=typeof n&&n.blur();s()},focus:function(){u.activeSeg="complete"}});e.find(".form-clear").click(function(n){n.preventDefault();at()});e.keydown(function(t){var i=$(t.target);(i.is('a[href="#"]')||"undefined"!=typeof n&&!n.is("textarea"))&&(13!==t.which||i.hasClass("form-clear")||i.closest(".actions").length||(t.preventDefault(),i.closest(".form-section").find(".full-submit, .partial-submit").click()))})},v={_formValid:function(){e.find(".form-section").each(function(){v.formSection($(this))})},formSection:function(n){var t;h=n||h;h.hasClass("disabled")?lt(h):(t=h.data(),nt=0,a=[],s=null,ot=t.batchValidation,d=t.sectionId,h.find(".form-field").each(function(){v._formField($(this),t,!1,h.find(".form-field").length)}),null===s&&(v.endPointer(),g+=1))},_formField:function(n,t,i,r){c._run(n,n.parents(".form-section"),r,t)},endPointer:function(){w?p._finalFormCheck(h):p._finalActions()}},c={_run:function(n,t,i,r){var e=nt===i-1,u=n.find("input, select, textarea").is(":disabled");if(u||(c._rules(n),c._clientResultHandler(et.data,n),et={data:[]}),nt+=1,!u){if("partial"===o&&t.data("partial-server-stepover")===!0||a.length>0||"blur"===o)return void(s=null);if(e&&null!==s&&t.data("batch-validation")===!0)return c._serverValidate(r.endpoint,s,t),nt=0,void(f.summary&&p._summaryErrorMessageHandler())}},_rules:function(t){var r,u,o="undefined"==typeof t.data("required")?!0:t.data("required"),f=("object"==typeof t.data("validation")?JSON.stringify(t.data("validation")):t.data("validation"))||"",e=t.data("type"),h=t.find(".field"),i;if("undefined"!=typeof e)if(r=n.safe(rt.dataValue[e],[h],{msg:"dataType",param:e}),(rt.rules.required(r)||o)&&""!=f)for(u=f.split("|"),i=0;i<u.length;i+=1)"server"!==u[i]?et.data.push(n.safe(c._clientValidate,[u[i],r,t],{msg:"ruleConfig",param:u[i]})):(null===s&&(s={}),s[t.attr("data-field-id")]=r);else-1!==f.indexOf("server")&&(null===s&&(s={}),s[t.attr("data-field-id")]=r)},_clientValidate:function(n,t,i){var f,r={},u=i.data();return"{"===n.charAt(0)&&(r=$.parseJSON(n),n=r.rule,r=r.val),u.customRegex&&"regex"===n&&(r=u.customRegex),!u["for"]||"confirm"!==n&&"confirmStrict"!==n&&"different"!==n&&"differentStrict"!==n||(r.target=h.find("#"+u["for"]).val()),f=rt.rules[n](t,r,i),{state:f,rule:n}},_serverValidate:function(t,i,r){var e,u=r.attr("data-batch-name");return"undefined"==typeof u?(y&&n.log(n.fact.Batchname),void c._serverResultHandler({Errors:[]},r)):(i=pt.complexObject(i),e="undefined"!=typeof FormValidation.Manifest.OutBound&&"undefined"!=typeof FormValidation.Manifest.OutBound[u]?FormValidation.Manifest.OutBound[u](i):i,""===t||"undefined"==typeof t?(y&&n.log(n.fact.Endpoint),void c._serverResultHandler({Errors:[]},r)):void(tt||(tt=!0,r.addClass("pending"),$.ajax({url:t,data:JSON.stringify(e),cache:!1,type:"POST",contentType:"application/json"}).done(function(n){var t;tt=!1;it=n;y&&window.console&&console.log("server response:",it);r.removeClass("pending");"undefined"!=typeof FormValidation.Manifest.InBound&&(t="undefined"!=typeof FormValidation.Manifest.InBound[u]?FormValidation.Manifest.InBound[u](n):n,c._serverResultHandler(t,r),s=null)}).fail(function(){tt=!1;r.removeClass("pending");"undefined"==typeof f.serverErrorMessage?n.handle(n.fact.Server):c._serverResultHandler({Errors:[f.serverErrorMessage]},r)}))))},_clientResultHandler:function(n,t){var r=!0,i=0;if(0===n.length)return void p._clientErrorMessageHandler(t,!0);this.resultRulesEngine();do 0==n[i].state&&(a.push(n[i].rule),r=!1),p._clientErrorMessageHandler(t,n[i].state,n[i].rule),i+=1;while(i<n.length&&r===!0)},_serverResultHandler:function(n,t){var i=t.find(".form-section-errors"),r;if(this.resultRulesEngine(),i.empty(),n.Errors.length>0){for(r=0;r<n.Errors.length;r+=1)p._serverErrorMessageHandler(n.Errors[r],i),a.push("server");w&&i.addClass("errors")}else w&&i.removeClass("errors");v.endPointer()},resultRulesEngine:function(){ot&&"blur"===o&&!u.segs[d].submit?(y&&ut("action result factors:","batch, blur, not submitted"),w=!1):(y&&!ot&&"blur"===o&&u.segs[d].submit&&ut("action result factors:","not batch && isBlur, has submitted"),w=!0)},setSubmit:function(n){("true"===f.disableSubmit||"requiredonly"===f.disableSubmit)&&(n?e.find(".full-submit, .partial-submit").removeAttr("disabled"):f.instantFeedback!==!0&&"full"!==o||st||e.find(".full-submit, .partial-submit").attr("disabled",!0))}},p={_clientErrorMessageHandler:function(n,t,i){(w||f.instantFeedback===!0&&"blur"===o&&ht.closest(".form-field")[0]===n[0])&&(n.removeClass("error valid"),"true"===f.inline&&(n.find(".err-msgs").children("div").hide(),t?n.addClass("valid"):(n.addClass("error"),"undefined"!=typeof i&&n.find(".err-msgs").children('div[data-validation="'+i+'"]').show())),"requiredonly"!==f.disableSubmit||n.data("required")||(st=!0))},_serverErrorMessageHandler:function(n,t){w&&t.append("<div>"+n+"<\/div>")},_summaryErrorMessageHandler:function(){},_finalFormCheck:function(n){var i=0===a.length,t;for(f._status.setValidity(i,n.data("section-id")),n.toggleClass("errors",!i),u.form.valid=!0,t=0;t<u.segs.length;t+=1)if(u.segs[t].valid===!1){u.form.valid=!1;break}e.toggleClass("errors",!u.form.valid);this._finalActions()},_finalActions:function(){var r=l.find(".form-section"),t=0===a.length,n="full"===o,i=g===l.length-1-u.disabledSegs;return r.length&&(i=g===r.parents(".form-section").length-1-u.disabledSegs),c.setSubmit(t),st=!1,t||"blur"===o||e.find('input[type="password"], [data-sensitive="true"] input').val(void 0),y&&ut("section: "+(h.data("section-id")+1)+", submit: ",o+", fails: "+a.length),n&&t&&i&&(a=[],y&&ut("form passed")),(!n||n&&i)&&(a=[]),n||"blur"===o?void(n&&i&&b.full(u.form.valid,e,it)):void b["batch_"+(d+1)](t,h,it)}},lt=function(n){f._status.setValidity(!0,n.data("section-id"));n.removeClass("errors");p._clientErrorMessageHandler(n.find(".form-field.error"),!0)},at=function(){f._status.setSubmitted(!1);ft.removeClass("error");l.removeClass("errors valid");e.removeClass("errors");p._clientErrorMessageHandler(ft,!0);k.val(void 0);k.filter("select").each(function(){var n=!1;$(this).find("option").each(function(){if(this.defaultSelected)return(this.selected=!0,n=!0,!1)});n||($(this)[0].options[0].selected=!0);$(this).change()})},rt={dataValue:{hidden:function(n){return n.find("input").val()},number:function(n){return n.find("input").val()},text:function(n){return n.find("input").val()},multiline:function(n){return n.find("textarea").val()},email:function(n){return n.find("input").val()},radio:function(n){return n.find('input[type="radio"]:checked').index('input[type="radio"]')+1},select:function(n){return n.find("select").children("option:selected").data("value")},selectGroup:function(n){return n.find("select").find("option:selected").parent().data("group-id")},checkbox:function(n){return n.find('input[type="checkbox"]:checked').length},multi:function(n){var t="";return n.find("input").each(function(){t+=$(this).val()}),t}},dataValueFriendly:{number:function(n){return n.find("input").val()},text:function(n){return n.find("input").val()},multiline:function(n){return n.find("textarea").val()},email:function(n){return n.find("input").val()},radio:function(n){return n.find('input[type="radio"]:checked').length>0||""},select:function(n){return n.find("select").children("option:selected").text()},selectGroup:function(n){return n.find("select").find("option:selected").val()},checkbox:function(n){return n.find('input[type="checkbox"]:checked').length>0||""},multi:function(n){var t="";return n.find("input").each(function(){t+=$(this).val()}),t}},rules:{number:function(n){return"string"==typeof n&&-1!=n.indexOf(",")&&(n=n.replace(",",".")),!isNaN(parseFloat(n))&&isFinite(n)},minLength:function(n,t){return n.length>=t},maxLength:function(n,t){return n.length<=t},min:function(n,t){return n>=t},max:function(n,t){return t>=n},required:function(n){return""!=n&&-1!=n&&null!=n},alpha:function(n){return/^[a-zA-Z\s]+$/.test(n)},range:function(n,t){return n>=t.min&&n<=t.max},email:function(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)},match:function(n,t){return n==t},checked:function(n){return n>0},unchecked:function(n){return 0===n},confirm:function(n,t){return n.toLowerCase()==t.target.toLowerCase()},confirmStrict:function(n,t){return n==t.target},different:function(n,t){return n.toLowerCase()!=t.target.toLowerCase()},differentStrict:function(n,t){return n!=t.target},regex:function(n,t){return u.customRules[t].test(n)}}},ut=function(){var n=[],t;for(t in arguments)n.push(arguments[t]);window.console&&console.log(n.join(""))};yt();this.id=u.id;this.api={events:b,validateBatch:function(n){return o="partial",v.formSection(n)},validateForm:function(){return o="submit",v._formValid()},clearForm:at,clearSeg:lt,debug:function(n){"boolean"==typeof n&&(y=n)}}},r=function(){var n={};$(".mod-form").each(function(t){var r=new i($(this),t+=1);n[r.id]=r.api});window.FormValidation.Application.prototype.api=n},n={fact:{bootDependency:"FormValidation requires boot.js version 3.0.0 +",dataType:"data type does not exist for field",ruleConfig:"Validation rule configuration contains errors for field",Server:"Service error",Endpoint:"Invalid endpoint",Batchname:"Invalid batch-name",ruleExtension:"Invalid rule extension configuration in ",loadRuleExtensionFile:"FormValidation requires to load rules extension file",outBound:"OutBound Object Literal has property missing for batch name",inBound:"InBound Object Literal has property missing for batch name"},safe:function(n,t,i){try{return n.apply(this,t)}catch(r){this.handle(this.fact[i.msg]+": '"+(i.param||"")+"'")}},log:function(n){window.console&&console.info(n)},handle:function(n){throw new Error(n);}};this.init=function(){var t;return window.boot||window.toolkit.boot?(t=window.boot||window.toolkit.boot,t.config.FormValidation=FormValidation.Manifest.ExtensionPath,window.FormValidation.Manifest.OutBound===!0&&t.loadScript("extensions-outbound.js","FormValidation"),window.FormValidation.Manifest.InBound===!0&&t.loadScript("extensions-inbound.js","FormValidation"),void r(this)):void n.handle(n.fact.bootDependency)}};window.FormValidation.Manifest=function(n){function t(){this.manifest=[];this.register=function(n,t){this.manifest.push({className:n,filename:t})}}return window.formValidation=window.formValidation||new window.FormValidation.Application,n.init=window.formValidation.init,{Externals:new t,ExtensionPath:"",OutBound:!1,InBound:!1}}(window.FormValidation);window.formModPlaceholders=window.formModPlaceholders||new function(n){var i=this,r=n('input[type="url"], input[type="text"], input[type="tel"], input[type="email"], input[type="password"], textarea'),t={setSpans:function(t,i){var r=t.parent('[class^="stylish-"]').length?t.parent():t;r.wrap('<span class="placeholder-wrapper"><\/span>');n('<span class="placeholder">'+i+"<\/span>").insertAfter(r).on("click",function(){n(this).closest(".placeholder-wrapper").find("input, textarea").trigger("focus")})},checkValue:function(n){var t=n.parents(".placeholder-wrapper").find(".placeholder");""===n.val()?t.show():t.hide()},inputCheck:function(r){var u=r.type;if(i.hideOnFocus===!1){if("focus"===u)return}else if("focus"===u&&n(this).parents(".placeholder-wrapper").find(".placeholder").hide(),/input|keyup|focus/i.test(u))return;t.checkValue(n(this))},run:function(){var i=n(this),r=i.data("placeholder-text");"undefined"==typeof r&&(r=i.attr("placeholder")||"",i.data("placeholder-text",r));""!==r&&(i.attr("placeholder",""),t.setSpans(i,r),i.on("blur focus input keyup",t.inputCheck),t.checkValue(i))}};i.hideOnFocus=!0;this.apply=function(n){n=n||r;n.each(t.run)}}(jQuery);!function(n){window.stylishForms||(window.stylishForms={});window.stylishForms=new function(){var t,i=!1,r=function(r){var o=function(){r.find('input[type="text"], input[type="number"], input[type="password"], input[type="email"], input[type="tel"], textarea').each(function(){n(this).attr("tabindex",0).wrap('<div class="stylish-'+this.type+'" data-type="'+this.type+'" tabindex="-1" />').before("<span><\/span>");u.setFocusClass(n(this));u.disableField(n(this))});r.find("input.date").each(function(){n(this).parent().addClass("multidate").children("span").addClass("date");u.setFocusClass(n(this))})},s=function(){r.find("select").each(function(){var t=n(this);t.wrap('<div class="stylish-select" data-type="'+this.type+'" tabindex="-1" />').after('<span class="selected"><span class="text">'+t.find("option:selected").text()+'<\/span><span class="ico"><\/span><\/span><div class="dropdown-list" role="listbox"><div><\/div><\/div>');f(t);u.setFocusClass(t);u.disableField(t)})},f=function(t){var u,r=0,i="";return t.children().each(function(){n(this).is("optgroup")?(i+='<div class="dropdown-option group">',i+="<span>"+n(this).attr("label")+"<\/span>",i+="<ul>",n(this).children().each(function(){n(this).data("index",r);i+='<li class="dropdown-option" role="option" data-index="'+r+'" '+(n(this).is(":disabled")?'class="disabled"':"")+(n(this).is(":selected")?" option-selected":"")+">"+n(this).text()+"<\/li>";r+=1}),i+="<\/ul>",i+="<\/div>"):(n(this).data("index",r),i+='<div class="dropdown-option'+(n(this).is(":disabled")?" disabled":"")+(n(this).is(":selected")?" option-selected":"")+'" role="option" data-index="'+r+'">'+n(this).text()+"<\/div>",r+=1)}),u=t.closest(".stylish-select").find(".dropdown-list > div"),u.append(i),u.find(".dropdown-option").add(u.find(".dropdown-option")).not(".disabled, .group").attr("tabindex",0),i},h=function(){r.find('.dropdown-list[data-stylish-group="checkbox-dropdown"]').each(function(){n(this).wrap('<div class="stylish-select checkbox-dropdown" data-type="'+this.type+'" tabindex="-1" />').before('<span class="selected"><\/span>');e(n(this));u.setFocusClass(n(this))})},e=function(n){n.siblings(".selected").html('<span class="text">'+n.data("default-option-text")+'<\/span><span class="ico"><\/span>');n.find(".dropdown-option").attr("tabindex",0)},c=function(){r.find('input[type="checkbox"], input[type="radio"]').each(function(){u.dualStatesHelper(n(this),n(this).attr("type"));u.setFocusClass(n(this))})},l=function(){r.find('[data-type="range"]').each(function(){var i=n(this),t=i.data(),s=t.updateValue,e=t.inputfor,r=i.parent().find('[data-input-from="'+e+'"]'),f=i.parent().find('[data-input-to="'+e+'"]'),o=[r.val(),f.val()].filter(function(n){return void 0!==n});i.slider({range:o.length>1,values:o,step:t.precision,min:t.min,max:t.max,slide:function(n,t){var i=t.values[0],u=t.values[1];s&&(r&&r.val(i),f&&f.val(u))},start:u.hideDropdowns})})},u={checkboxDdSelected:function(t){var u=t.find('input[type="checkbox"]:checked, input[type="radio"]:checked'),i=t.find(".selected > span.text"),f=[],r="";0===u.length?i.html(t.find(".dropdown-list").data("default-option-text")):(u.each(function(){f.push(n('label[for="'+n(this).attr("id")+'"]').text())}),r=f.join(", "),i.html(r),i.attr("title",r))},setDropdownHeight:function(t){var i=t.offset(),e=t.closest(".stylish-select").offset().top-r,r=n(window).scrollTop(),o=i.top+t.outerHeight(),u=n(window).height()+r,f=i.top-r,s=u-i.top;o>u?f>s?(t.css("max-height",.8*f),t.addClass("show-above")):(t.css("max-height",.8*(u-i.top)),t.removeClass("show-above")):f>e&&(t.removeClass("show-above"),t.css("max-height",""))},hideDropdowns:function(t){0===n(t.target).closest(".stylish-select").length&&n("[data-stylish-form]").find(".stylish-select").removeClass("active").find(".dropdown-list").hide().css("max-height","").removeClass("show-above")},setFocusClass:function(n){n.on({focus:function(){n.parent().addClass("focus")},blur:function(){n.parent().removeClass("focus")}})},returnDefaultSelected:function(n){var t=n.find("option").filter(function(){return this.defaultSelected}),i=n.closest(".stylish-select").find(".dropdown-list .dropdown-option");return 0===t.length?(i.eq(0).addClass("option-selected"),i.eq(0)):(i.eq(t.index()).addClass("option-selected"),t)},returnDefaultChecked:function(n){var t=n.closest(".stylish-form").find('input:radio[name="'+n.attr("name")+'"]').filter(function(){return this.defaultChecked});t.prop("checked",!0).siblings("span").addClass("checked")},disableField:function(n){n.parent().toggleClass("disabled",n.is(":disabled"))},checkField:function(t){"radio"===t.attr("type")&&(t.closest(".stylish-form").find("input:radio").not(":checked").each(function(){n(this).attr("name")===t.attr("name")&&n(this).siblings("span").removeClass("checked")}),n('input:radio[name="'+t.attr("name")+'"]:checked').val()||u.returnDefaultChecked(t));t.siblings("span").toggleClass("checked",t.is(":checked"))},dualStatesHelper:function(n,t){n.wrap('<div class="stylish-ds" data-type="'+t+'" />').css({opacity:0,position:"absolute"}).before('<span class="'+(n.is(":checked")?"checked":"")+'"><span class="ico"><\/span><\/span>')},updateCheckboxSelected:function(n){n.closest(".stylish-select.checkbox-dropdown").length&&(u.checkboxDdSelected(n.closest(".stylish-select.checkbox-dropdown")),n.closest("li").toggleClass("checked"))}},a=function(){var e,t="",f=!1;r.on("change",'.stylish-ds input[type="checkbox"]',function(){n(this).siblings("span").toggleClass("checked");u.updateCheckboxSelected(n(this))});r.on("change",".stylish-ds input[type=radio]",function(){r.find('input[type="radio"][name="'+n(this).attr("name")+'"]').each(function(){n(this).siblings("span").removeClass("checked")});n(this).siblings("span").addClass("checked")});r.on("click",".stylish-select > .selected",function(t){var e=n(this),f=e.closest(".stylish-select"),i=f.find(".dropdown-list"),o=e.siblings("select");"undefined"!=typeof toolkit&&toolkit.client.Mobile&&r.data("stylish-native")||(t.stopPropagation(),o.is(":disabled")||(n(".stylish-select .dropdown-list").not(i).hide().closest(".stylish-select").removeClass("active"),i.toggle(),i.is(":visible")?(f.addClass("active"),u.setDropdownHeight(i)):(f.removeClass("active"),f.find(".dropdown-list").removeClass("show-above")),0===i.find(".option-selected").length&&u.returnDefaultSelected(o)))});r.on("mouseover",".stylish-select:not(.checkbox-dropdown) .dropdown-option",function(){n(this).not(".disabled").addClass("option-selected").siblings(".option-selected").removeClass("option-selected")});r.on("click",".stylish-select:not(.checkbox-dropdown) .dropdown-option",function(t){var i=n(this);t.stopPropagation();i.is(":not(.group, .disabled)")&&(i.closest(".stylish-select").find(".dropdown-list").hide(),i.closest(".stylish-select").find("select").prop("selectedIndex",i.data("index")).change(),i.closest(".stylish-select").removeClass("active"))});r.on("change",".stylish-select select",function(){var t=n(this),i=t.find("option:selected"),r=t.closest(".stylish-select").find(".dropdown-list");t.parent().find("span.selected > span.text").html(i.text());r.find(".dropdown-option[data-index]").removeClass("option-selected").eq(t.prop("selectedIndex")).addClass("option-selected")});r.on("keypress, keyup, keydown",".stylish-select select",function(t){var i=n(this),r=i.closest(".stylish-select"),f=r.find(".dropdown-list");switch(t.which){case 13:case 32:t.preventDefault();t.stopPropagation();r.hasClass("active")?u.hideDropdowns(i):(r.addClass("active"),f.show(),u.setDropdownHeight(f));i.blur();r.focus();i.trigger("change");break;case 27:case 9:i.trigger("change");u.hideDropdowns(i);break;case 38:case 40:i.trigger("change")}});r.on("keypress, keyup, keydown",".stylish-select.active",function(i){function l(){if(t===n(this).text().trim().substring(0,t.length).toLowerCase())return(r.removeClass("option-selected"),n(this).addClass("option-selected"),a=!0,!1)}var c=n(this),s=c.find("select"),h=c.find(".dropdown-list"),o=h.find(".dropdown-option:not(.disabled)"),r=o.filter(".option-selected"),a=!1;switch(i.which){case 13:case 32:case 27:case 9:i.preventDefault();s.find("option").eq(r.data("index")).prop("selected",!0);s.focus();c.blur().removeClass("active");s.trigger("change");u.hideDropdowns(s);break;case 38:i.preventDefault();r.length?r.index()&&(r.removeClass("option-selected").prevAll(".dropdown-option:not(.disabled)").first().addClass("option-selected"),h.scrollTop(o.filter(".option-selected").position().top)):o.last().addClass("option-selected");break;case 40:i.preventDefault();r.length?r.index()+1<o.length&&(r.removeClass("option-selected").nextAll(".dropdown-option:not(.disabled)").first().addClass("option-selected"),h.scrollTop(o.filter(".option-selected").position().top)):o.first().addClass("option-selected");break;default:(i.which>=48&&i.which<=57||i.which>=65&&i.which<=90)&&r.length&&(f?(clearTimeout(e),t+=String.fromCharCode(i.which).toLowerCase()):t=String.fromCharCode(i.which).toLowerCase(),f=!0,e=setTimeout(function(){f=!1},1e3),o.slice(r.index()+1).each(l),a||o.slice(0,r.index()).each(l),h.scrollTop(o.filter(".option-selected").position().top))}});i===!1&&(n(document).on("click touchend",u.hideDropdowns),i=!0)};t=function(t){t.is("select")?(t.closest(".stylish-select").find(".dropdown-list").html(f(t)),t.siblings(".selected").find(".text").text(u.returnDefaultSelected(t).text()),u.disableField(t)):t.is(".checkbox-dropdown")?(e(t),u.disableField(t),t.find(".dropdown-option").each(function(){if(0===n(this).children(".stylish-ds").length){var t=n(this).find('input[type="checkbox"], input[type="radio"]');u.dualStatesHelper(t,t.attr("type"));u.updateCheckboxSelected(t)}})):("checkbox"===t.attr("type")||"radio"===t.attr("type"))&&(u.checkField(t),u.disableField(t),u.updateCheckboxSelected(t))};r.off();void function(){r.addClass("stylish-form").attr("data-stylish-form","set");o();s();c();h();jQuery.ui&&l();a()}()};this.apply=function(){n('[data-stylish-form="true"]').each(function(){r(n(this))})};this.update=function(){this.apply()};this.refresh=function(n){t(n)}}}(jQuery),function(n){function i(){function r(){function o(n){switch(n){case"next":r+=1;break;case"prev":r-=1;break;default:r=n}}function s(){i.removeClass("active").eq(r).addClass("active")}function h(){n(this).children("span").removeClass("active").eq(r).addClass("active")}function c(){n(this).find(".pagination").children("span").first().addClass("active")}var f=i.find(".pagination"),e=i.length,r=0,u;for(i.first().addClass("active"),u=0;u<e;u+=1)f.append("<span />");i.each(c);t.find(".form-slide-controls").children("button").on("click",function(){if(t.find(".errors").length){t.closest("#header-links").length&&argus.cache.$body.stop().animate({scrollTop:0});return}o(n(this).data("direction"));s();f.each(h)})}var t=n(this),i=t.find(".slide");t.prev(".form-toggle").add(t.find("button.close")).on("click",function(){argus.helpers.resetActiveHeaderStates();argus.cache.$body.toggleClass("step-form-open");t.toggleClass("active").find(".form").stop().slideToggle(250,function(){n(this).css({height:""});argus.cache.$window.width()>argus.config.breakpoints.TABLET_LANDSCAPE&&(t.hasClass("active")?(argus.cache.$body.removeClass("nav-open"),argus.cache.$siteOverlay.addClass("active")):argus.cache.$siteOverlay.removeClass("active"))})});r()}function r(){var t=n(this).find(".mod-form");t.find(".full-submit").length&&(formValidation.api[t.data("id")].events.full=function(n,t,i){function s(){e.hide().closest(".captcha-container").removeClass("error")}function h(){r=Handlebars.compile(t.closest(".form").find(".response-template").html());t.children(".form-response").html(r(i)).removeClass("hidden");t.find(".form-field").not(".hidden-field").find("input, textarea").val("");toolkit.client.IE&&f.length&&f.show();typeof grecaptcha!="undefined"&&grecaptcha.reset(t.find(".g-recaptcha").attr("id"));o||t.children(".form-section").hide()}var u=t.find(".download-resource"),f=t.find(".placeholder"),e=t.find(".captcha-message"),o=t.parent().hasClass("comment-form"),r;if(s(),!n&&i.CaptchaValidationFailed===!0){e.show().closest(".captcha-container").addClass("error");return}s();n&&i.Success===!0||i.Success===!0&&i.CaptchaValidationFailed===!1?(h(),argus.helpers.responseIsDefined(i.Comment)&&o&&(r=Handlebars.compile(t.closest(".blog-comment-form").find(".comment-template").html()),t.find(".message").before(r(i))),u.length&&argus.helpers.responseIsDefined(i.DownloadableResource)&&u[0].click()):(n&&i.Success===!1&&i.CaptchaValidationFailed===!1||n&&i.Success===!0&&i.CaptchaValidationFailed===!0)&&h()})}function u(){var t=argus.cache.$body.find(".form"),i=t.find(".g-recaptcha");argus.boot.loadScript("//www.google.com/recaptcha/api.js?render=explicit","cdn",function(){function r(){t.find(".full-submit").removeAttr("disabled");t.find(".captcha-message").hide().closest(".captcha-container").removeClass("error")}setTimeout(function(){i.each(function(t,i){var u=n(this);u.attr("id",t);grecaptcha.render(i.id,{sitekey:u.data("sitekey"),callback:r})})},800)})}function f(){function f(f){var o=r.find(".state-placeholder"),l=o.siblings(".form-field"),a=f.find("select option:selected").data("value"),s=t.filter('[data-toggle-field-options="'+a+'"]'),h=s.prop("attributes"),v=o.siblings(i).length,y,c;if(s.find("select").children().first().attr("data-value",""),n.inArray(a,u)!==-1)if(e){y=s.detach();for(c in h)h.hasOwnProperty(c)&&o.attr(h[c].name,h[c].value).addClass("state-placeholder");t.removeClass("form-field");o.removeClass("hidden").addClass("form-field");o.empty().html(y.html());v&&l.removeClass("half-width")}else s.removeClass("hidden").addClass("form-field"),s.siblings(".dropdown-toggle").removeClass("form-field").addClass("hidden");else o.add(t).addClass("hidden").removeClass("form-field"),v&&l.addClass("half-width")}var r=n(this),t=r.find(".dropdown-toggle"),i=r.find('.form-field[data-field-id="'+t.attr("toggle-field")+'"]'),e=t.closest(".step-form").length,u=[];if(t.each(function(){var t=n(this).data("toggle-field-options");n.inArray(u,t)===-1&&u.push(t)}),i.length){i.on("change",function(){f(n(this))});i.each(function(){f(n(this))})}}var t;n(document).ready(function(){t=argus.cache.$body.find(".form");stylishForms.apply();FormValidation.Manifest.ExtensionPath="/Scripts/Forms/libs/mod-libs/form-validation/";FormValidation.Manifest.InBound=!0;FormValidation.Manifest.OutBound=!0;formValidation.init();toolkit.client.IE&&(formModPlaceholders.hideOnFocus=!1,formModPlaceholders.apply());t.closest(".step-form").each(i);t.each(r);t.each(argus.helpers.preventCrossScripting);t.each(f);t.find(".g-recaptcha").length&&u()})}(jQuery)