var AVL=AVL||{},XDate,EventRecorder;AVL.RESPONSIVEFORM=AVL.RESPONSIVEFORM||{};AVL.RESPONSIVEFORM.CORE={NewFormContent:!0,BypassPhoneCountryCode:typeof phoneOptional!="undefined"?phoneOptional:!1,UseSisyphus:typeof bypassLocalStorage=="undefined"||typeof bypassLocalStorage!="undefined"&&!bypassLocalStorage,INIT:{Init:function(){var n=$(".responsive-form");AVL.RESPONSIVEFORM.CORE.INIT.InitResponsiveForms(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAutoFillCatches(n)},InitAutoFillCatches:function(n){setTimeout(function(){AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n)},100)},InitResponsiveForms:function(n){n!=="#address-container"&&AVL.RESPONSIVEFORM.CORE.INIT.InitSisyphus(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormWarningContainers(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormMasks(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormStatusIcons(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormInstantValidation(n);AVL.RESPONSIVEFORM.CORE.INIT.InitUSPhoneInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAddressInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAddressModal();AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormButtons(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAlertBoxIcons();$(".txt-state").find(".textbox").attr("maxlength","30")},InitSisyphus:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&(n.is("fieldset")?n.sisyphus({excludeFields:$(".no-sisy, input[type='hidden'], .no-sisy input[type='radio'], .no-sisy input[type='checkbox']"),includeFields:$("input.has-sisy"),customKeySuffix:document.domain+window.location.pathname.replace(/\//g,"_")+"_"}):(n.find("fieldset").each(function(){$(this).sisyphus({excludeFields:$(".no-sisy, input[type='hidden'], .no-sisy input[type='radio'], .no-sisy input[type='checkbox']"),includeFields:$("input.has-sisy"),customKeySuffix:document.domain+window.location.pathname.replace(/\//g,"_")+"_"})}),AVL.RESPONSIVEFORM.CORE.UTILITIES.RemoveInputScriptTags(n)))},InitAddressInputs:function(n){var t=n.find(".dd-country .dropdown").length>0&&typeof n.find(".dd-country .dropdown option[selected='selected']").val()!="undefined"?n.find(".dd-country .dropdown option[selected='selected']").val().toLowerCase():"";AVL.RESPONSIVEFORM.CORE.UTILITIES.PrefixPhoneWithCountryCode(n,t,AVL.RESPONSIVEFORM.CORE.NewFormContent,AVL.RESPONSIVEFORM.CORE.BypassPhoneCountryCode);n.find(".dd-country .dropdown").on("change",function(){var n=$(".responsive-form .txt-phone input");n.length&&(n.val(n.val().replace(/["'()-]/g,"")),AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n));$("#update-action").text("country-updated")});n.find(".dd-opt-states .dropdown, .txt-opt-state .textbox").on("change",function(){$("#update-action").text("states-updated")});n.find(".txt-addressline1 .textbox").each(function(){var n=$(this).closest(".responsive-form");$(this).on("keydown",function(n){n.keyCode===$.ui.keyCode.TAB&&$(this).data("ui-autocomplete").menu.active&&n.preventDefault()}).autocomplete({position:{my:"left top",at:"left bottom-1",of:n.find(".txt-addressline1")},delay:0,source:function(t,i){var f=n.find(".txt-addressline1 .textbox"),r=$.trim(f.val()),e=n.find(".dd-country .dropdown").val(),u;r!==""&&r.length>1&&e==="US"&&(u={testing:!1,companyname:n.find(".txt-company .textbox").val(),addressline1:n.find(".txt-addressline1 .textbox").val(),addressline2:n.find(".txt-addressline2 .textbox").val(),city:n.find(".txt-city .textbox").val(),state:n.find(".dd-states .dropdown").val(),zipCode:n.find(".txt-zipcode .textbox").val(),country:n.find(".dd-country .dropdown").val()},$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationStreetLevel.ashx",type:"POST",data:JSON.stringify(u),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){var t=n.AddressKeyFormats;if(t.length>0){var r=[],u=[],f=[];AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(t);$.each(t,function(n){r.push(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PoliticalDivision2)+" "+t[n].PoliticalDivision1+" "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PostcodePrimaryLow))});$.each(r,function(n,i){$.inArray(i,u)===-1&&(u.push(i),f.push(t[n]))});i($.map(f,function(n){return{data:{addressline1:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1),city:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.PoliticalDivision2),state:n.PoliticalDivision1,zip:n.PostcodePrimaryLow},value:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1),label:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.PoliticalDivision2)+" "+n.PoliticalDivision1+" "+n.PostcodePrimaryLow}}))}}}))},minLength:2,select:function(t,i){var u,r;AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-addressline1"),n.find(".txt-addressline1 .textbox"),i.item.data.addressline1,!0);AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-zipcode"),n.find(".txt-zipcode .textbox"),i.item.data.zip,!0);AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-city"),n.find(".txt-city .textbox"),i.item.data.city,!0);AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(n.find(".txt-addressline1"),n.find(".txt-addressline1 .textbox"),!1,!1);n.find(".dd-states .dropdown").trigger("focus").val(i.item.data.state).trigger("blur").trigger("update");var f=n.find(".txt-addressline1 .textbox").val(),h=n.find(".txt-addressline2 .textbox").val(),e=n.find(".txt-city .textbox").val(),o=n.find(".dd-states .dropdown").val(),s=n.find(".txt-zipcode .textbox").val();f!==""&&e!==""&&o!==""&&s!==""&&(u="<address><addressline1>"+f+"<\/addressline1><addressline2>"+h+"<\/addressline2><city>"+e+"<\/city><state>"+o+"<\/state><zip>"+s+"<\/zip><\/address>",r=!1,$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:u,success:function(t){var u=$.parseXML(t),f=$(u),i=f.find("ismissingaptnumber");i!=null&&i!==""?(r=i.text().toLowerCase()==="true",r?(n.find(".txt-addressline2").attr("title","Please enter your Apt, Suite, Bldg. (required)."),n.find(".txt-addressline2 .textbox").trigger("focus"),n.find(".txt-addressline2 label em").text("(required)"),n.find(".txt-addressline2 input[type='text']").attr("data-validation","req-field")):(n.find(".txt-addressline2").attr("title","Please enter your Apt, Suite, Bldg. (if applicable)."),n.find(".txt-addressline2 label em").text("(if applicable)"),n.find(".txt-addressline2").removeClass("failed-validation"),n.find(".txt-addressline2 input[type='text']").attr("data-validation","opt-addressline2"),AVL.RESPONSIVEFORM.CORE.UTILITIES.FocusNextFocusableEmptyInput(n,n.find(".dd-states .dropdown")))):(n.find(".txt-addressline2 label em").text("(if applicable)"),AVL.RESPONSIVEFORM.CORE.UTILITIES.FocusNextFocusableEmptyInput(n,n.find(".dd-states .dropdown")))},fail:function(){n.find(".txt-addressline2 label em").text("(if applicable)");n.find(".txt-addressline2 .textbox").trigger("focus")}}))},open:function(){$(this).removeClass("ui-corner-all").addClass("ui-corner-top")},close:function(){$(this).removeClass("ui-corner-top").addClass("ui-corner-all");n.find(".txt-addressline1 .textbox").trigger("change")}})})},InitUSPhoneInputs:function(){if($("input[data-validation='req-phone-us']").length>0){AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber($("input[data-validation='req-phone-us']"),$("input[data-validation='req-phone-us']").val(),!0);$("input[data-validation='req-phone-us']").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)})}if($("input[data-validation='opt-phone-us']").length>0){AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber($("input[data-validation='opt-phone-us']"),$("input[data-validation='opt-phone-us']").val(),!0);$("input[data-validation='opt-phone-us']").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)})}},InitAddressModal:function(){$("body").on("click","#ar-change",function(){var n="#"+$(this).attr("data-addressline1"),t=$(n).closest(".responsive-form");return t.find(".txt-addressline1 .textbox").trigger("focus"),$(this).attr("data-showDeliveryModal")==="true",$.closeModal({target:"#address-results"})});$("body").on("click","#ar-certify",function(){var n="#"+$(this).attr("data-addressline1"),t=$(n).closest(".responsive-form");return $("#address-results").find("#addressCertified").val("true"),AVL.RESPONSIVEFORM.VALIDATION.AddressCertified=!0,t.find(".txt-addressline1 .textbox").trigger("change"),$.closeModal({target:"#address-results"})});$("body").on("click",".ar-choice",function(){var r="#"+$(this).attr("data-addressline1"),n=$(r).closest(".responsive-form"),t=$("#address-results").data("addresses"),i=$(this).prop("rel");return t!=null&&t.length>0&&(AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-addressline1"),n.find(".txt-addressline1 .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].AddressLine1),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-addressline2"),n.find(".txt-addressline2 .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].AddressLine2),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-city"),n.find(".txt-city .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].PoliticalDivision2),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".dd-states"),n.find(".dd-states .dropdown"),t[i].PoliticalDivision1,!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-zipcode"),n.find(".txt-zipcode .textbox"),t[i].PostcodePrimaryLow,!0),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(n.find(".txt-addressline1"),n.find(".txt-addressline1 .textbox"),!1,!1)),$.closeModal({target:"#address-results"})})},InitAlertBoxIcons:function(){$(".success-message").each(function(){AVL.RESPONSIVEFORM.CORE.DOM.AddAlertBoxIcon($(this),"icon-ok")})},InitFormWarningContainers:function(n){var t=n.is("fieldset")?n:n.find("fieldset");t.each(function(){var n=$(this),t="<div class='warning-messages'><\/div>";n.find("div.warning-messages").length||(n.find("legend").length===0?n.find("ul:first").before(t):n.find("legend").after(t))});$(".responsive-form").on("click",".bypass-field-link",function(){var t="bypassed-"+$(this).attr("data-element-id"),n=$("#"+$(this).attr("data-element-id"));return n.parent().attr("id")==="pAddressLine2"&&n.attr("data-validation","opt-addressline2"),$("#"+t).length===0&&$("body").append("<div id='"+t+"'><\/div>"),AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n),!1})},InitFormMasks:function(n){var t=n.find("ul li p, ul li div");t.on("click",function(){$(this).hasClass("focused")||$(this).find(".textbox, .textarea, .dropdown").trigger("focus")})},InitFormInputs:function(n){var t=n.find("ul li p"),i=t.find("select");i.customSelect();t.find(".textbox, .dropdown, .textarea").not(":disabled").on("focus",function(){if(!$(this).closest("p").hasClass("focused")){var n=$(this),i=n.closest("p"),t=i.find("label");$(".focused").removeClass("focused");i.addClass("focused");n.val()!=null&&n.val().length>0&&(t.hasClass("inputted")?t.addClass("inputting-notrans"):t.addClass("inputting"));localStorage.focus=n.not(".no-focus").attr("id")}}).on("blur",function(){var t=$(this),i=t.closest("p"),r=i.find("label");i.hasClass("focused")&&(i.removeClass("focused"),AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n));t.val()!=null&&t.val().length===0||t.val()==null?r.removeClass("inputting inputted inputting-notrans"):r.removeClass("inputting inputting-notrans").addClass("inputted")});t.find(".textarea").not(":disabled").on("focus",function(){$(this).closest("li").find("label.outter-label").addClass("focused")}).on("blur",function(){$(this).closest("li").find("label.outter-label").removeClass("focused")});t.find(".textbox, .textarea").on("keydown",function(){var n=$(this).parent().find("label");n.hasClass("inputting-notrans")||n.addClass("inputting")}).on("keyup",function(){var i=$(this),t=$(this).parent().find("label");i.val().length===0?t.removeClass("inputted inputting inputting-notrans"):t.hasClass("inputting-notrans")||t.addClass("inputting");AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n)});t.find("select").not(".no-reset").each(function(){var n=$(this),t=n.parent().find("label"),i=n.parent().find(".dropdown option:selected").index();(i===-1||n.val()==="")&&t.removeClass("inputted")}).on("change",function(){var n=$(this),t=$(this).parent().find("label");n.val()!=null&&n.val().length===0?t.removeClass("inputted inputting inputting-notrans"):t.addClass("inputted")});t.find("select.dropdown").on("keypress",function(n){n.which===13&&n.stopPropagation()});n.hasClass("skip-focus")||AVL.UTILITIES.FUNCTIONS.IsMobile()&&n.hasClass("skip-focus-mobile")||AVL.RESPONSIVEFORM.CORE.UTILITIES.SetFocusToCorrectInput(n)},InitFormStatusIcons:function(n){var t=n.find("ul li");t.find(".textbox, .textarea, .dropdown").each(function(){var n=$(this).closest("p"),t=n.prop("title");n.find("i.input-warning").length||n.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return AVL.RESPONSIVEFORM.CORE.DOM.ShowValidationMessage(event, $(this));'><\/i>")});t.find(".radiobutton, .checkbox").each(function(){var n=$(this).closest(".radio-mask, .checkbox-mask"),t=n.prop("title");!n.find("i.input-warning").length&&n.find("label").length&&n.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return AVL.RESPONSIVEFORM.CORE.DOM.ShowValidationMessage(event, $(this));'><\/i>")});t.find("[data-loader='true']").each(function(){var n=$(this).closest("p");n.append("<img class='input-loading' src='/CommonControls/ResponsiveForms/IMG/async-loader-1.gif' alt='Loading' />")})},InitFormLabels:function(n){var t=n.find("ul li p, ul li div");t.find(".textbox, .textarea").each(function(){var n=$(this),t=n.parent().find("label");n.val().length===0?t.removeClass("inputting inputted"):t.addClass("inputted")});t.find("select").each(function(){var n=$(this),t=n.parent().find("label"),i=n.prop("selectedIndex");i===-1||n.val()===""?t.removeClass("inputting inputted"):t.addClass("inputted")})},InitFormInstantValidation:function(n){var t=n.find("ul li p, ul li div");t.find("input.textbox, textarea.textarea, select.dropdown, input.checkbox, input.radiobutton, .radiobutton input, .checkbox input").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n)});n.find("input.radiobutton, .radiobutton input").on("click",function(){var n=$(this).closest(".radiobutton");AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n)})},InitFormButtons:function(n){n.find(".button-container .clear-button").on("click",function(){return AVL.RESPONSIVEFORM.CORE.UTILITIES.ClearLocalStorage(n),$(":input",n).each(function(){if(!($(this).hasClass("no-reset")||$(this).parent().hasClass("no-reset"))){var n=this.type,t=this.tagName.toLowerCase();n==="text"||n==="password"||t==="textarea"?this.value="":n==="checkbox"||n==="radio"?this.checked=!1:t==="select"&&(this.selectedIndex=0,$(this).trigger("update"))}}),AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n),!1})}},DOM:{AddAlertBoxIcon:function(n,t){var i=n.find("i."+t).length>0,r="<i class='"+t+"'><\/i>";i||n.prepend(r)},ShowValidationMessage:function(n,t){if(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation?n.stopPropagation():null,$("#responsive-form-message").length===0){var i="<div id='responsive-form-message' class='avlModal-container'><div class='avlModal-wrapper'><div class='avlModal-content'><p class='warning-message'><\/p><\/div><\/div><\/div>";$("form").length===1?$("form").append(i):$("body").append(i)}return $(".error-override").is(":visible")?$("#responsive-form-message").find(".avlModal-content p.warning-message").text($(".error-override").text()):$("#responsive-form-message").find(".avlModal-content p.warning-message").text(t.attr("title")),$.openModal({target:"#responsive-form-message",width:"300px"}),setTimeout(function(){$(":focus").trigger("blur")}),!1},SetCountryRelatedInputStates:function(n,t,i){i?n.find(".dropdown").trigger("change"):(n.find(".phone-format").text(""),t.toLowerCase()==="us"&&(n.find(".txt-phone").find("[data-validation^='req-phone']").each(function(){var n=$(this);n.attr("title","Please enter your phone number with area code.");n.val()!==""&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)}),n.find(".phone-format").text("(xxx) xxx-xxxx")))}},UTILITIES:{RemoveInputScriptTags:function(n){$(n.find("fieldset input[type='text']")).each(function(){$(this).val($(this).val().replace(/<|>/g,""))})},CapitalizeFirstLetter:function(n){for(var r=n.toLowerCase(),t=r.split(" "),i=0,u=t.length;i<u;i++)t[i]=t[i].charAt(0).toUpperCase()+t[i].slice(1);return t.join(" ")},FocusNextFocusableEmptyInput:function(n,t){var i=n.find(":focusable"),u=i.filter(function(){return $(this).val()===""}),r=!1;u.each(function(){!r&&i.index($(this))>i.index(t)&&($(this).trigger("focus"),r=!0)})},SetFocusToCorrectInput:function(n){var t,i=!1;localStorage.focus!=null&&localStorage.focus.length>0?(t=$("#"+localStorage.focus),i&&console.log("focus to: localStorage")):n.find(".focus").length>0?(t=n.find(".focus"),i&&console.log("focus to: .focus")):$(".avlModal").is(":visible")?(t=$(".avlModal:visible").find("fieldset ul li p:first").find(".textbox, .textarea, .dropdown"),i&&console.log("focus to: visible modal")):(t=n.find(".responsive-form fieldset ul li p").first().find(".textbox, .textarea, .dropdown").not(".no-focus"),i&&console.log("focus to: first input"));setTimeout(function(){t.trigger("focus").val(t.val())},10)},ProcessInputChange:function(n,t,i,r){var f=t.val(),u=i;t.val(u);r&&f!==u&&t.trigger("change");u===""?n.find("label").removeClass("inputted"):n.find("label").addClass("inputted")},VerifyAddress:function(n,t,i,r,u){var e="<address><addressline1>"+$("[id$='"+n+"']").val()+"<\/addressline1><addressline2>"+$("[id$='"+t+"']").val()+"<\/addressline2><city>"+$("[id$='"+i+"']").val()+"<\/city><state>"+$("[id$='"+r+"']").val()+"<\/state><zip>"+$("[id$='"+u+"']").val()+"<\/zip><\/address>",f=$("[id$='"+n+"']").closest(".responsive-form");$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:e,success:function(n){var i=$.parseXML(n),r=$(i),t=r.find("ismissingaptnumber");t!=null&&t!==""&&t.text().toLowerCase()==="true"&&(f.find(".txt-addressline2 label em").text("(required)"),f.find(".txt-addressline2 input[type='text']").attr("data-validation","req-field"))}})},PrefixPhoneWithCountryCode:function(n,t,i,r){if(t!==""&&!r){var u="";$.ajax({type:"GET",url:"/MyAccount/CommonControls/ResponsiveForms/XML/country-codes.xml",dataType:"xml",success:function(r){$(r).find("country").each(function(){var e=$(this).attr("code"),f,r;return u=$(this).attr("phoneCode"),t.toUpperCase()===e?(r=n.find(".txt-phone .textbox").val(),f=u==="1"||r!==""?r:"+"+u,i||AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-phone"),n.find(".txt-phone .textbox"),f,!1),!1):void 0})}})}AVL.RESPONSIVEFORM.CORE.NewFormContent=!1;AVL.RESPONSIVEFORM.CORE.BypassPhoneCountryCode=typeof phoneOptional!="undefined"?phoneOptional:!1},ReleaseLocalStorage:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&(n.is("fieldset")?n.sisyphus().manuallyReleaseData():n.find("fieldset").each(function(){$(this).sisyphus().manuallyReleaseData()}))},ClearLocalStorage:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&n.find("fieldset").each(function(){$(this).sisyphus().manuallyReleaseData()});localStorage.removeItem("focus");AVL.RESPONSIVEFORM.CORE.UTILITIES.SetFocusToCorrectInput(n);AVL.RESPONSIVEFORM.VALIDATION.DOM.HideAllValidationResults(n)}}};$(document).ready(function(){AVL.RESPONSIVEFORM.CORE.INIT.Init()}),function(n){n.fn.sisyphus=function(t){var r=n.map(this,function(t){return n(t).attr("id")+n(t).attr("name")}).join(),i=Sisyphus.getInstance(r);return t!==undefined&&i.protect(this,t),i};var t={};t.isAvailable=function(){if(typeof n.jStorage=="object")return!0;try{return localStorage.getItem}catch(t){return!1}};t.set=function(t,i){if(typeof n.jStorage=="object")n.jStorage.set(t,i+"");else try{localStorage.setItem(t,i+"")}catch(r){}};t.get=function(t){if(typeof n.jStorage=="object"){var i=n.jStorage.get(t);return i?i.toString():i}return localStorage.getItem(t)};t.remove=function(t){typeof n.jStorage=="object"?n.jStorage.deleteKey(t):localStorage.removeItem(t)};Sisyphus=function(){function r(){return{setInstanceIdentifier:function(n){this.identifier=n},getInstanceIdentifier:function(){return this.identifier},setInitialOptions:function(i){var r={excludeFields:[],includeFields:[],customKeySuffix:"",locationBased:!1,timeout:0,autoRelease:!0,onSave:function(){},onBeforeRestore:function(){},onRestore:function(){},onRelease:function(){}};this.options=this.options||n.extend(r,i);this.browserStorage=t},setOptions:function(t){this.options=this.options||this.setInitialOptions(t);this.options=n.extend(this.options,t)},protect:function(t,r){var u,f,e;if(this.setOptions(r),t=t||{},u=this,this.targets=this.targets||[],this.href=location.hostname+location.pathname+location.search+location.hash,this.targets=n.merge(this.targets,t),this.targets=n.unique(this.targets),this.targets=n(this.targets),!this.browserStorage.isAvailable())return!1;f=u.options.onBeforeRestore.call(u);(f===undefined||f)&&u.restoreAllData();this.options.autoRelease&&u.bindReleaseData();i.started[this.getInstanceIdentifier()]||(u.isCKEditorPresent()?e=setInterval(function(){CKEDITOR.isLoaded&&(clearInterval(e),u.bindSaveData(),i.started[u.getInstanceIdentifier()]=!0)},100):(u.bindSaveData(),i.started[u.getInstanceIdentifier()]=!0))},isCKEditorPresent:function(){if(this.isCKEditorExists()){CKEDITOR.isLoaded=!1;CKEDITOR.on("instanceReady",function(){CKEDITOR.isLoaded=!0});return!0}return!1},isCKEditorExists:function(){return typeof CKEDITOR!="undefined"},findFieldsToProtect:function(n){return n.find(":input").not(":submit").not(":reset").not(":button").not(":file").not(":password").not(":disabled").not("[readonly]")},bindSaveData:function(){var t=this;t.options.timeout&&t.saveDataByTimeout();t.targets.each(function(){var i=n(this).attr("id")+n(this).attr("name");t.findFieldsToProtect(n(this)).each(function(){if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1)return!0;var i=n(this),r=t.options.customKeySuffix+i.attr("name");(i.is(":text")||i.is("textarea"))&&(t.options.timeout||t.bindSaveDataImmediately(i,r));t.bindSaveDataOnChange(i)})})},saveAllData:function(){var t=this;t.targets.each(function(){var r=n(this).attr("id")+n(this).attr("name"),i={};t.findFieldsToProtect(n(this)).each(function(){var r=n(this),f,u,e;if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1||r.attr("name")===undefined)return!0;if(f=t.options.customKeySuffix+r.attr("name"),u=r.val(),r.is(":checkbox")){if(r.attr("name").indexOf("[")!==-1){if(i[r.attr("name")]===!0)return;u=[];n("[name='"+r.attr("name")+"']:checked").each(function(){u.push(n(this).val())});i[r.attr("name")]=!0}else u=r.is(":checked");t.saveToBrowserStorage(f,u,!1)}else r.is(":radio")?r.is(":checked")&&(u=r.val(),t.saveToBrowserStorage(f,u,!1)):t.isCKEditorExists()?(e=CKEDITOR.instances[r.attr("name")]||CKEDITOR.instances[r.attr("id")])?(e.updateElement(),t.saveToBrowserStorage(f,r.val(),!1)):t.saveToBrowserStorage(f,u,!1):t.saveToBrowserStorage(f,u,!1)})});t.options.onSave.call(t)},restoreAllData:function(){var t=this,i=!1;t.targets.each(function(){var r=n(this),u=n(this).attr("id")+n(this).attr("name");t.findFieldsToProtect(r).each(function(){if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1)return!0;var r=n(this),f=t.options.customKeySuffix+r.attr("name"),u=t.browserStorage.get(f);u!==null&&(t.restoreFieldsData(r,u),i=!0)})});i&&t.options.onRestore.call(t)},restoreFieldsData:function(n,t){if(n.attr("name")===undefined)return!1;n.is(":checkbox")&&t!=="false"&&n.attr("name").indexOf("[")===-1?n.prop("checked",!0):n.is(":checkbox")&&t==="false"&&n.attr("name").indexOf("[")===-1?n.prop("checked",!1):n.is(":radio")?n.val()===t&&n.prop("checked",!0):n.attr("name").indexOf("[")===-1?(n.val()===""||n.attr("data-override-server")==="true")&&n.val(t):(t=t.split(","),n.val(t))},bindSaveDataImmediately:function(n,t){var i=this,r;if("onpropertychange"in n?n.get(0).onpropertychange=function(){i.saveToBrowserStorage(t,n.val())}:n.get(0).oninput=function(){i.saveToBrowserStorage(t,n.val())},this.isCKEditorExists()&&(r=CKEDITOR.instances[n.attr("name")]||CKEDITOR.instances[n.attr("id")]))r.document.on("keyup",function(){r.updateElement();i.saveToBrowserStorage(t,n.val())})},saveToBrowserStorage:function(n,t,i){i=i===undefined?!0:i;this.browserStorage.set(n,t);i&&t!==""&&this.options.onSave.call(this)},bindSaveDataOnChange:function(n){var t=this;n.on("change",function(){})},saveDataByTimeout:function(){var n=this,t=n.targets;setTimeout(function(){function t(){n.saveAllData();setTimeout(t,n.options.timeout*1e3)}return t}(t),n.options.timeout*1e3)},bindReleaseData:function(){var t=this;t.targets.each(function(){var i=n(this),r=i.attr("id")+i.attr("name");n(this).on("submit reset",function(){t.releaseData(r,t.findFieldsToProtect(i))})})},manuallyReleaseData:function(){var t=this;t.targets&&t.targets.each(function(){var i=n(this),r=i.attr("id")+i.attr("name");t.releaseData(r,t.findFieldsToProtect(i))})},releaseData:function(t,r){var f=!1,u=this;i.started[u.getInstanceIdentifier()]=!1;r.each(function(){if(n.inArray(this,u.options.excludeFields)!==-1&&n.inArray(this,u.options.includeFields)===-1)return!0;var t=n(this),i=u.options.customKeySuffix+t.attr("name");u.browserStorage.remove(i);f=!0});f&&u.options.onRelease.call(u)}}}var i={instantiated:[],started:[]};return{getInstance:function(n){return i.instantiated[n]||(i.instantiated[n]=r(),i.instantiated[n].setInstanceIdentifier(n),i.instantiated[n].setInitialOptions()),n,i.instantiated[n]},free:function(){return i={instantiated:[],started:[]},null},version:"1.1.107"}}()}(jQuery);window.console||(console={log:function(){}});AVL=AVL||{};AVL.RESPONSIVEFORM=AVL.RESPONSIVEFORM||{};AVL.RESPONSIVEFORM.VALIDATION={InstantValidationDebug:!1,SubmitValidationDebug:!1,ShowJSONAddressData:!1,AddressCertified:!1,HasInvalidTextWarning:!1,IsZipCodeValid:!0,IsZipCodeError:!1,JsonCertifiedAddress:{addressline1:"",city:"",state:"",zipCode:"",country:""},DOM:{BuildAddressResultsModal:function(n,t,i,r){var f,u;$("#address-results").remove();$("form").append("<div id='address-results' class='avlModal-container'><div class='avlModal-wrapper'><div class='avlModal-header'><\/div><div class='avlModal-content'><\/div><\/div><input type='hidden' name='addressCertified' id='addressCertified' value='false'/><\/div>");switch(t){case"none":u="We were unable to verify your address. Please choose one of the following options below to proceed:";$("#address-results").find(".avlModal-header").text("Address Not Found");$("#address-results").find(".avlModal-content").html("<h6>"+u+"<\/h6><p><a id='ar-change' data-addressline1='"+n+"' href='#' title='Change the address'>Change the address<\/a><\/p><p><a id='ar-certify' data-addressline1='"+n+"' href='#' title='Certify that the address you entered is the correct address'>Certify that the address is correct ( <em> "+i+" <\/em> )<\/a><\/p>");break;case"multiple":f="";u="We were unable to verify your address. Please choose one of the following options below to proceed:";$.each(r,function(t){f+="<p><a class='ar-choice' data-addressline1='"+n+"' href='#' rel='"+t+"' title='Use this address'>"+r[t].fullAddress+"<\/a><\/p>"});$("#address-results").find(".avlModal-header").text("Choose Correct Address");$("#address-results").find(".avlModal-content").html("<h6>"+u+"<\/h6>"+f+"<p><a id='ar-change' data-addressline1='"+n+"' href='#' title='Change the address'>Change the address<\/a><\/p><p><a id='ar-certify' data-addressline1='"+n+"' href='#' title='Certify that the address you entered is the correct address'>Certify the address is correct - <em> "+i+" <\/em><\/a><\/p>");$("#address-results").data("addresses",r)}$.openModal({target:"#address-results",width:"650px"})},ShowLoadingImage:function(n,t,i){i.show();n.removeClass("failed-validation")},MoveToFirstFailedInput:function(){$(".failed-validation").length>0&&$(".failed-validation:first").closest("fieldset").length>0&&($("#slideout-content").animate({scrollTop:$("#slideout-content").scrollTop()+$(".failed-validation:first").closest("fieldset").offset().top-10},500)||$("html, body").animate({scrollTop:$(".failed-validation:first").closest("fieldset").offset().top-10},500),$(".failed-validation:first input:not(.hasDatepicker), .failed-validation:first textarea, .failed-validation:first select").trigger("focus"))},HideAllValidationResults:function(n){var t=n.find("ul li p, ul li div");t.each(function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationClass(n,!1);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationMessage(n,n.find("input.textbox:visible, textarea.textarea:visible, select.dropdown:visible, input.checkbox:visible, input.radiobutton:visible"),!1,!1)})},DisplayValidationResult:function(n,t,i,r){t.val()===""?n.find("label").removeClass("inputted"):n.find("label").addClass("inputted");AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationClass(n,i);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationMessage(n,t,i,r)},SetValidationClass:function(n,t){t?n.addClass("failed-validation"):n.removeClass("failed-validation")},SetValidationMessage:function(n,t,i,r){var o,e,h;typeof t.attr("id")!=typeof undefined?(e=t.attr("id").split("_"),o=e[e.length-2]+"_"+e[e.length-1]+"_warning"):o=t.attr("id")+"_warning";var u=n.attr("data-warning-override"),f="",s=$('[id$="'+o+'"]');f=t.attr("data-validation")==="opt-addressline2"?AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning?"Please provide valid apartment,suite or building number":typeof u!="undefined"&&u!==!1?u:n.attr("title")||!1:typeof u!="undefined"&&u!==!1?u:n.attr("title")||!1;n.find(".input-warning").attr("title",f);i&&f?(h="",t.attr("data-validation")!=="opt-addressline2"&&t.parent().attr("id")!=="pAddressLine2"||AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning||(h=" <a href='#bypass-field' class='bypass-field-link' data-element-id='"+t.attr("id")+"'>Click here if the value is correct.<\/a>"),f+=h,s.length===0&&(r||AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning&&t.attr("data-validation")==="opt-addressline2")?n.closest("fieldset").find(".warning-messages:first").append("<div id='"+o+"'>"+f+"<\/div>"):s.length>0&&s.html(f)):s.slideUp(200,function(){$(this).remove()})},SetIconWarningMessage:function(n){var t=n.prop("title");n.find("i.input-warning").length?$(n.find("i.input-warning")).attr("title",t):$parent.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return ShowValidationMessage(event, $(this));'><\/i>")}},FUNCTIONS:{CheckInputValue:function(n,t,i,r,u,f){var e=t.closest(".responsive-form"),gt,k,ot,ni,st,ti,d,h,ht,g,ii,ri,y,p,nt,ct,ui,fi,i,ei,oi,lt,tt,at,si,hi,n,it,o,ci,rt,ut;switch(r){case"req-field":t.is(":password")||(i=i.replace(/<|>/g,""),t.val(i));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-selection":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNoSelection(i));break;case"req-checked":u.resolve(!t.is(":checked"));break;case"req-checked-list":u.resolve(!t.find("input:checked").length);break;case"req-price":t.hasClass("format-price")&&(i=i.replace(/[^.0-9]/g,""),t.val("$"+parseFloat(i).toFixed(2)));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPrice(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i));break;case"req-price-min":var bi=i.replace(/[^.0-9]/g,""),a=parseFloat(bi),ki=t.attr("data-minprice");AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(a)&&t.val("$"+a);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(a)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(a)||a<ki);break;case"req-price-range":gt="$";t.hasClass("format-price")&&(i=i.replace(/[^.0-9]/g,""),t.val("$"+parseFloat(i).toFixed(2)));case"req-number-range":var di=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i),gi=t.closest(":has(.req-price-top)").find(".req-price-top").text().replace(/[^.0-9]/g,""),vt=parseFloat(gi),nr=t.closest(":has(.req-price-bottom)").find(".req-price-bottom").text().replace(/[^.0-9]/g,""),yt=parseFloat(nr),a=parseFloat(i),li=gt||"",v=!1;i!=="N/A"&&(!di||i<=0)?(v=!0,n.attr("data-warning-override","Please enter a valid amount.")):!isNaN(vt)&&vt<a?(v=!0,n.attr("data-warning-override","Please enter an amount less than or equal to "+li+vt+".")):!isNaN(yt)&&yt>a&&(v=!0,n.attr("data-warning-override","Please enter an amount more than "+li+yt+"."));u.resolve(v);break;case"req-customwidth-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,0,299,2,"custom trim width"));break;case"req-customheight-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,0,299,2,"custom trim height"));break;case"req-spinewidth-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,.25,2,3,"spine width"));break;case"req-minmax-range":var tr=t.attr("data-range")==="min",ir=t.attr("data-range")==="max",rr=$("select[data-range='min']").val(),ur=$("select[data-range='max']").val();i===""?(v=!0,n.attr("data-warning-override","Please select a value.")):tr&&parseInt(i)>parseInt(ur)?(v=!0,n.attr("data-warning-override",t.attr("data-warning-override"))):ir&&parseInt(i)<parseInt(rr)&&(v=!0,n.attr("data-warning-override",t.attr("data-warning-override")));u.resolve(v);break;case"req-number":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?n.attr("data-warning-override",n.attr("title")+" (Must be a valid number)"):n.removeAttr("data-warning-override");k=t.attr("minLength");k!==null&&t.val().length<k&&(n.attr("data-warning-override",n.attr("title")+" (Must be a "+k+"-digit number)"),u.resolve(!0));t.hasClass("req-route")&&(ot=i,ot!==""&&$.ajax({type:"POST",url:"/MyAccount/PaymentInformation.aspx/ValidateBankRoutingNumber",async:!1,data:"{'routingNumber':'"+ot+"'}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(n){n.setRequestHeader("content-type","application/json; charset=utf-8")},success:function(t){var i=t.d;i==="Not Found"&&(n.attr("data-warning-override","Invalid routing number."),u.resolve(!0))}}));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i));break;case"req-three":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||parseInt(i)<0||parseInt(i)>3);break;case"opt-number":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)));break;case"req-upc":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||i.length!==11&&i.length!==12);break;case"opt-isbn":i===""&&u.resolve(!1);case"req-isbn":case"req-isbn-design":i=i.replace("-","");u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsISBN(i));r==="req-isbn-design"&&n.attr("data-warning-override","Please enter a valid 13 digit ISBN code.");break;case"opt-phone":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumber(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsInternationalPhoneNumber(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-phone-us":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!0);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-phone-us":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-phone-bycountry":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumberByCountry(i,AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.GetCountryCode(t))||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-phone-bycountry":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumberByCountry(i,AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.GetCountryCode(t))&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-addressline1":case"opt-addressline1":ni={addressline1:e.find(".txt-addressline1 .textbox").val(),city:e.find(".txt-city .textbox").val(),state:e.find(".dd-states .dropdown").val(),zipCode:e.find(".txt-zipcode .textbox").val(),country:e.find(".dd-country .dropdown").val()};r!=="opt-addressline1"||AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckCertifiedAddressMatch(ni)?u.resolve(!1):(d=e.find(".dd-country .dropdown").val(),d==="US"&&AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeValid&&f?(h={testing:!1,companyname:e.find(".txt-company .textbox").val(),addressline1:e.find(".txt-addressline1 .textbox").val(),addressline2:e.find(".txt-addressline2 .textbox").val(),city:e.find(".txt-city .textbox").val(),state:e.find(".dd-states .dropdown").val(),zipCode:e.find(".txt-zipcode .textbox").val(),country:e.find(".dd-country .dropdown").val()},st=e.find(".txt-addressline1 .textbox").val()+" "+e.find(".txt-addressline2 .textbox").val()+" "+e.find(".txt-city .textbox").val()+" "+e.find(".dd-states .dropdown").val()+" "+e.find(".txt-zipcode .textbox").val(),AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(h),$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationStreetLevel.ashx",type:"POST",data:JSON.stringify(h),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){var s,t,i,r,f;if(n!=undefined&&n.Response!=undefined)if(s=n.Response,t=n.AddressKeyFormats,AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(n),s.ResponseStatusDescription==="Failure")u.resolve(!1);else if(i=typeof APPLICATION!="undefined"&&typeof APPLICATION.CHECKOUTPROCESS!="undefined"&&typeof APPLICATION.CHECKOUTPROCESS.CORE.BypassModal!="undefined"&&APPLICATION.CHECKOUTPROCESS.CORE.BypassModal,t.length===0)i||$.trim(h.addressline1)===""||$.trim(h.city)===""||$.trim(h.state)===""||$.trim(h.zipCode)===""||AVL.RESPONSIVEFORM.VALIDATION.DOM.BuildAddressResultsModal(e.find(".txt-addressline1 .textbox").attr("id"),"none",st),u.resolve(!0);else if(t.length!==1||/\d-\d/.test(t[0].AddressLine1)){var o=[],c=[],l=[];$.each(t,function(n){o.push(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PoliticalDivision2)+" "+t[n].PoliticalDivision1+" "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PostcodePrimaryLow))});$.each(o,function(n,i){$.inArray(i,c)===-1&&(c.push(i),t[n].fullAddress=o[n],l.push(t[n]))});i||AVL.RESPONSIVEFORM.VALIDATION.DOM.BuildAddressResultsModal(e.find(".txt-addressline1 .textbox").attr("id"),"multiple",st,l);u.resolve(!0)}else e.find(".txt-addressline1 .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].AddressLine1)).trigger("change"),t[0].AddressLine2!==""&&e.find(".txt-addressline2 .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].AddressLine2)).trigger("change"),e.find(".txt-city .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].PoliticalDivision2)).trigger("change"),r=e.find(".dd-states .dropdown"),f=t[0].PoliticalDivision1,r.val()!==f&&r.val(f).trigger("change"),AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeError||e.find(".txt-zipcode .textbox").val(t[0].PostcodePrimaryLow),e.find(".txt-zipcode label").addClass("inputted"),e.find(".txt-city label").addClass("inputted"),u.resolve(!1)},fail:function(){e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide();u.resolve(!1)}})):u.resolve(!1)):u.resolve(!0):u.resolve(!1);break;case"opt-addressline2":if(ti=$.trim(e.find(".txt-addressline2 .textbox").val()),/^[a-zA-Z0-9-#&. ]*$/.test(ti)===!1)AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning=!0,u.resolve(!0);else{if(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNonUSCountry(t)||$("#bypassed-"+t.attr("id")).length!==0)u.resolve(!1);else{var ai=$.trim(e.find(".txt-addressline1 .textbox").val()),fr=$.trim(e.find(".txt-addressline2 .textbox").val()),vi=$.trim(e.find(".txt-city .textbox").val()),er=e.find(".dd-states").css("display")!=="none",yi=er?e.find(".dd-states .dropdown").val():$.trim(e.find(".txt-state .textbox").val()),pi=$.trim(e.find(".txt-zipcode .textbox").val());if(ai!==""&&vi!==""&&yi!==""&&pi!==""){var or="<address><addressline1>"+ai+"<\/addressline1><addressline2>"+fr+"<\/addressline2><city>"+vi+"<\/city><state>"+yi+"<\/state><zip>"+pi+"<\/zip><\/address>",pt=t.parent().find(".input-loading"),w=!1;AVL.RESPONSIVEFORM.VALIDATION.DOM.ShowLoadingImage(n,t,pt);$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:or,success:function(n){pt.fadeOut(100,function(){var i=$.parseXML(n),r=$(i),t=r.find("ismissingaptnumber");t!=null&&t!==""?(w=t.text().toLowerCase()==="true",e.find(".txt-addressline2 label em").text(w?"(required)":"(if applicable)"),w&&e.find(".txt-addressline2 input[type='text']").attr("data-validation","req-field"),w&&(address2Flagged=!0),u.resolve(w)):u.resolve(!1)})},error:function(){pt.hide();u.resolve(!1)}})}else u.resolve(!1)}AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning=!1}break;case"req-zipcode":case"opt-zipcode":r!=="opt-zipcode"||AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||/[\/\\\"?&.*:<>|@#%,]/g.test(i)?u.resolve(!0):(d=e.find(".dd-country .dropdown").val(),d==="US"?(f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").show(),h={testing:!1,country:e.find(".dd-country .dropdown").val(),zipCode:i},AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(h),$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationCityStateZIP.ashx",type:"POST",data:JSON.stringify(h),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(n!=undefined&&n.Response!=undefined){var i=n.Response,t=n.AddressValidationResults;AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(i);i.ResponseStatusDescription==="Failure"?(f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide(),i.ErrorCode==="101112"||i.ErrorCode==="20008"?(AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeValid=!1,AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeError=!0,u.resolve(!0)):u.resolve(!1)):(AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&$.each(t,function(n){console.log(t[n])}),f?u.resolve(!1):(e.find(".txt-state .input-loading, .dd-states .input-loading").fadeOut(100),e.find(".txt-city .input-loading").fadeOut(100,function(){var n,i,r;if(t.length>0){if(n=t[0].StateProvinceCode,AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".dd-states"),e.find(".dd-states .dropdown"),!1,f),t[0].City!=="")if(t.length===1)e.find(".txt-city .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].City)),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-city"),e.find(".txt-city .textbox"),!1,f),e.find(".txt-city .textbox").autocomplete({source:[]});else{i=[];r=!1;$.each(t,function(n){i[n]=AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].City);t[n].City.toLowerCase()===$.trim(e.find(".txt-city .textbox").val()).toLowerCase()&&(r=!0)});r||(e.find(".txt-city .textbox").val(""),e.find(".txt-city").find("label").removeClass("inputted"));e.find(".txt-city .textbox").autocomplete({position:{my:"left top",at:"left bottom-1",of:e.find(".txt-city")},delay:0,source:i,minLength:0,select:function(){var n=e.find(".txt-city .textbox");n.parent().find("label").addClass("inputted");AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-city"),e.find(".txt-city .textbox"),!1,f)},close:function(){e.find(".txt-city .textbox").trigger("change")}}).on("focus",function(){$(this).hasClass("ui-autocomplete-input")&&$(this).autocomplete("search","")})}e.find(".txt-state").length>0&&e.find(".txt-state").css("display")!=="none"?(e.find(".txt-state .textbox").val(n),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-state"),e.find(".txt-state .textbox"),!1,f)):(e.find(".dd-states select").val(n).trigger("change"),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".dd-states"),e.find(".dd-states .dropdown"),!1,f));AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels($("#address-container"));u.resolve(!1)}else u.resolve(!0)})))}else AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(n),f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide(),u.resolve(!1)},fail:function(){e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide();u.resolve(!1)}})):u.resolve(!1)):u.resolve(!1);break;case"req-email":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-multi-email":if(i===""){u.resolve(!1);break}if(ht=!1,g=i.split(","),AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(g))for(ii in g){ri=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(g[ii]);ri||(ht=!0);break}u.resolve(ht);break;case"req-email-newaccount":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-ssn":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsSSN(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-url":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsURL(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-date-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(n.attr("title","Please enter the Publish Date in this format (MM/DD/YYYY)."),u.resolve(!0)):(new Date).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","Publish date must be today's date or a date in the future."),u.resolve(!0)):u.resolve(!1);break;case"req-date":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsDate(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-date-mm-dd-yy":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i));break;case"req-pod-availabledate-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?new Date((new Date).setDate((new Date).getDate()+56)).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","We require that you make your book release date at least 8 weeks after you upload your book file to BookBaby.com."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Available Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-available-date-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","Available date must be today's date or a date in the future."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Available Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-CouponEndDate-mm-dd-yy":p=$("#coupon-modal [id$='txtStartDate'] ").val();y=i;AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(y)||Date.parse(p)>Date.parse(y)?(n.attr("title","Expiration date must be after the Start Date."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Expiration Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-CouponStartDate-mm-dd-yy":y=$("#coupon-modal [id$='txtEndDate'] ").val();p=i;AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(p)?(n.attr("title","Start date should be today's date or a date in the future."),u.resolve(!0)):Date.parse(p)>Date.parse(y)?(n.attr("title","Expiration date must be after the Start Date."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Start Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-StartDateAddMinimum-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i,minimumDays=4)?(nt=new Date,nt.setDate((new Date).getDate()+minimumDays),nt.setHours(0,0,0),Date.parse(nt)>Date.parse(i)?(n.attr("title","Start date must be at least "+minimumDays+" days from today’s date."),u.resolve(!0)):u.resolve(!1)):(n.attr("title","Please enter the Start Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-dateddl-gt":var ft=new Date,wt=i.split("/"),et=new Date,bt=e.find("select[data-validation=req-dateddl-lt]").val().split("/");ft.setDate(parseInt(wt[0]));ft.setMonth(parseInt(wt[1])-1);ft.setYear(parseInt(wt[2]));et.setDate(parseInt(bt[0]));et.setMonth(parseInt(bt[1])-1);et.setYear(parseInt(bt[2]));u.resolve(ft.getTime()<et.getTime());break;case"req-password":case"req-password1":i.length===0?n.attr("title","Please enter a password."):i.length<8?n.attr("title","Your password must be at least 8 characters."):i.length>20&&n.attr("title","Your password must be 20 characters or less.");ct=e.find("input[data-validation=req-password2]");ui=ct.val();ui!==""&&AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(ct);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||i.length<8||i.length>20);break;case"req-password2":fi=e.find("input[data-validation=req-password1]").val();AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?i!==fi?(n.attr("title","The password and confirmation don't match."),u.resolve(!0)):i.length<8?(n.attr("title","Your confirming password must be at least 8 characters."),u.resolve(!0)):i.length>20?(n.attr("title","Your confirming password must be 20 characters or less."),u.resolve(!0)):u.resolve(!1):u.resolve(!0);break;case"req-coupon":i=t.val();ei=$("#coupon-modal [id$='rbCouponType'] input:checked").val();ei==="1"?u.resolve(!1):AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsAlphNumeric(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?(oi=/The coupon code you entered has already been used. Please enter a different code/i,$("[id$='btnValidateCoupon']").show(),lt=t.attr("id")+"_warning",oi.test($("#"+lt).html())?(n.attr("title","The coupon code you entered has already been used. Please enter a different code."),/./i.test($("#"+lt).html())?u.resolve(!1):u.resolve(!0)):u.resolve(!1)):(i!==""?n.attr("title","Special characters are not allowed."):n.attr("title","Please enter coupon code."),$("[id$='lblCouponCodeAvailable']").hide(),u.resolve(!0));break;case"req-coupon-discount":tt=$("#coupon-modal [id$='rbDiscountType'] input:checked").val();at=tt==="1"?t.val().replace(/[$]/g,""):t.val().replace(/[%]/g,"");isValid=!0;$.isNumeric(at)?(si=parseFloat($("#coupon-modal [id$='hfModalBookPrice']").val()),hi=$("#coupon-modal [id$='hfModalBookType']").val(),u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateCoupondiscount(tt,hi,at,si,n))):(n.attr("title",tt===undefined?"Please select the discount type first.":"Please enter a valid discount amount."),u.resolve(!0));break;case"req-budget":var c=i.replace(/[^.0-9]/g,""),s=$('[id$="txtNumWeeks"]').val().replace(/[^.0-9]/g,""),wi=$('[id$="spEnteredBudget"]'),sr=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(c)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(c)||c<100,l=AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetRoundDownBudget(c),b=l/100;sr?(n.attr("title",l===0?"The budget you have entered does not meet the minimum of $100 per week.":"Please enter an integer that meets the minimum budget."),wi.text(c!==""?"The budget you have entered does not meet the minimum of $100 per week.":""),u.resolve(!0)):($('[id$="txtBudget"]').val("$"+c),n=$('[id$="txtNumWeeks"]').parent("p"),it=$('[id$="txtNumWeeks_warning"]'),s!==""&&(s>b||s==="0")?(o=b===1?"Please enter 1 week":"Please enter number of weeks between 1 – "+b,o+=" or increase your budget.",n.attr("title",o),n.find("i.input-warning").length?n.find("i.input-warning").attr("title",o):n.append("<i class='input-status input-warning icon-attention' title='"+o+"' onclick='ShowValidationMessage(event, $(this));'><\/i>"),n.addClass("failed-validation"),it.text(o)):s!==""&&(n.attr("title",""),n.removeClass("failed-validation"),it.length>0&&it.text("")),AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ShowBudgetLabel(l,b,b,wi),u.resolve(!1));break;case"req-budget-per-week":var s=i.replace(/[^.0-9]/g,""),c=$('[id$="txtBudget"]').val().replace(/[^.0-9]/g,""),kt=!1,o="",l=AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetRoundDownBudget(c),dt=$.isNumeric(s)&&$.isNumeric(c)&&l!=="0",hr=l/100;if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(s)){o="Please enter a valid integer.";n.attr("title",o);$('[id$="input-warning"]').attr("title",o);dt=!1;u.resolve(!0);break}if($("[id$='txtNumWeeks']").val(s),s!==""&&s!=="0"&&c===""||l===0){u.resolve(!1);break}dt?(kt=parseInt(s)>=1?l/s>=100:!1,kt?n.attr("title",""):(o=hr===1?"Please enter 1 week":"Please enter number of weeks between 1 – "+l/100,o+=" or increase your budget.",n.attr("title",o),$('[id$="input-warning"]').attr("title",o))):n.attr("title","Please enter the week in the correct format.");u.resolve(!dt||!kt);break;case"req-albumname":case"req-artistname":case"req-volumename":case"req-tracktitle":case"req-urlpage":case"req-cdtext":ci=r==="req-volumename"||r==="req-urlpage"?/[\[\]\/\\\"~'&^$!}{\;()?.*+=:<>| @#%,]/g:/[\/\\\*:<>|@#%]/g;i=t.val().replace(/[^\x00-\x7F]/g,"");i=i.replace(ci,"");t.val(i);t.closest("fieldset").sisyphus().saveAllData();f?u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i.trim())):u.resolve(!1);break;case"opt-isrc":if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)){u.resolve(!1);break}case"req-isrc":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/^[a-zA-Z]{2}(-?)[0-9a-zA-Z]{3}(-?)\d{2}(-?)\d{5}$/.test(i));break;case"req-search":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||i.trim().toLowerCase()==="search");break;case"req-youtubelink":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/^(http(s?)\:\/\/)?(www\.)?((youtube\.com\/watch\?v=)|(youtu.be\/))([a-zA-Z0-9\-_]){11}/.test(i.toLowerCase()));break;case"req-youtubechannel":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/((http|https):\/\/|)(www\.|)youtube\.com\/(channel\/|user\/|c\/|@)[a-zA-Z0-9_\-]{1,}$/.test(i.toLowerCase()));break;case"req-partnerlink":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-fullname":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!i.trim().includes(" "));break;case"req-selected-speaker":u.resolve(i.trim()==="Not Selected"||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-word-phrase":if(rt=n.parent().next().find(".textbox-mask"),!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(rt.children(".textarea").val())){AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(rt,rt.children(".textarea"),!1,f);u.resolve(!1);break}u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-pronunciation":if(ut=n.parent().prev().find(".textbox-mask"),!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(ut.children(".textarea").val())){AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(ut,ut.children(".textarea"),!1,f);u.resolve(!1);break}u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;default:u.resolve(!1)}return u.promise()},CheckCertifiedAddressMatch:function(n){return!AVL.RESPONSIVEFORM.VALIDATION.AddressCertified||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.addressline1!==$.trim(n.addressline1)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.city!==$.trim(n.city)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.zipCode!==$.trim(n.zipCode)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.state!==$.trim(n.state)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.country!==$.trim(n.country)?(AVL.RESPONSIVEFORM.VALIDATION.AddressCertified=!1,$("#address-results").find("#addressCertified").val("false"),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.addressline1=$.trim(n.addressline1),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.city=$.trim(n.city),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.zipCode=$.trim(n.zipCode),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.state=$.trim(n.state),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.country=$.trim(n.country),!1):!0},ValidateInput:function(n){var t=n.closest("p, div.radio-mask, div.textbox-mask"),i=$.trim(n.val()),r=n.attr("data-validation")||n.parent().attr("data-validation"),u=new $.Deferred;$.when(AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckInputValue(t,n,i,r,u,!1)).done(function(r){AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(t,n,r,!1);AVL.RESPONSIVEFORM.VALIDATION.InstantValidationDebug&&console.log("input: "+n.attr("id")+"\r\nvalue: '"+i+"'\r\nfail: "+r)})},GetProjectedProceed:function(n,t,i,r){var u,f=r==="1"?t:t*n/100,e=i==="Print"?n/2:15*n/100;return u=n-f,u=u-e,u>0?u.toFixed(2):0..toFixed(2)},ValidateCoupondiscount:function(n,t,i,r,u){var f=!0;if(u.attr("title",""),$.isNumeric(i)){$("#coupon-modal [id$='projected-amount']").text("");switch(n){case"1":t==="eBook"?i>r*85/100&&i!=r&&(u.attr("title","The maximum allowable discount for an eBook is up to 85% or 100% of the book price [$"+r+"]."),f=!1):t==="Audiobook"?i>r*.75&&(u.attr("title","The maximum allowable discount for an audiobook is 75% of the book price [$"+r+"]."),f=!1):i>r/2&&(u.attr("title","The maximum allowable discount for a print book is half of the book price [$"+r+"]."),f=!1);break;case"2":t==="eBook"?parseFloat(i)!==100&&parseFloat(i)>85&&(u.attr("title","The maximum allowable discount for an eBook is up to 85% or 100% of the book price [$"+r+"]."),f=!1):t==="Audiobook"?r*i/100>r*.75&&(u.attr("title","The maximum allowable discount for an audiobook is 75% of the book price [$"+r+"]."),f=!1):r*i/100>r/2&&(u.attr("title","The maximum allowable discount for a print book is 50% of the price [$"+r+"]."),f=!1);break;case undefined:u.attr("title","Please select the discount type first.");f=!1}$("#coupon-modal [id$='projected-amount']").text(f?"Projected Proceeds: $"+AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetProjectedProceed(r,i,t,n):"")}else u.attr("title","Please enter a valid discount amount."),f=!1;return f||AVL.RESPONSIVEFORM.VALIDATION.DOM.SetIconWarningMessage(u),f},ShowBudgetLabel:function(n,t,i,r){var u=n/t>=100;r.text(u?"The budget you have entered will allow for 1 "+(i===1?"week":"- "+i+" weeks")+" of advertising":"")},GetRoundDownBudget:function(n){return n%100!=0?n-n%100:n}},POSTBACKS:{ValidateInputs:function(n,t,i,r){var e=n.target||n.srcElement,u=$(e),o=[],f=!0,s=u.attr("data-submit-text")==undefined?"Submitting...":u.attr("data-submit-text"),h=u.attr("data-submit-scrollform")==undefined?!0:u.attr("data-submit-scrollform");return u.data("validated")==="true"?!0:(u.data("original")==undefined&&u.data("original",u.val()),u.val(s).prop("disabled",!0),t.addClass("invalid-form"),t.each(function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.RemoveHazardousStrings(t);$(n).find("input.textbox:visible, textarea.textarea:visible, select.dropdown:visible, input.checkbox:visible, .checkbox input:visible, .radiobutton:visible").each(function(){var n=$(this),t=n.closest("p, div.radio-mask, div.textbox-mask"),r=$.trim(n.val()),u=n.attr("data-validation")||n.parent().attr("data-validation"),i=new $.Deferred;o.push(i);$.when(AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckInputValue(t,n,r,u,i,!0)).done(function(i){i&&(f=!1);AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(t,n,i,!0);AVL.RESPONSIVEFORM.VALIDATION.SubmitValidationDebug&&console.log(n.attr("id").split("_").pop()+"("+n.val()+") - fail: "+i)})})}),$.when.apply(null,o).done(function(){u.val(u.data("original")).prop("disabled",!1);f?i!=null?(AVL.RESPONSIVEFORM.CORE.UTILITIES.ReleaseLocalStorage($(".responsive-form")),localStorage.removeItem("focus"),i.apply(u[0])):(u.val(s).data("validated","true"),AVL.RESPONSIVEFORM.CORE.UTILITIES.ReleaseLocalStorage($(".responsive-form")),localStorage.removeItem("focus"),e.onclick=null,r!=null?(t.each(function(){score=$(this).attr("id")=="newsletter-form"?$("#recaptchaScoreNews"):$("#recaptchaScore")}),AVL.UTILITIES.FUNCTIONS.GetRecaptchaToken(r,score,$("#recaptchaKey"),u)):setTimeout(function(){u.trigger("click");u.attr("data-submit-disable")=="true"&&u.prop("disabled",!0)},1)):h===!0&&AVL.RESPONSIVEFORM.VALIDATION.DOM.MoveToFirstFailedInput();AVL.RESPONSIVEFORM.VALIDATION.SubmitValidationDebug&&console.log("Form sumbit validated: "+f)}),!1)}},UTILITIES:{FormatUSPhoneNumber:function(n,t,i){t=t.replace(/["'()-]/g,"");t=t.replace(/ /g,"");t=t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNonUSCountry(n)||i)&&n.val(t)},GetCountryCode:function(n){var i="",t=n.closest(".responsive-form").find(".dd-country select:visible");return t.length>0&&t.val()&&(i=t.val().toLowerCase()),i},ValidateRange:function(n,t,i,r,u,f){var c=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(t),l=t.replace(/[^.0-9]/g,""),s=parseFloat(l),e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/),h,o=!1;return h=Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)),t===""||!c||s<=0?(o=!0,n.attr("data-warning-override","Please enter a valid "+f+".")):s<i||s>r?(o=!0,n.attr("data-warning-override","Please enter a valid "+f+".")):h>u&&(o=!0,n.attr("data-warning-override","Please enter a "+f+" of up to "+u+" decimal places.")),o},RemoveHazardousStrings:function(n){n.find("input.textbox, textarea.textarea").each(function(){$(this).val(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.SanitizeValue($(this).val()))})},SanitizeValue:function(n){return n.replace(/\< /g,"<").replace(/\</g,"< ").replace(/\&\#/g,"& #")},IsAlphNumeric:function(n){return!/[^A-Za-z0-9]/.test(n)},IsNoSelection:function(n){return n!=="0"&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n)},IsNotZero:function(n){return n>0},IsNotEmpty:function(n){return n!==""},IsNotAvailable:function(n){return n!=="N/A"},IsNumber:function(n){return!isNaN(n)},IsWholeNumber:function(n){return/^\d+$/.test(n)},IsPrice:function(n){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(n)},IsISBN:function(n){return/^(979|978)\d{10}$/i.test(n)},IsPhoneNumber:function(n){return/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/i.test(n)},IsUSPhoneNumber:function(n){var t=n.replace(/["'()-]/g,"");return t=t.replace(/ /g,""),/^[0-9]{1,11}$/.test(+t)&&(t.length===10||t.length===11)},IsPhoneNumberByCountry:function(n,t){var i=!1;switch(t){case"us":i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(n)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n);break;case"ca":case"ant":case"bar":case"bah":case"angu":case"brv":case"cay":case"ber":case"gren":case"tc":case"mons":case"guam":case"stm":case"stl":case"domi":case"stv":case"pr":case"do":case"tri":case"stk":case"jam":i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumber(n);break;default:i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsInternationalPhoneNumber(n)}return i},IsInternationalPhoneNumber:function(n){return/^(\+)?[0-9\-().\s]{7,15}$/i.test(n)},IsNonUSCountry:function(n){var t=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.GetCountryCode(n);return t!=="us"},IsEmailAddress:function(n){return/^[^@\s]{1,}@[^@\s]{1,}\.[^@\s]{1,}$/i.test(n)},IsLuhnPass:function(t){var e=!0,u,i;if(/[^0-9-]+/.test(t))e=!1;else{var f=0,i=0,r=!1;for(t=t.replace(/\D/g,""),n=t.length-1;n>=0;n--)u=t.charAt(n),i=parseInt(u,10),r&&(i*=2)>9&&(i-=9),f+=i,r=!r;return f%10==0?!0:!1}},IsSSN:function(n){return/^(?!000)([0-9]\d{2}|7([0-9]\d|7[012]))([ -]?)(?!00)\d\d\3(?!0000)\d{4}$/i.test(n)},IsURL:function(n){return/^(https?):\/\/(((([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(n)},IsDate:function(n){return!/Invalid|NaN/.test(new Date(n))},IsValidDate:function(n){if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsDateMMDDYY(n))return!1;var t=n.split("/"),r=parseInt(t[2],10),u=parseInt(t[0],10)-1,f=parseInt(t[1],10),i=new Date(r,u,f);return i.getFullYear()===r&&i.getMonth()===u&&i.getDate()===f},IsDateMMDDYY:function(n){return/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$/i.test(n)}}};!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var r=n._,i=n._=t();i.noConflict=function(){return n._=r,i}}())}(this,function(){function u(n,t){return t=null==t?n.length-1:+t,function(){for(var u,f=Math.max(arguments.length-t,0),r=Array(f),i=0;i<f;i++)r[i]=arguments[i+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}for(u=Array(t+1),i=0;i<t;i++)u[i]=arguments[i];return u[t]=r,n.apply(this,u)}}function l(n){var t=typeof n;return"function"===t||"object"===t&&!!n}function lr(n){return void 0===n}function ar(n){return!0===n||!1===n||"[object Boolean]"===g.call(n)}function i(n){var t="[object "+n+"]";return function(n){return g.call(n)===t}}function c(n,t){return null!=n&&ue.call(n,t)}function dr(n){return vr(n)&&oe(n)}function gr(n){return function(){return n}}function nu(n){return function(t){var i=n(t);return"number"==typeof i&&i>=0&&i<=he}}function tu(n){return function(t){if(null!=t)return t[n]}}function ru(n,t){t=function(n){for(var t={},r=n.length,i=0;i<r;++i)t[n[i]]=!0;return{contains:function(n){return!0===t[n]},push:function(i){return t[i]=!0,n.push(i)}}}(t);var u=cr.length,f=n.constructor,e=r(f)&&f.prototype||pt,i="constructor";for(c(n,i)&&!t.contains(i)&&t.push(i);u--;)(i=cr[u])in n&&n[i]!==e[i]&&!t.contains(i)&&t.push(i)}function t(n){var t,i;if(!l(n))return[];if(er)return er(n);t=[];for(i in n)c(n,i)&&t.push(i);return hr&&ru(n,t),t}function uu(n,i){var e=t(i),o=e.length,f,r,u;if(null==n)return!o;for(f=Object(n),r=0;r<o;r++)if(u=e[r],i[u]!==f[u]||!(u in f))return!1;return!0}function n(t){return t instanceof n?t:this instanceof n?void(this._wrapped=t):new n(t)}function fu(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,st(n))}function dt(i,u,f,e){if(i===u)return 0!==i||1/i==1/u;if(null==i||null==u)return!1;if(i!=i)return u!=u;var o=typeof i;return("function"===o||"object"===o||"object"==typeof u)&&function i(u,f,e,o){var h,l,a,v,s,y,p;if(u instanceof n&&(u=u._wrapped),f instanceof n&&(f=f._wrapped),h=g.call(u),h!==g.call(f))return!1;if(kr&&"[object Object]"==h&&ft(u)){if(!ft(f))return!1;h=kt}switch(h){case"[object RegExp]":case"[object String]":return""+u==""+f;case"[object Number]":return+u!=+u?+f!=+f:0==+u?1/+u==1/f:+u==+f;case"[object Date]":case"[object Boolean]":return+u==+f;case"[object Symbol]":return ur.valueOf.call(u)===ur.valueOf.call(f);case"[object ArrayBuffer]":case kt:return i(fu(u),fu(f),e,o)}if(l="[object Array]"===h,!l&&iu(u)){if(st(u)!==st(f))return!1;if(u.buffer===f.buffer&&u.byteOffset===f.byteOffset)return!0;l=!0}if(!l&&("object"!=typeof u||"object"!=typeof f||(a=u.constructor,v=f.constructor,a!==v&&!(r(a)&&a instanceof a&&r(v)&&v instanceof v)&&"constructor"in u&&"constructor"in f)))return!1;for(o=o||[],s=(e=e||[]).length;s--;)if(e[s]===u)return o[s]===f;if(e.push(u),o.push(f),l){if((s=u.length)!==f.length)return!1;for(;s--;)if(!dt(u[s],f[s],e,o))return!1}else{if(p=t(u),s=p.length,t(f).length!==s)return!1;for(;s--;)if(y=p[s],!c(f,y)||!dt(u[y],f[y],e,o))return!1}return e.pop(),o.pop(),!0}(i,u,f,e)}function nt(n){var t,i;if(!l(n))return[];t=[];for(i in n)t.push(i);return hr&&ru(n,t),t}function gt(n){var t=f(n);return function(i){var e,u;if(null==i||(e=nt(i),f(e)))return!1;for(u=0;u<t;u++)if(!r(i[n[u]]))return!1;return n!==su||!r(i[ni])}}function w(n){for(var r=t(n),u=r.length,f=Array(u),i=0;i<u;i++)f[i]=n[r[i]];return f}function hu(n){for(var u={},r=t(n),i=0,f=r.length;i<f;i++)u[n[r[i]]]=r[i];return u}function ii(n){var i=[],t;for(t in n)r(n[t])&&i.push(t);return i.sort()}function ri(n,t){return function(i){var e=arguments.length,r,u;if(t&&(i=Object(i)),e<2||null==i)return i;for(r=1;r<e;r++)for(var o=arguments[r],s=n(o),h=s.length,f=0;f<h;f++)u=s[f],t&&void 0!==i[u]||(i[u]=o[u]);return i}}function au(n){var t,i;return l(n)?or?or(n):(t=function(){},t.prototype=n,i=new t,t.prototype=null,i):{}}function vu(n){return a(n)?n:[n]}function tt(t){return n.toPath(t)}function ui(n,t){for(var r=t.length,i=0;i<r;i++){if(null==n)return;n=n[t[i]]}if(r)return n}function yu(n,t,i){var r=ui(n,tt(t));return lr(r)?i:r}function fi(n){return n}function it(n){return n=ht({},n),function(t){return uu(t,n)}}function ei(n){return n=tt(n),function(t){return ui(t,n)}}function rt(n,t,i){if(void 0===t)return n;switch(null==i?3:i){case 1:return function(i){return n.call(t,i)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)}}return function(){return n.apply(t,arguments)}}function pu(n,t,i){return null==n?fi:r(n)?rt(n,t,i):l(n)&&!a(n)?it(n):ei(n)}function oi(n,t){return pu(n,t,1/0)}function e(t,i,r){return n.iteratee!==oi?n.iteratee(t,i):pu(t,i,r)}function wu(){}function si(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}function bu(n){var r=function(t){return n[t]},i="(?:"+t(n).join("|")+")",u=RegExp(i),f=RegExp(i,"g");return function(n){return n=null==n?"":""+n,u.test(n)?n.replace(f,r):n}}function oo(n){return"\\"+fo[n]}function nf(n,t,i,r,u){if(!(r instanceof t))return n.apply(i,u);var f=au(n.prototype),e=n.apply(f,u);return l(e)?e:f}function y(n,t,i,r){var u,h,c;if(r=r||[],t||0===t){if(t<=0)return r.concat(n)}else t=1/0;for(var e=r.length,s=0,l=f(n);s<l;s++)if(u=n[s],o(u)&&(a(u)||ot(u)))if(t>1)y(u,t-1,i,r),e=r.length;else for(h=0,c=u.length;h<c;)r[e++]=u[h++];else i||(r[e++]=u);return r}function li(n){return function(){return!n.apply(this,arguments)}}function rf(n,t){var i;return function(){return--n>0&&(i=t.apply(this,arguments)),n<=1&&(t=null),i}}function ff(n,i,r){i=e(i,r);for(var u,o=t(n),f=0,s=o.length;f<s;f++)if(i(n[u=o[f]],u,n))return u}function ef(n){return function(t,i,r){i=e(i,r);for(var o=f(t),u=n>0?0:o-1;u>=0&&u<o;u+=n)if(i(t[u],u,t))return u;return-1}}function of(n,t,i,r){for(var o,h=(i=e(i,r,1))(t),u=0,s=f(n);u<s;)o=Math.floor((u+s)/2),i(n[o])<h?u=o+1:s=o;return u}function sf(n,t,i){return function(r,u,e){var s=0,o=f(r);if("number"==typeof e)n>0?s=e>=0?e:Math.max(e+o,s):o=e>=0?Math.min(e+1,o):e+o+1;else if(i&&e&&o)return r[e=i(r,u)]===u?e:-1;if(u!=u)return(e=t(d.call(r,s,o),dr))>=0?e+s:-1;for(e=n>0?s:o-1;e>=0&&e<o;e+=n)if(r[e]===u)return e;return-1}}function yi(n,t,i){var r=(o(n)?ct:ff)(n,t,i);if(void 0!==r&&-1!==r)return n[r]}function s(n,i,r){var u,f,e;if(i=rt(i,r),o(n))for(u=0,f=n.length;u<f;u++)i(n[u],u,n);else for(e=t(n),u=0,f=e.length;u<f;u++)i(n[e[u]],e[u],n);return n}function p(n,i,r){var s;i=e(i,r);for(var f=!o(n)&&t(n),h=(f||n).length,c=Array(h),u=0;u<h;u++)s=f?f[u]:u,c[u]=i(n[s],s,n);return c}function cf(n){var i=function(i,r,u,f){var s=!o(i)&&t(i),c=(s||i).length,e=n>0?0:c-1,h;for(f||(u=i[s?s[e]:e],e+=n);e>=0&&e<c;e+=n)h=s?s[e]:e,u=r(u,i[h],h,i);return u};return function(n,t,r,u){var f=arguments.length>=3;return i(n,rt(t,u,4),r,f)}}function k(n,t,i){var r=[];return t=e(t,i),s(n,function(n,i,u){t(n,i,u)&&r.push(n)}),r}function lf(n,i,r){var s;i=e(i,r);for(var f=!o(n)&&t(n),h=(f||n).length,u=0;u<h;u++)if(s=f?f[u]:u,!i(n[s],s,n))return!1;return!0}function af(n,i,r){var s;i=e(i,r);for(var f=!o(n)&&t(n),h=(f||n).length,u=0;u<h;u++)if(s=f?f[u]:u,i(n[s],s,n))return!0;return!1}function h(n,t,i,r){return o(n)||(n=w(n)),("number"!=typeof i||r)&&(i=0),vi(n,t,i)>=0}function wi(n,t){return p(n,ei(t))}function yf(n,t,i){var f,h,r=-1/0,c=-1/0,u,l;if(null==t||"number"==typeof t&&"object"!=typeof n[0]&&null!=n)for(u=0,l=(n=o(n)?n:w(n)).length;u<l;u++)null!=(f=n[u])&&f>r&&(r=f);else t=e(t,i),s(n,function(n,i,u){((h=t(n,i,u))>c||h===-1/0&&r===-1/0)&&(r=n,c=h)});return r}function wf(n){return n?a(n)?d.call(n):wt(n)?n.match(pf):o(n)?p(n,fi):w(n):[]}function bf(n,t,i){var r,e,h,u,s,c;if(null==t||i)return o(n)||(n=w(n)),n[si(n.length-1)];for(r=wf(n),e=f(r),t=Math.max(Math.min(t,e),0),h=e-1,u=0;u<t;u++)s=si(u,h),c=r[u],r[u]=r[s],r[s]=c;return r.slice(0,t)}function at(n,t){return function(i,r,u){var f=t?[[],[]]:{};return r=e(r,u),s(i,function(t,u){var e=r(t,u,i);n(f,t,e)}),f}}function yo(n,t,i){return t in i}function df(n,t,i){return d.call(n,0,Math.max(0,n.length-(null==t||i?1:t)))}function ki(n,t,i){return null==n||n.length<1?null==t||i?void 0:[]:null==t||i?n[0]:df(n,n.length-t)}function vt(n,t,i){return d.call(n,null==t||i?1:t)}function gi(n,t,i,r){var u,c;ar(t)||(r=i,i=t,t=!1);null!=i&&(i=e(i,r));for(var o=[],l=[],s=0,a=f(n);s<a;s++)u=n[s],c=i?i(u,s,n):u,t&&!i?(s&&l===c||o.push(u),l=c):i?h(l,c)||(l.push(c),o.push(u)):h(o,u)||o.push(u);return o}function nr(n){for(var i=n&&yf(n,f).length||0,r=Array(i),t=0;t<i;t++)r[t]=wi(n,t);return r}function tr(t,i){return t._chain?n(i).chain():i}function ie(t){return s(ii(t),function(i){var r=n[i]=t[i];n.prototype[i]=function(){var t=[this._wrapped];return re.apply(t,arguments),tr(this,r.apply(n,t))}}),n}var ir="1.13.4",rr="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},ut=Array.prototype,pt=Object.prototype,ur="undefined"!=typeof Symbol?Symbol.prototype:null,re=ut.push,d=ut.slice,g=pt.toString,ue=pt.hasOwnProperty,fr="undefined"!=typeof ArrayBuffer,fe="undefined"!=typeof DataView,ee=Array.isArray,er=Object.keys,or=Object.create,sr=fr&&ArrayBuffer.isView,oe=isNaN,se=isFinite,hr=!{toString:null}.propertyIsEnumerable("toString"),cr=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],he=Math.pow(2,53)-1,wt=i("String"),vr=i("Number"),ce=i("Date"),le=i("RegExp"),ae=i("Error"),yr=i("Symbol"),pr=i("ArrayBuffer"),wr=i("Function"),ve=rr.document&&rr.document.childNodes,et,ot,kt,b,du,gu,v,ci,o,uf,ct,ai,vi,hf,lt,pi,vf,pf,bi,kf,di,gf,ne,te,yt;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof ve&&(wr=function(n){return"function"==typeof n||!1});var r=wr,br=i("Object"),kr=fe&&br(new DataView(new ArrayBuffer(8))),bt="undefined"!=typeof Map&&br(new Map),ye=i("DataView"),ft=kr?function(n){return null!=n&&r(n.getInt8)&&pr(n.buffer)}:ye,a=ee||i("Array");et=i("Arguments");!function(){et(arguments)||(et=function(n){return c(n,"callee")})}();ot=et;var st=tu("byteLength"),pe=nu(st),we=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,iu=fr?function(n){return sr?sr(n)&&!ft(n):pe(n)&&we.test(g.call(n))}:gr(!1),f=tu("length");n.VERSION=ir;n.prototype.value=function(){return this._wrapped};n.prototype.valueOf=n.prototype.toJSON=n.prototype.value;n.prototype.toString=function(){return String(this._wrapped)};kt="[object DataView]";var ni="forEach",eu="has",ti=["clear","delete"],ou=["get",eu,"set"],be=ti.concat(ni,ou),su=ti.concat(ou),ke=["add"].concat(ti,ni,eu),de=bt?gt(be):i("Map"),ge=bt?gt(su):i("WeakMap"),no=bt?gt(ke):i("Set"),to=i("WeakSet");var cu=ri(nt),ht=ri(t),lu=ri(nt,!0);n.toPath=vu;n.iteratee=oi;b=Date.now||function(){return(new Date).getTime()};var ku={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},io=bu(ku),ro=bu(hu(ku)),uo=n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},hi=/(.)^/,fo={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},eo=/\\|'|\r|\n|\u2028|\u2029/g;du=/^\s*(\w|\$)+\s*$/;gu=0;v=u(function(n,t){var r=v.placeholder,i=function(){for(var f=0,o=t.length,e=Array(o),u=0;u<o;u++)e[u]=t[u]===r?arguments[f++]:t[u];for(;f<arguments.length;)e.push(arguments[f++]);return nf(n,i,this,this,e)};return i});v.placeholder=n;ci=u(function(n,t,i){if(!r(n))throw new TypeError("Bind must be called on a function");var f=u(function(r){return nf(n,f,t,this,i.concat(r))});return f});o=nu(f);var so=u(function(n,t){var i=(t=y(t,!1,!1)).length,r;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;)r=t[i],n[r]=ci(n[r],n);return n}),tf=u(function(n,t,i){return setTimeout(function(){return n.apply(null,i)},t)}),ho=v(tf,n,1);uf=v(rf,2);ct=ef(1);ai=ef(-1);vi=sf(1,ct,of);hf=sf(-1,ai);lt=cf(1);pi=cf(-1);vf=u(function(n,t,i){var u,f;return r(t)?f=t:(t=tt(t),u=t.slice(0,-1),t=t[t.length-1]),p(n,function(n){var r=f;if(!r){if(u&&u.length&&(n=ui(n,u)),null==n)return;r=n[t]}return null==r?r:r.apply(n,i)})});pf=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;var co=at(function(n,t,i){c(n,i)?n[i].push(t):n[i]=[t]}),lo=at(function(n,t,i){n[i]=t}),ao=at(function(n,t,i){c(n,i)?n[i]++:n[i]=1}),vo=at(function(n,t,i){n[i?0:1].push(t)},!0);return bi=u(function(n,t){var e={},i=t[0],u,s,f,o;if(null==n)return e;for(r(i)?(t.length>1&&(i=rt(i,t[1])),t=nt(n)):(i=yo,t=y(t,!1,!1),n=Object(n)),u=0,s=t.length;u<s;u++)f=t[u],o=n[f],i(o,f,n)&&(e[f]=o);return e}),kf=u(function(n,t){var u,i=t[0];return r(i)?(i=li(i),t.length>1&&(u=t[1])):(t=p(y(t,!1,!1),String),i=function(n,i){return!h(t,i)}),bi(n,i,u)}),di=u(function(n,t){return t=y(t,!0,!0),k(n,function(n){return!h(t,n)})}),gf=u(function(n,t){return di(n,t)}),ne=u(function(n){return gi(y(n,!0,!0))}),te=u(nr),s(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var i=ut[t];n.prototype[t]=function(){var n=this._wrapped;return null!=n&&(i.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),tr(this,n)}}),s(["concat","join","slice"],function(t){var i=ut[t];n.prototype[t]=function(){var n=this._wrapped;return null!=n&&(n=i.apply(n,arguments)),tr(this,n)}}),yt=ie({__proto__:null,VERSION:ir,restArguments:u,isObject:l,isNull:function(n){return null===n},isUndefined:lr,isBoolean:ar,isElement:function(n){return!(!n||1!==n.nodeType)},isString:wt,isNumber:vr,isDate:ce,isRegExp:le,isError:ae,isSymbol:yr,isArrayBuffer:pr,isDataView:ft,isArray:a,isFunction:r,isArguments:ot,isFinite:function(n){return!yr(n)&&se(n)&&!isNaN(parseFloat(n))},isNaN:dr,isTypedArray:iu,isEmpty:function(n){if(null==n)return!0;var i=f(n);return"number"==typeof i&&(a(n)||wt(n)||ot(n))?0===i:0===f(t(n))},isMatch:uu,isEqual:function(n,t){return dt(n,t)},isMap:de,isWeakMap:ge,isSet:no,isWeakSet:to,keys:t,allKeys:nt,values:w,pairs:function(n){for(var r=t(n),u=r.length,f=Array(u),i=0;i<u;i++)f[i]=[r[i],n[r[i]]];return f},invert:hu,functions:ii,methods:ii,extend:cu,extendOwn:ht,assign:ht,defaults:lu,create:function(n,t){var i=au(n);return t&&ht(i,t),i},clone:function(n){return l(n)?a(n)?n.slice():cu({},n):n},tap:function(n,t){return t(n),n},get:yu,has:function(n,t){for(var u,r=(t=tt(t)).length,i=0;i<r;i++){if(u=t[i],!c(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,i,r){var u;i=e(i,r);for(var o=t(n),h=o.length,s={},f=0;f<h;f++)u=o[f],s[u]=i(n[u],u,n);return s},identity:fi,constant:gr,noop:wu,toPath:vu,property:ei,propertyOf:function(n){return null==n?wu:function(t){return yu(n,t)}},matcher:it,matches:it,times:function(n,t,i){var u=Array(Math.max(0,n)),r;for(t=rt(t,i,1),r=0;r<n;r++)u[r]=t(r);return u},random:si,now:b,escape:io,unescape:ro,templateSettings:uo,template:function(t,i,r){var s,f,e;!i&&r&&(i=r);i=lu({},i,n.templateSettings);var h=RegExp([(i.escape||hi).source,(i.interpolate||hi).source,(i.evaluate||hi).source].join("|")+"|$","g"),o=0,u="__p+='";if(t.replace(h,function(n,i,r,f,e){return u+=t.slice(o,e).replace(eo,oo),o=e+n.length,i?u+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":f&&(u+="';\n"+f+"\n__p+='"),n}),u+="';\n",f=i.variable,f){if(!du.test(f))throw new Error("variable is not a bare identifier: "+f);}else u="with(obj||{}){\n"+u+"}\n",f="obj";u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{s=new Function(f,"_",u)}catch(t){throw t.source=u,t;}return e=function(t){return s.call(this,t,n)},e.source="function("+f+"){\n"+u+"}",e},result:function(n,t,i){var e=(t=tt(t)).length,f,u;if(!e)return r(i)?i.call(n):i;for(f=0;f<e;f++)u=null==n?void 0:n[t[f]],void 0===u&&(u=i,f=e),n=r(u)?u.call(n):u;return n},uniqueId:function(n){var t=++gu+"";return n?n+t:t},chain:function(t){var i=n(t);return i._chain=!0,i},iteratee:oi,partial:v,bind:ci,bindAll:so,memoize:function(n,t){var i=function(r){var u=i.cache,f=""+(t?t.apply(this,arguments):r);return c(u,f)||(u[f]=n.apply(this,arguments)),u[f]};return i.cache={},i},delay:tf,defer:ho,throttle:function(n,t,i){var r,u,f,o,e=0,h,s;return i||(i={}),h=function(){e=!1===i.leading?0:b();r=null;o=n.apply(u,f);r||(u=f=null)},s=function(){var c=b(),s;return e||!1!==i.leading||(e=c),s=t-(c-e),u=this,f=arguments,s<=0||s>t?(r&&(clearTimeout(r),r=null),e=c,o=n.apply(u,f),r||(u=f=null)):r||!1===i.trailing||(r=setTimeout(h,s)),o},s.cancel=function(){clearTimeout(r);e=0;r=u=f=null},s},debounce:function(n,t,i){var r,s,f,o,e,h=function(){var u=b()-s;t>u?r=setTimeout(h,t-u):(r=null,i||(o=n.apply(e,f)),r||(f=e=null))},c=u(function(u){return e=this,f=u,s=b(),r||(r=setTimeout(h,t),i&&(o=n.apply(e,f))),o});return c.cancel=function(){clearTimeout(r);r=f=e=null},c},wrap:function(n,t){return v(t,n)},negate:li,compose:function(){var n=arguments,t=n.length-1;return function(){for(var r=t,i=n[t].apply(this,arguments);r--;)i=n[r].call(this,i);return i}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:rf,once:uf,findKey:ff,findIndex:ct,findLastIndex:ai,sortedIndex:of,indexOf:vi,lastIndexOf:hf,find:yi,detect:yi,findWhere:function(n,t){return yi(n,it(t))},each:s,forEach:s,map:p,collect:p,reduce:lt,foldl:lt,inject:lt,reduceRight:pi,foldr:pi,filter:k,select:k,reject:function(n,t,i){return k(n,li(e(t)),i)},every:lf,all:lf,some:af,any:af,contains:h,includes:h,include:h,invoke:vf,pluck:wi,where:function(n,t){return k(n,it(t))},max:yf,min:function(n,t,i){var f,h,r=1/0,c=1/0,u,l;if(null==t||"number"==typeof t&&"object"!=typeof n[0]&&null!=n)for(u=0,l=(n=o(n)?n:w(n)).length;u<l;u++)null!=(f=n[u])&&f<r&&(r=f);else t=e(t,i),s(n,function(n,i,u){((h=t(n,i,u))<c||h===1/0&&r===1/0)&&(r=n,c=h)});return r},shuffle:function(n){return bf(n,1/0)},sample:bf,sortBy:function(n,t,i){var r=0;return t=e(t,i),wi(p(n,function(n,i,u){return{value:n,index:r++,criteria:t(n,i,u)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(i>r||void 0===i)return 1;if(i<r||void 0===r)return-1}return n.index-t.index}),"value")},groupBy:co,indexBy:lo,countBy:ao,partition:vo,toArray:wf,size:function(n){return null==n?0:o(n)?n.length:t(n).length},pick:bi,omit:kf,first:ki,head:ki,take:ki,initial:df,last:function(n,t,i){return null==n||n.length<1?null==t||i?void 0:[]:null==t||i?n[n.length-1]:vt(n,Math.max(0,n.length-t))},rest:vt,tail:vt,drop:vt,compact:function(n){return k(n,Boolean)},flatten:function(n,t){return y(n,t,!1)},without:gf,uniq:gi,unique:gi,union:ne,intersection:function(n){for(var i,t,r=[],e=arguments.length,u=0,o=f(n);u<o;u++)if(i=n[u],!h(r,i)){for(t=1;t<e&&h(arguments[t],i);t++);t===e&&r.push(i)}return r},difference:di,unzip:nr,transpose:nr,zip:te,object:function(n,t){for(var r={},i=0,u=f(n);i<u;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r},range:function(n,t,i){null==t&&(t=n||0,n=0);i||(i=t<n?-1:1);for(var u=Math.max(Math.ceil((t-n)/i),0),f=Array(u),r=0;r<u;r++,n+=i)f[r]=n;return f},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],i=0,u=n.length;i<u;)r.push(d.call(n,i,i+=t));return r},mixin:ie,"default":n}),yt._=yt,yt});XDate=function(n,t,i,r){function f(){var r=this instanceof f?this:new f,i=arguments,t=i.length,e,u;if(typeof i[t-1]=="boolean"&&(e=i[--t],i=w(i,0,t)),t)if(t==1){if(t=i[0],t instanceof n||typeof t=="number")r[0]=new n(+t);else if(t instanceof f)i=r,u=new n(+t[0]),s(t)&&(u.toString=g),i[0]=u;else if(typeof t=="string"){r[0]=new n(0);n:{for(var i=t,t=e||!1,u=f.parsers,o=0,c;o<u.length;o++)if(c=u[o](i,t,r)){r=c;break n}r[0]=new n(i)}}}else r[0]=new n(h.apply(n,i)),e||(r[0]=p(r[0]));else r[0]=new n;return typeof e=="boolean"&&nt(r,e),r}function s(n){return n[0].toString===g}function nt(t,i,r){return i?s(t)||(r&&(t[0]=new n(h(t[0].getFullYear(),t[0].getMonth(),t[0].getDate(),t[0].getHours(),t[0].getMinutes(),t[0].getSeconds(),t[0].getMilliseconds()))),t[0].toString=g):s(t)&&(t[0]=r?p(t[0]):new n(+t[0])),t}function tt(n,t,i,r,u){var f=c(o,n[0],u),n=c(ot,n[0],u),u=!1;r.length==2&&typeof r[1]=="boolean"&&(u=r[1],r=[i]);i=t==1?(i%12+12)%12:f(1);n(t,r);u&&f(1)!=i&&(n(1,[f(1)-1]),n(2,[st(f(0),f(1))]))}function it(n,i,r,u){var r=Number(r),f=t.floor(r);n["set"+l[i]](n["get"+l[i]]()+f,u||!1);f!=r&&i<6&&it(n,i+1,(r-f)*lt[i],u)}function rt(n,i,r){var n=n.clone().setUTCMode(!0,!0),i=f(i).setUTCMode(!0,!0),u=0,e;if(r==0||r==1){for(e=6;e>=r;e--)u/=lt[e],u+=o(i,!1,e)-o(n,!1,e);r==1&&(u+=(i.getFullYear()-n.getFullYear())*12)}else r==2?(r=n.toDate().setUTCHours(0,0,0,0),u=i.toDate().setUTCHours(0,0,0,0),u=t.round((u-r)/864e5)+(i-u-(n-r))/864e5):u=(i-n)/[36e5,6e4,1e3,1][r-3];return u}function a(i){var r=i(0),u=i(1),f=i(2),i=new n(h(r,u,f)),r=v(ut(r,u,f));return t.floor(t.round((i-r)/864e5)/7)+1}function ut(t,i,r){return(i=new n(h(t,i,r)),i<v(t))?t-1:i>=v(t+1)?t+1:t}function v(t){return t=new n(h(t,0,4)),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+6)%7),t}function ft(n,t,i,u){var f=c(o,n,u),e=c(ot,n,u);i===r&&(i=ut(f(0),f(1),f(2)));i=v(i);u||(i=p(i));n.setTime(+i);e(2,[f(2)+(t-1)*7])}function et(n,t,i,r,u){var e=f.locales,h=e[f.defaultLocale]||{},s=c(o,n,u),i=(typeof i=="string"?e[i]:i)||{};return b(n,t,function(n){if(r)for(var t=(n==7?2:n)-1;t>=0;t--)r.push(s(t));return s(n)},function(n){return i[n]||h[n]},u)}function b(n,t,i,u,f){for(var e,h,o="";e=t.match(vt);){if(o+=t.substr(0,e.index),e[1]){h=o;for(var o=n,s=e[1],v=i,y=u,p=f,c=s.length,l=void 0,a="";c>0;)l=at(o,s.substr(0,c),v,y,p),l!==r?(a+=l,s=s.substr(c),c=s.length):c--;o=h+(a+s)}else e[3]?(h=b(n,e[4],i,u,f),parseInt(h.replace(/\D/g,""),10)&&(o+=h)):o+=e[7]||"'";t=t.substr(e.index+e[0].length)}return o+t}function at(n,i,r,u,o){var s=f.formatters[i];if(typeof s=="string")return b(n,s,r,u,o);if(typeof s=="function")return s(n,o||!1,u);switch(i){case"fff":return e(r(6),3);case"s":return r(5);case"ss":return e(r(5));case"m":return r(4);case"mm":return e(r(4));case"h":return r(3)%12||12;case"hh":return e(r(3)%12||12);case"H":return r(3);case"HH":return e(r(3));case"d":return r(2);case"dd":return e(r(2));case"ddd":return u("dayNamesShort")[r(7)]||"";case"dddd":return u("dayNames")[r(7)]||"";case"M":return r(1)+1;case"MM":return e(r(1)+1);case"MMM":return u("monthNamesShort")[r(1)]||"";case"MMMM":return u("monthNames")[r(1)]||"";case"yy":return(r(0)+"").substring(2);case"yyyy":return r(0);case"t":return y(r,u).substr(0,1).toLowerCase();case"tt":return y(r,u).toLowerCase();case"T":return y(r,u).substr(0,1);case"TT":return y(r,u);case"z":case"zz":case"zzz":return o?i="Z":(u=n.getTimezoneOffset(),n=u<0?"+":"-",r=t.floor(t.abs(u)/60),u=t.abs(u)%60,o=r,i=="zz"?o=e(r):i=="zzz"&&(o=e(r)+":"+e(u)),i=n+o),i;case"w":return a(r);case"ww":return e(a(r));case"S":return i=r(2),i>10&&i<20?"th":["st","nd","rd"][i%10-1]||"th"}}function y(n,t){return n(3)<12?t("amDesignator"):t("pmDesignator")}function k(n){return!isNaN(+n[0])}function o(n,t,i){return n["get"+(t?"UTC":"")+l[i]]()}function ot(n,t,i,r){n["set"+(t?"UTC":"")+l[i]].apply(n,r)}function p(t){return new n(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}function st(t,i){return 32-new n(h(t,i,32)).getUTCDate()}function d(n){return function(){return n.apply(r,[this].concat(w(arguments)))}}function c(n){var t=w(arguments,1);return function(){return n.apply(r,t.concat(w(arguments)))}}function w(n,t,u){return i.prototype.slice.call(n,t||0,u===r?n.length:u)}function ht(n,t){for(var i=0;i<n.length;i++)t(n[i],i)}function e(n,t){for(t=t||2,n+="";n.length<t;)n="0"+n;return n}var l="FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds,Day,Year".split(","),ct=["Years","Months","Days"],lt=[12,31,24,60,60,1e3,1],vt=/(([a-zA-Z])\2*)|(\((('.*?'|\(.*?\)|.)*?)\))|('(.*?)')/,h=n.UTC,g=n.prototype.toUTCString,u=f.prototype;return u.length=1,u.splice=i.prototype.splice,u.getUTCMode=d(s),u.setUTCMode=d(nt),u.getTimezoneOffset=function(){return s(this)?0:this[0].getTimezoneOffset()},ht(l,function(n,t){u["get"+n]=function(){return o(this[0],s(this),t)};t!=8&&(u["getUTC"+n]=function(){return o(this[0],!0,t)});t!=7&&(u["set"+n]=function(n){return tt(this,t,n,arguments,s(this)),this},t!=8&&(u["setUTC"+n]=function(n){return tt(this,t,n,arguments,!0),this},u["add"+(ct[t]||n)]=function(n,i){return it(this,t,n,i),this},u["diff"+(ct[t]||n)]=function(n){return rt(this,n,t)}))}),u.getWeek=function(){return a(c(o,this,!1))},u.getUTCWeek=function(){return a(c(o,this,!0))},u.setWeek=function(n,t){return ft(this,n,t,!1),this},u.setUTCWeek=function(n,t){return ft(this,n,t,!0),this},u.addWeeks=function(n){return this.addDays(Number(n)*7)},u.diffWeeks=function(n){return rt(this,n,2)/7},f.parsers=[function(t,i,r){if(t=t.match(/^(\d{4})(-(\d{2})(-(\d{2})([T ](\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/)){var u=new n(h(t[1],t[3]?t[3]-1:0,t[5]||1,t[7]||0,t[8]||0,t[10]||0,t[12]?Number("0."+t[12])*1e3:0));return t[13]?t[14]&&u.setUTCMinutes(u.getUTCMinutes()+(t[15]=="-"?1:-1)*(Number(t[16])*60+(t[18]?Number(t[18]):0))):i||(u=p(u)),r.setTime(+u)}}],f.parse=function(n){return+f(""+n)},u.toString=function(n,t,i){return n===r||!k(this)?this[0].toString():et(this,n,t,i,s(this))},u.toUTCString=u.toGMTString=function(n,t,i){return n===r||!k(this)?this[0].toUTCString():et(this,n,t,i,!0)},u.toISOString=function(){return this.toUTCString("yyyy-MM-dd'T'HH:mm:ss(.fff)zzz")},f.defaultLocale="",f.locales={"":{monthNames:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthNamesShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),dayNamesShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),amDesignator:"AM",pmDesignator:"PM"}},f.formatters={i:"yyyy-MM-dd'T'HH:mm:ss(.fff)",u:"yyyy-MM-dd'T'HH:mm:ss(.fff)zzz"},ht("getTime,valueOf,toDateString,toTimeString,toLocaleString,toLocaleDateString,toLocaleTimeString,toJSON".split(","),function(n){u[n]=function(){return this[0][n]()}}),u.setTime=function(n){return this[0].setTime(n),this},u.valid=d(k),u.clone=function(){return new f(this)},u.clearTime=function(){return this.setHours(0,0,0,0)},u.toDate=function(){return new n(+this[0])},f.now=function(){return+new n},f.today=function(){return(new f).clearTime()},f.UTC=h,f.getDaysInMonth=st,typeof module!="undefined"&&module.exports&&(module.exports=f),typeof define=="function"&&define.amd&&define([],function(){return f}),f}(Date,Math,Array);!function(n){function t(n,t){if(!(n.originalEvent.touches.length>1)){n.preventDefault();var i=n.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null);n.target.dispatchEvent(r)}}if(n.support.touch="ontouchend"in document,n.support.touch){var r,i=n.ui.mouse.prototype,u=i._mouseInit,f=i._mouseDestroy;i._touchStart=function(n){var i=this;!r&&i._mouseCapture(n.originalEvent.changedTouches[0])&&(r=!0,i._touchMoved=!1,t(n,"mouseover"),t(n,"mousemove"),t(n,"mousedown"))};i._touchMove=function(n){r&&(this._touchMoved=!0,t(n,"mousemove"))};i._touchEnd=function(n){r&&(t(n,"mouseup"),t(n,"mouseout"),this._touchMoved||t(n,"click"),r=!1)};i._mouseInit=function(){var t=this;t.element.bind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")});u.call(t)};i._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")});f.call(t)}}}(jQuery),function(n){typeof define=="function"&&define.amd?define(["jquery"],function(t){return n(t)}):typeof module=="object"&&typeof module.exports=="object"?exports=n(require("jquery")):n(jQuery)}(function(n){function o(n){var i=7.5625,t=2.75;return n<1/t?i*n*n:n<2/t?i*(n-=1.5/t)*n+.75:n<2.5/t?i*(n-=2.25/t)*n+.9375:i*(n-=2.625/t)*n+.984375}n.easing.jswing=n.easing.swing;var t=Math.pow,u=Math.sqrt,i=Math.sin,s=Math.cos,r=Math.PI,f=1.70158,e=f*1.525,h=f+1,c=2*r/3,l=2*r/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(t){return n.easing[n.easing.def](t)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-s(n*r/2)},easeOutSine:function(n){return i(n*r/2)},easeInOutSine:function(n){return-(s(r*n)-1)/2},easeInExpo:function(n){return n===0?0:t(2,10*n-10)},easeOutExpo:function(n){return n===1?1:1-t(2,-10*n)},easeInOutExpo:function(n){return n===0?0:n===1?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return n===0?0:n===1?1:-t(2,10*n-10)*i((n*10-10.75)*c)},easeOutElastic:function(n){return n===0?0:n===1?1:t(2,-10*n)*i((n*10-.75)*c)+1},easeInOutElastic:function(n){return n===0?0:n===1?1:n<.5?-(t(2,20*n-10)*i((20*n-11.125)*l))/2:t(2,-20*n+10)*i((20*n-11.125)*l)/2+1},easeInBack:function(n){return h*n*n*n-f*n*n},easeOutBack:function(n){return 1+h*t(n-1,3)+f*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*((e+1)*2*n-e)/2:(t(2*n-2,2)*((e+1)*(n*2-2)+e)+2)/2},easeInBounce:function(n){return 1-o(1-n)},easeOutBounce:o,easeInOutBounce:function(n){return n<.5?(1-o(1-2*n))/2:(1+o(2*n-1))/2}})}),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof module!="undefined"&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";function r(t){return!t.nodeName||n.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!==-1}function u(n){return typeof n=="function"}function i(t){return u(t)||n.isPlainObject(t)?t:{top:t,left:t}}var t=n.scrollTo=function(t,i,r){return n(window).scrollTo(t,i,r)};return t.defaults={axis:"xy",duration:0,limit:!0},n.fn.scrollTo=function(f,e,o){typeof e=="object"&&(o=e,e=0);typeof o=="function"&&(o={onAfter:o});f==="max"&&(f=9e9);o=n.extend({},t.defaults,o);e=e||o.duration;var s=o.queue&&o.axis.length>1;return s&&(e/=2),o.offset=i(o.offset),o.over=i(o.over),this.each(function(){function w(t){var i=n.extend({},o,{queue:!0,duration:e,complete:t&&function(){t.call(l,h,o)}});v.animate(c,i)}var p;if(f!==null){var a=r(this),l=a?this.contentWindow||window:this,v=n(l),h=f,c={},y;switch(typeof h){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(h)){h=i(h);break}h=a?n(h):n(h,l);case"object":if(h.length===0)return;(h.is||h.style)&&(y=(h=n(h)).offset())}p=u(o.offset)&&o.offset(l,h)||o.offset;n.each(o.axis.split(""),function(n,i){var e=i==="x"?"Left":"Top",u=e.toLowerCase(),r="scroll"+e,b=v[r](),k=t.max(l,i),f;y?(c[r]=y[u]+(a?0:b-v.offset()[u]),o.margin&&(c[r]-=parseInt(h.css("margin"+e),10)||0,c[r]-=parseInt(h.css("border"+e+"Width"),10)||0),c[r]+=p[u]||0,o.over[u]&&(c[r]+=h[i==="x"?"width":"height"]()*o.over[u])):(f=h[u],c[r]=f.slice&&f.slice(-1)==="%"?parseFloat(f)/100*k:f);o.limit&&/^\d+$/.test(c[r])&&(c[r]=c[r]<=0?0:Math.min(c[r],k));!n&&o.axis.length>1&&(b===c[r]?c={}:s&&(w(o.onAfterFirst),c={}))});w(o.onAfter)}})},t.max=function(t,i){var u=i==="x"?"Width":"Height",f="scroll"+u;if(!r(t))return t[f]-n(t)[u.toLowerCase()]();var e="client"+u,o=t.ownerDocument||t.document,s=o.documentElement,h=o.body;return Math.max(s[f],h[f])-Math.min(s[e],h[e])},n.Tween.propHooks.scrollLeft=n.Tween.propHooks.scrollTop={get:function(t){return n(t.elem)[t.prop]()},set:function(t){var r=this.get(t),i;if(t.options.interrupt&&t._last&&t._last!==r)return n(t.elem).stop();i=Math.round(t.now);r!==i&&(n(t.elem)[t.prop](i),t._last=this.get(t))}},t}),function(n){"use strict";var o=function(n,t){typeof t=="undefined"&&(t={});this.init(n,t)},t=o.prototype,f,e=["canvas","vml"],i=["oval","spiral","square","rect","roundRect"],v=/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,c=navigator.appVersion.indexOf("MSIE")!==-1&&parseFloat(navigator.appVersion.split("MSIE")[1])===8?!0:!1,y=!!document.createElement("canvas").getContext,l=40,a=!0,u=function(n,t,i){var r=document.createElement(n),u;for(u in i)r[u]=i[u];return t!=null&&typeof t!="undefined"&&t.appendChild(r),r},r=function(n,t){for(var i in t)n.style[i]=t[i];return n},s=function(n,t){for(var i in t)n.setAttribute(i,t[i]);return n},h=function(n,t,i,r){n.save();n.translate(t,i);n.rotate(r);n.translate(-t,-i);n.beginPath()};t.init=function(n,t){var s,i;typeof t.safeVML=="boolean"&&(a=t.safeVML);try{this.mum=document.getElementById(n)!==undefined?document.getElementById(n):document.body}catch(h){this.mum=document.body}if(t.id=typeof t.id!="undefined"?t.id:"canvasLoader",this.cont=u("div",this.mum,{id:t.id}),y)f=e[0],this.can=u("canvas",this.cont),this.con=this.can.getContext("2d"),this.cCan=r(u("canvas",this.cont),{display:"none"}),this.cCon=this.cCan.getContext("2d");else{if(f=e[1],typeof o.vmlSheet=="undefined")for(document.getElementsByTagName("head")[0].appendChild(u("style")),o.vmlSheet=document.styleSheets[document.styleSheets.length-1],s=["group","oval","roundrect","fill"],i=0;i<s.length;++i)o.vmlSheet.addRule(s[i],"behavior:url(#default#VML); position:absolute;");this.vml=u("group",this.cont)}this.setColor(this.color);this.draw();r(this.cont,{display:"none"})};t.cont={};t.can={};t.con={};t.cCan={};t.cCon={};t.timer={};t.activeId=0;t.diameter=40;t.setDiameter=function(n){this.diameter=Math.round(Math.abs(n));this.redraw()};t.getDiameter=function(){return this.diameter};t.cRGB={};t.color="#000000";t.setColor=function(n){this.color=v.test(n)?n:"#000000";this.cRGB=this.getRGB(this.color);this.redraw()};t.getColor=function(){return this.color};t.shape=i[0];t.setShape=function(n){var t;for(t in i)if(n===i[t]){this.shape=n;this.redraw();break}};t.getShape=function(){return this.shape};t.density=40;t.setDensity=function(n){this.density=a&&f===e[1]?Math.round(Math.abs(n))<=l?Math.round(Math.abs(n)):l:Math.round(Math.abs(n));this.density>360&&(this.density=360);this.activeId=0;this.redraw()};t.getDensity=function(){return this.density};t.range=1.3;t.setRange=function(n){this.range=Math.abs(n);this.redraw()};t.getRange=function(){return this.range};t.speed=2;t.setSpeed=function(n){this.speed=Math.round(Math.abs(n))};t.getSpeed=function(){return this.speed};t.fps=24;t.setFPS=function(n){this.fps=Math.round(Math.abs(n));this.reset()};t.getFPS=function(){return this.fps};t.getRGB=function(n){return n=n.charAt(0)==="#"?n.substring(1,7):n,{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16)}};t.draw=function(){var w=0,a,p,n,o,l,tt,d,b,nt=this.density,it=Math.round(nt*this.range),k,rt=0,ft,et,ut,st,y=1e3,ot=0,v=this.cCon,t=this.diameter,g=.47;if(f===e[0])for(v.clearRect(0,0,y,y),s(this.can,{width:t,height:t}),s(this.cCan,{width:t,height:t});w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;d=tt/180*Math.PI;v.fillStyle="rgba("+this.cRGB.r+","+this.cRGB.g+","+this.cRGB.b+","+k.toString()+")";switch(this.shape){case i[0]:case i[1]:a=t*.07;o=t*g+Math.cos(d)*(t*g-a)-t*g;l=t*g+Math.sin(d)*(t*g-a)-t*g;v.beginPath();this.shape===i[1]?v.arc(t*.5+o,t*.5+l,a*k,0,Math.PI*2,!1):v.arc(t*.5+o,t*.5+l,a,0,Math.PI*2,!1);break;case i[2]:a=t*.12;o=Math.cos(d)*(t*g-a)+t*.5;l=Math.sin(d)*(t*g-a)+t*.5;h(v,o,l,d);v.fillRect(o,l-a*.5,a,a);break;case i[3]:case i[4]:p=t*.3;n=p*.27;o=Math.cos(d)*(n+(t-n)*.13)+t*.5;l=Math.sin(d)*(n+(t-n)*.13)+t*.5;h(v,o,l,d);this.shape===i[3]?v.fillRect(o,l-n*.5,p,n):(b=n*.55,v.moveTo(o+b,l-n*.5),v.lineTo(o+p-b,l-n*.5),v.quadraticCurveTo(o+p,l-n*.5,o+p,l-n*.5+b),v.lineTo(o+p,l-n*.5+n-b),v.quadraticCurveTo(o+p,l-n*.5+n,o+p-b,l-n*.5+n),v.lineTo(o+b,l-n*.5+n),v.quadraticCurveTo(o,l-n*.5+n,o,l-n*.5+n-b),v.lineTo(o,l-n*.5+b),v.quadraticCurveTo(o,l-n*.5,o+b,l-n*.5))}v.closePath();v.fill();v.restore();++w}else{r(this.cont,{width:t,height:t});r(this.vml,{width:t,height:t});switch(this.shape){case i[0]:case i[1]:ut="oval";a=y*.14;break;case i[2]:ut="roundrect";a=y*.12;break;case i[3]:case i[4]:ut="roundrect";a=y*.3}for(p=n=a,o=y*.5-n,l=-n*.5;w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;switch(this.shape){case i[1]:p=n=a*k;o=y*.5-a*.5-a*k*.5;l=(a-a*k)*.5;break;case i[0]:case i[2]:c&&(l=0,this.shape===i[2]&&(o=y*.5-n*.5));break;case i[3]:case i[4]:p=a*.95;n=p*.28;c?(o=0,l=y*.5-n*.5):(o=y*.5-p,l=-n*.5);ot=this.shape===i[4]?.6:0}et=s(r(u("group",this.vml),{width:y,height:y,rotation:tt}),{coordsize:y+","+y,coordorigin:-y*.5+","+-y*.5});ft=r(u(ut,et,{stroked:!1,arcSize:ot}),{width:p,height:n,top:l,left:o});st=u("fill",ft,{color:this.color,opacity:k});++w}}this.tick(!0)};t.clean=function(){if(f===e[0])this.con.clearRect(0,0,1e3,1e3);else{var n=this.vml;if(n.hasChildNodes())while(n.childNodes.length>=1)n.removeChild(n.firstChild)}};t.redraw=function(){this.clean();this.draw()};t.reset=function(){typeof this.timer=="number"&&(this.hide(),this.show())};t.tick=function(n){var i=this.con,t=this.diameter;n||(this.activeId+=360/this.density*this.speed);f===e[0]?(i.clearRect(0,0,t,t),h(i,t*.5,t*.5,this.activeId/180*Math.PI),i.drawImage(this.cCan,0,0,t,t),i.restore()):(this.activeId>=360&&(this.activeId-=360),r(this.vml,{rotation:this.activeId}))};t.show=function(){if(typeof this.timer!="number"){var n=this;this.timer=self.setInterval(function(){n.tick()},Math.round(1e3/this.fps));r(this.cont,{display:"block"})}};t.hide=function(){typeof this.timer=="number"&&(clearInterval(this.timer),delete this.timer,r(this.cont,{display:"none"}))};t.kill=function(){var n=this.cont,t;typeof this.timer=="number"&&this.hide();f===e[0]?(n.removeChild(this.can),n.removeChild(this.cCan)):n.removeChild(this.vml);for(t in this)delete this[t]};n.CanvasLoader=o}(window),function(n,t,i){if(jQuery.fn.cssAnimate=function(t,i,r,u){return typeof i!="number"&&(u=r,r=i,i=400),typeof r=="function"&&(u=r,r=""),this.each(function(){var o;if(jQuery.fn.cssAnimate.hasTransitions){var e="transitionend",f="";e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"}[Modernizr.prefixed("transition")];this.addEventListener(e,function(){this.removeEventListener(e,arguments.callee,!1);n(this).css({"-webkit-transition":"","-moz-transition":"","-o-transition":"","-ms-transition":"",transition:""});typeof u=="function"&&u()},!1);(typeof r=="undefined"||r=="swing")&&(r="ease");for(o in t)f!=""&&(f+=", "),f+=o+" "+i+"ms "+r;n(this).css({"-webkit-transition":f,"-moz-transition":f,"-o-transition":f,"-ms-transition":f,transition:f});n(this).css(t)}else r!="linear"&&(r="swing"),typeof u!="function"&&(onAnimationComplete=function(){}),n(this).animate(t,i,r,u)})},jQuery.fn.cssAnimate.hasTransitions=!1,typeof Modernizr!="undefined"&&typeof Modernizr.csstransitions!="undefined")jQuery.fn.cssAnimate.hasTransitions=Modernizr.csstransitions;else{var r=i.createElement("p").style;jQuery.fn.cssAnimate.hasTransitions="transition"in r||"WebkitTransition"in r||"MozTransition"in r||"msTransition"in r||"OTransition"in r}}(jQuery,window,document),function(n){function t(t,i){i||(n("#site-container").removeClass("overlay-helper"),n("#avlOverlay").fadeOut(t.overlayHideSpeed,function(){s(t)}))}function s(t){n("#avlOverlay").remove();t.onHide()}function i(t,i){n(t.target).parent().hasClass("avlModal")&&n(t.target).unwrap();i&&n(".avlModal").css("zIndex","10000");(n("object embed[type]").length>0&&n("object embed[type]").attr("type").match("java")||n("object[codeBase]").length>0&&n("object[codeBase]").attr("codeBase").match("java"))&&n("object").parent().css({width:"100%",height:"",position:"static",right:"",bottom:"",overflow:"show"});n(t.target).find(".avlModal-content").css({"max-height":"",height:""})}function h(t){return t.target!=""&&n(t.target).length||t.url!=""?!0:!1}function c(t){t.target!=""?r(t,n(t.target)):n.ajax({url:t.url,data:t.parameters,cache:t.cache,dataType:"html",method:"GET",success:function(n){t.onSuccess();r(t,n)}})}function r(t,i){n("#avlOverlay").length?f(t,i):(n(i).parent().append("<div id='avlOverlay'><!-- --><\/div>"),n("#avlOverlay").css({position:"absolute",zIndex:"9999",left:"0",top:"0",opacity:t.overlayOpacity,display:"none"}),t.overlayImage!=""?n("#avlOverlay").css({backgroundImage:"url("+t.overlayImage+")"}):n("#avlOverlay").css({backgroundColor:t.overlayColor}),u(),n("#site-container").addClass("overlay-helper"),n("#avlOverlay").fadeIn(t.overlayShowSpeed,function(){}),f(t,i))}function u(){n("#avlOverlay").css({position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",transform:"translateZ(1px)"})}function l(n){return!isNaN(parseFloat(n))&&isFinite(n)}function f(t,i){var u,f,r;n(".avlModal").length>0&&n(".avlModal").css("zIndex","9998");n(i).wrap("<div class='avlModal' />").removeClass("avlModal-container");r=n(i).parent();n(i).find(".avlModal-content-wrapper").length==0&&(n(i).find(".avlModal-content").wrapInner("<div class='avlModal-content-wrapper' />"),n(i).data("initialHeight",r.height()).data("initialWidth",parseInt(t.width)).data("modalShowSpeed",t.modalShowSpeed).data("initialContentHeight",n(i).find(".avlModal-content").height()).data("windowBuffer",t.windowBuffer));f=n(i).find(".avlModal-content-wrapper")[0];t.showCloseButton&&n(t.target).find(".avlModal-close").length==0&&n(i).find(".avlModal-wrapper").find(".avlModal-close").length<1&&(n(i).find(".avlModal-wrapper").append("<a href='#close' class='avlModal-close' title='Close this modal window'><i id='closeModalIcon' class='icon-cancel'><\/i><\/a>"),n(i).find(".avlModal-close").attr("onclick","return $.closeModal({ target: '#"+n(i).attr("id")+"', onClose:"+t.closeButtonFunction+"});"));u=parseInt(i.find(".avlModal-wrapper").css("padding"));l(u)||(u=0);r.css({zIndex:"10000",transform:"translateZ(1px)",width:parseInt(t.width)+u,height:"auto"});setModalPosition("show",r,t);OpenModals.push({modal:r[0],modalContent:f,previousHeight:f.scrollHeight});OpenModals.length==1&&e();(n("object embed[type]").length>0&&n("object embed[type]").attr("type").match("java")||n("object[codeBase]").length>0&&n("object[codeBase]").attr("codeBase").match("java"))&&n("object").parent().css({width:"1px",top:"99%",height:"1px",right:"0px",bottom:"0px",position:"absolute",overflow:"hidden"})}function e(){OpenModals.length>0&&(requestAnimFrame(e),CheckModalContentSize())}var o;n.openModal=function(t){if(t=jQuery.extend({width:"700px",height:null,windowBuffer:null,overlayOpacity:"0.5",overlayImage:"",overlayColor:"#000",overlayShowSpeed:500,modalShowSpeed:400,useTransitions:!0,showCloseButton:!0,enableTabKeyInModalOnly:!1,closeButtonFunction:function(){},target:"",url:"",parameters:{},cache:!1,onShow:function(){},onComplete:function(){},onSuccess:function(){},onError:function(){}},t),n(t.target).parent().hasClass("avlModal"))return!1;n(t.target).find(".avlModal-close").removeAttr("onclick").off("click").on("click",function(){return n.closeModal({target:"#"+n(t.target).attr("id"),onClose:t.closeButtonFunction})});return t.onShow(),o=t,h(t)&&c(t),t.enableTabKeyInModalOnly&&n(t.target).modalTabbing(),!1};n.closeModal=function(r){r=jQuery.extend({overlayHideSpeed:500,modalHideSpeed:400,target:"",useTransitions:!0,onClose:function(){},onHide:function(){}},r);var f=n(".avlModal").length>1?!0:!1,u,e;r.onClose(r);for(u=0,e=OpenModals.length;u<e;u++)if(n(r.target).parent()[0]==OpenModals[u].modal){OpenModals.splice(u,1);break}return AVL.UTILITIES.FUNCTIONS.GoForTransitions(r.useTransitions)?(n(r.target).find(".avlModal-wrapper").addClass("hide"),t(r,f),n(r.target).find(".avlModal-wrapper").removeClass("hide").removeClass("show"),n(r.target).addClass("avlModal-container"),i(r,f)):(t(r,f),n(r.target).addClass("avlModal-container"),i(r,f)),!1};setModalPosition=function(t,i,r){var f,e,u;i.each(function(){var i=n(this),a=i.children()[0],p=i.find(".avlModal-header"),v=i.find(".avlModal-content"),c=i.find(".avlModal-close"),ut=i.find(".avlModal-wrapper"),o=6,w=5,nt=p.length>0?p.outerHeight(!0):0,b=c.length>0?c.height()/3-w:0,y=c.length>0?c.width()/3-w:0,s=n(a).data("windowBuffer")||30,tt=i.find(".avlModal-wrapper").css("padding-left").replace("px","")*2,k=n(window).height(),it=n(window).width(),d="auto",l=it-s,h=n(a).data("initialWidth"),rt=i.css({"max-width":l}).find(".avlModal-content-wrapper")[0].scrollHeight,g=rt-v.height()+i.height();isNaN(o)&&(o=0);g+b+s+o>=k?(f=k-s-b,d=f+v.height()-i.height()+"px"):f=g;e=(n(window).height()+y+o-f-s/2)/2;u=h>l?(n(window).width()+y+o-l-s/2)/2:(n(window).width()+y+o-h-s/2)/2;v.css("height",d);t==="show"&&(i.css({position:"fixed",top:Math.round(e),left:Math.round(u),height:"auto",width:h,display:"block"}),AVL.UTILITIES.FUNCTIONS.GoForTransitions(r.useTransitions)?(i.find(".avlModal-wrapper").addClass("show"),r!=undefined&&r.onComplete()):(i.find(".avlModal-wrapper").addClass("no-trans").css({opacity:1}),i.animate({left:Math.round(u),width:h},n(a).data("modalShowSpeed"),"easeInOutExpo",function(){i.animate({top:Math.round(e),height:"auto"},400,"easeInOutExpo",function(){n(this).parent().parent().css({minHeight:nt+tt/2});r!=undefined&&r.onComplete()})})));t==="resize"&&i.css({top:Math.round(e),left:Math.round(u),height:"auto",width:h,"max-width":l,display:"block"})})};n(window).on("resize onorientationchange",function(){n(".avlModal").is(":visible")&&(u(),setModalPosition("resize",n(".avlModal:visible")))});OpenModals=[];CheckModalContentSize=function(){var i=0,r=0,t=0,u=OpenModals.length,f=document.getElementsByTagName("HTML")[0].scrollHeight;if(u)for(t=0;t<u;t++)i=OpenModals[t].modalContent.scrollHeight,r=OpenModals[t].modal.scrollHeight,(OpenModals[t].previousHeight!=i||r>f)&&setModalPosition("resize",n(OpenModals[t].modal)),OpenModals[t].previousHeight=i};window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}();n.fn.modalTabbing=function(){var t=function(t){var i=n(t).find("select, input, textarea, button, a[href]").filter(":visible").not(":disabled");i.first().trigger("focus");n(t).on("keydown",function(i){if(i.which===9){var r=n(t).find("select, input, textarea, button, a[href]").filter(":visible").not(":disabled");i.shiftKey?r[0]===i.target&&(i.preventDefault(),r.last().trigger("focus")):r[r.length-1]===i.target&&(i.preventDefault(),r.first().trigger("focus"))}})};return this.each(function(){t(this)})}}(jQuery),function(n){"use strict";n.fn.extend({customSelect:function(t){if(typeof document.body.style.maxHeight=="undefined")return this;var t=n.extend({customClass:"customSelect",mapClass:!0,mapStyle:!0},t),u=t.customClass,r=function(t,r){var u=t.find(":selected"),f=r.children(":first"),e=u.html()||"&nbsp;";f.html(e);u.attr("disabled")?r.addClass(i("DisabledOption")):r.removeClass(i("DisabledOption"));setTimeout(function(){r.removeClass(i("Open"));n(document).off("mouseup."+i("Open"))},60)},i=function(n){return u+n};return this.each(function(){var e=n(this),o=n("<span />").addClass(i("Inner")),f=n("<span />");e.hasClass("hasCustomSelect")||(e.after(f.append(o)),f.addClass(u),t.mapClass&&f.addClass(e.attr("class")),t.mapStyle&&f.attr("style",e.attr("style")),e.addClass("hasCustomSelect").on("update",function(){var n,t;r(e,f);n=parseInt(e.outerWidth(),10)-(parseInt(f.outerWidth(),10)-parseInt(f.width(),10));f.css({display:"inline-block"});t=f.outerHeight();e.attr("disabled")?f.addClass(i("Disabled")):f.removeClass(i("Disabled"));o.css({"padding-right":"30px",display:"inline-block"});e.css({"-webkit-appearance":"menulist-button",width:"100%",position:"absolute",opacity:0,zIndex:"3",height:e.closest("p").height()===0?"25px":e.closest("p").height(),fontSize:f.css("font-size")})}).on("change",function(){f.addClass(i("Changed"));r(e,f)}).on("keyup",function(n){f.hasClass(i("Open"))?(n.which==13||n.which==27)&&r(e,f):(e.trigger("blur"),e.trigger("focus"))}).on("mousedown",function(){f.removeClass(i("Changed"))}).on("mouseup",function(t){if(!f.hasClass(i("Open")))if(n("."+i("Open")).not(f).length>0&&typeof InstallTrigger!="undefined")e.trigger("focus");else{f.addClass(i("Open"));t.stopPropagation();n(document).one("mouseup."+i("Open"),function(t){t.target!=e.get(0)&&n.inArray(t.target,e.find("*").get())<0?e.trigger("blur"):r(e,f)})}}).on("focus",function(){f.removeClass(i("Changed")).addClass(i("Focus"))}).on("blur",function(){f.removeClass(i("Focus")+" "+i("Open"))}).on("mouseenter",function(){f.addClass(i("Hover"))}).on("mouseleave",function(){f.removeClass(i("Hover"))}).trigger("update"))})}})}(jQuery);typeof JSON!="object"&&(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var s,l,h,a,v=n,c,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i));typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";if(n+=r,c=[],Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,s=0;s<a;s+=1)c[s]=u(s,e)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));else for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",r="",typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),f.lastIndex=0,f.test(text)&&(text=text.replace(f,function(n){return"\\u"+("0000"+n.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+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}();EventRecorder=function(n,t,i){var r={},s=null,a=-1,v=!1,y=2147483647,tt=3e3,f={record:!0,debug:!1,escPlayback:!1},it=function(n,t,i){var r=parent&&parent.EVENTPLAYBACK&&parent.EVENTPLAYBACK.playback;typeof n=="boolean"&&(f.record=n);typeof t=="boolean"&&(f.debug=t);typeof i=="boolean"&&(f.escPlayback=i);f.record&&!r&&st()},rt=function(){f.record&&(s=Date.now(),e(null,null,null,null,null,null,null,null,null,o(s),null,null,null),u("recording started at "+s),v=!0,ot())},ut=function(){var t=Date.now(),n;u("recording stopped");v=!1;e(null,null,null,null,null,null,null,null,null,o(t),null,null,null);r.Filesize=AVL.UTILITIES.FUNCTIONS.GetPhysicalSize(h());(r.Inactivity==null||r.Inactivity<0)&&(r.Inactivity=0);n=t-s;r.Duration=n>y?y:n;r.Engagement=r.Duration-r.Inactivity;ft()},ft=function(){r.Active=!1;r.Events=[];f.record&&r.Unloadable&&ct()},h=function(){return JSON.stringify(r)},et=function(t){if(t.length>0)switch(t[0]){case"tagRecording":typeof r.Tags=="undefined"&&(r.Tags="");switch(typeof t[1]){case"object":n.each(t[1],function(n,t){var i=t==null||t==""?"":":"+t,u=n+i,f=r.Tags==""?"":",";r.Tags+=f+u});break;case"string":r.Tags+=","+t[1]}u(r.Tags)}},ot=function(){if(f.record){i.onload=function(){wgxpath.install()};r.Unloadable?(i.addEventListener("beforeunload",function(n){c(n)}),i.addEventListener("pagehide",function(n){c(n)}),i.addEventListener("unload",function(n){c(n)}),u("Window unload events bound.")):(r.Active=!1,u("Window unload events not bound!"));n(i).on("resize",function(n){n.timeStamp=Date.now();p(n)});n(t).on("resize mousedown mouseup mousemove dblclick keydown keyup scroll change touchstart touchmove touchend touchcancel",function(n){if(wt(n)){n.timeStamp=Date.now();switch(n.type){case"mousedown":case"mouseup":n.which==1&&p(n);break;default:p(n)}}});var e=n("#slideout-content").length==0?n(t):n("#slideout-content");e.on("scroll",function(n){n.timeStamp=Date.now();p(n)})}},p=function(t){if(v&&f.record)switch(t.type){case"mousemove":case"mousedown":case"mouseup":case"dblclick":(r.Events.length==0||t.type!="mousemove"||t.type=="mousemove"&&r.Events[r.Events.length-1].Mx!=t.pageX&&r.Events[r.Events.length-1].My!=t.pageY)&&(at(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),t.type=="mouseup"&&(e(t.type,null,t.pageX,t.pageY,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),d(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null),t.type="click",r.Clicks==null?r.Clicks=1:r.Clicks++),e(t.type,null,t.pageX,t.pageY,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null));break;case"keydown":case"keyup":if(typeof i.overrideERMV!="undefined"&&i.overrideERMV===!0)break;var u=t.which?t.which:t.keyCode;e(t.type,u,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)).val());break;case"change":e(t.type,null,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),d(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)).val());break;case"resize":w();e(t.type,null,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null);break;case"scroll":w();e(t.type,t.pageX,t.pageY,null,n(i).scrollLeft(),n(i).scrollTop(),"window",n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null)}},e=function(n,t,i,f,e,o,s,h,c,l,a,v,y){var p={Et:n,Kc:t,Mx:i,My:f,Sx:e,Sy:o,St:s,Ww:h,Wh:c,Ts:l,Tg:a,Tr:v,Vl:y};pt(l,tt);r.Events.push(p);u(p)},u=function(n){f.debug&&console.log(n)},c=function(n){c._hasUnloaded||(c._hasUnloaded=!0,ut(),u(n.type+" event triggered stopRecording()."))},st=function(){r={Active:!0,Application:"",Belowfold:0,Brand:0,Browsername:"",Browserversion:"",Clicks:0,Colordepth:"",Cookiesenabled:!1,Country:"",Countrycode:"",Customerid:"",Date:l(),Devicetype:"",Documentheight:0,Duration:0,Engagement:0,Error:0,Events:"",Filesize:"",Inactivity:0,Ip:"",Isp:"",Javaenabled:!1,Language:"",Lastmodified:l(),Lastvisit:l(),Latitude:"",Loadtime:0,Longitude:"",Osname:"",Osversion:"",Page:"",Pagetitle:"",Referrer:"",Region:"",Regioncode:"",Screenheight:0,Screenres:"",Screenwidth:0,Scrollreach:0,Servertime:0,Sessionid:"",Sourcecode:"",Tags:"",Timezone:"",Unscrolled:0,Url:"",Useragent:"",Utmcampaign:"",Utmsource:"",Utmmedium:"",Utmcontent:"",Viewportheight:"",Viewportwidth:"",Visitortype:"",Browserfeatures:{Applicationcache:"",Audio:"",Backgroundsize:"",Borderimage:"",Canvas:"",Canvastext:"",Cssanimations:"",Csscolumns:"",Cssgradients:"",Cssreflections:"",Csstransforms:"",Csstransforms3d:"",Csstransitions:"",Borderradius:"",Boxshadow:"",Draganddrop:"",Flexbox:"",Fontface:"",Geolocation:"",Generatedcontent:"",Hashchange:"",History:"",Hsla:"",Indexeddb:"",Inlinesvg:"",Localstorage:"",Multiplebgs:"",Opacity:"",Postmessage:"",Rgba:"",Sessionstorage:"",Smil:"",Svg:"",Svgclippaths:"",Textshadow:"",Touch:"",Unloadable:0,Video:"",Webgl:"",Websockets:"",websqldatabase:"",webworkers:""}};lt();yt();ht();u(r);rt()},ht=function(){function i(n){a=parseInt(n.d);r.Servertime=(new Date).getTime()-t;u(r.Servertime)}function f(){r.Servertime=(new Date).getTime()-t;u("failed save!")}var t=(new Date).getTime();0||n.ajax({type:"POST",async:!0,cache:!1,url:nt()+"/AddRecording",contentType:"application/json; charset=utf-8",data:JSON.stringify({jsonRequest:h()}),dataType:"json",success:i,error:f})},ct=function(){function t(n){u(n)}function i(n){u(n.status+" \n\r "+n.statusText+"\n\r"+n.responseText)}var r=nt()+(a==-1?"/AddRecording":"/UpdateRecording"),f=a==-1?JSON.stringify({jsonRequest:h()}):JSON.stringify({id:a,jsonRequest:h()});0||n.ajax({type:"POST",async:!0,cache:!1,url:r,contentType:"application/json; charset=utf-8",data:f,dataType:"json",success:t,error:i})},lt=function(){var e=!0,o="ER_PV_"+g(),s="ER_RSID",u="ER_RLV",h="ER_RVT",t=AVL.UTILITIES.FUNCTIONS.GetCookie(s),f,n,i;t==undefined||t==null||t==""?(r.Sessionid=bt(),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(s,r.Sessionid)):(r.Sessionid=t,e=!1);f=AVL.UTILITIES.FUNCTIONS.GetCookie(u);n=AVL.UTILITIES.FUNCTIONS.GetCookie(h);e||!b(f)||n==undefined||n==null||n==""?(i=AVL.UTILITIES.FUNCTIONS.GetCookie(o),b(i)?(r.Visitortype="returning",r.Lastvisit=i,AVL.UTILITIES.FUNCTIONS.SetSessionCookie(u,i)):(r.Visitortype="new",r.Lastvisit=k(),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(u,k())),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(h,r.Visitortype)):(r.Lastvisit=f,r.Visitortype=n);b(r.Lastvisit)||(r.Lastvisit=k());AVL.UTILITIES.FUNCTIONS.SetCookie(o,l(),360)},at=function(r){var f=r.scrollParent(),s=r.hasScroll(),h=!f.is(t)&&f.hasScroll(),u;if((s||h)&&(u=s?r:r.scrollParent(),!u.hasClass("scrollable-record"))){u.addClass("scrollable-record");u.on("scroll",function(t){v&&e(t.type,null,null,null,u.scrollLeft(),u.scrollTop(),"element",n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null)})}},w=function(){var h=n(i).height(),c=n("#slideout-content").length==0?n(t).height():n("#slideout-content")[0].scrollHeight,o=n("#slideout-content").length==0?n(i).scrollTop():n("#slideout-content").scrollTop(),e=c-h,l=Math.ceil(e-o),s=100,f;return e>0&&(s=parseInt((o/e*100).toFixed(0))),f={percent:s,unscrolled:l},(r.Scrollreach==null||r.Scrollreach<f.percent)&&(r.Scrollreach=f.percent),(r.Unscrolled==null||r.Unscrolled>f.unscrolled)&&(r.Unscrolled=Math.ceil(f.unscrolled)),u(r.Unscrolled+"/"+f.unscrolled+"px - "+r.Scrollreach+"/"+f.percent+"%"),f},vt=function(){return"onbeforeunload"in i||"onunload"in i||"onpagehide"in i},l=function(){return AVL.UTILITIES.FUNCTIONS.FormatDate(new Date)},yt=function(){var p="-",b=screen.width||0,k=screen.height||0,tt=b+" x "+k,it=navigator.appVersion||"",u=navigator.userAgent||"",o=navigator.appName||"",f=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10),d,e,c,h,v,nt,y,s;(e=u.indexOf("Opera"))!=-1?(o="Opera",f=u.substring(e+6),(e=u.indexOf("Version"))!=-1&&(f=u.substring(e+8))):(e=u.indexOf("MSIE"))!=-1?(o="Internet Explorer",f=u.substring(e+5)):(e=u.indexOf("Chrome"))!=-1?(o="Chrome",f=u.substring(e+7)):(e=u.indexOf("Safari"))!=-1?(o="Safari",f=u.substring(e+7),(e=u.indexOf("Version"))!=-1&&(f=u.substring(e+8))):(e=u.indexOf("Firefox"))!=-1?(o="Firefox",f=u.substring(e+8)):u.indexOf("Trident/")!=-1?(o="Internet Explorer",f=u.substring(u.indexOf("rv:")+3)):(d=u.lastIndexOf(" ")+1)<(e=u.lastIndexOf("/"))&&(o=u.substring(d,e),f=u.substring(e+1),o.toLowerCase()==o.toUpperCase()&&(o=navigator.appName||""));(c=f.indexOf(";"))!=-1&&(f=f.substring(0,c));(c=f.indexOf(" "))!=-1&&(f=f.substring(0,c));(c=f.indexOf(")"))!=-1&&(f=f.substring(0,c));a=parseInt(""+f,10);isNaN(a)&&(f=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10));typeof navigator.cookieEnabled!="undefined"||cookieEnabled||(t.cookie="testcookie",cookieEnabled=t.cookie.indexOf("testcookie")!=-1?!0:!1);h=p;v=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(nt in v)if(y=v[nt],y.r.test(u)){h=y.s;break}s=p;/Windows/.test(h)&&(s=/Windows (.*)/.exec(h)[1],h="Windows");switch(h){case"Mac OS X":s=/Mac OS X (10[\.\_\d]+)/.exec(u)[1];break;case"Android":s=/Android ([\.\_\d]+)/.exec(u)[1];break;case"iOS":s=/OS (\d+)_(\d+)_?(\d+)?/.exec(it);s=s[1]+"."+s[2]+"."+(s[3]|0)}typeof r.Tags=="undefined"&&(r.Tags="");r.Customerid=n("#avlCT").val()||"";r.Devicetype=AVL.UTILITIES.FUNCTIONS.GetDeviceType();r.Application=AVL.UTILITIES.FUNCTIONS.GetApplication();r.Date=l();r.Brand=AVL.UTILITIES.FUNCTIONS.GetAvlBrand();r.Lastmodified=t.lastModified||"";r.Loadtime=(new Date).getTime()-ERMV.ls;r.Url=t.URL||"";r.Page=AVL.UTILITIES.FUNCTIONS.GetFileNameNoParams(t.URL);r.Pagetitle=AVL.UTILITIES.FUNCTIONS.GetPageTitle();r.Error=AVL.UTILITIES.FUNCTIONS.IsErrorPage(t.URL);r.Duration=0;r.Language=navigator.language||"";r.Useragent=navigator.userAgent||"";r.Browsername=o||"";r.Browserversion=f||"";r.Osname=h||"";r.Osversion=s||"";r.Cookiesenabled=AVL.UTILITIES.FUNCTIONS.IsCookiesEnabled();r.Javaenabled=navigator.javaEnabled()||!1;r.Belowfold=n(t).height()-n(i).height();r.Documentheight=n(t).height();r.Scrollreach=w().percent;r.Unscrolled=w().unscrolled;r.Viewportheight=n(i).height();r.Viewportwidth=n(i).width();r.Unloadable=vt();r.Screenres=tt;r.Screenwidth=b;r.Screenheight=k;r.Colordepth=screen.colorDepth+" bit";r.Sourcecode=AVL.UTILITIES.FUNCTIONS.GetCookie(g()+"SourceCode","")||"";r.Utmcampaign=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_campaign");r.Utmsource=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_source");r.Utmmedium=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_medium");r.Utmcontent=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_content");r.Referrer=t.referrer||"";r.Events=[];r.Browserfeatures=AVL.UTILITIES.FUNCTIONS.GetBrowserFeatures()},b=function(n){return!(n==undefined||n==null||n==""||!XDate(n).valid())},k=function(){return AVL.UTILITIES.FUNCTIONS.FormatDate(new Date(1970,0,1,12))},o=function(n){return n-s},d=function(n){var t=n.attr("data-tagEvent"),i=null;return typeof t!="undefined"&&t!==!1&&(i=t),i},pt=function(n,t){if(r.Events.length>0){var i=n-r.Events[r.Events.length-1].Ts;i>t&&((r.Inactivity==null||r.Inactivity<0)&&(r.Inactivity=0),r.Inactivity+=i,r.Inactivity>y&&(r.Inactivity=y),u(n+" / "+r.Inactivity))}},wt=function(t){var i=n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t));return i.attr("data-recordingignore")!="true"&&i.closest("[data-recordingignore='true']").length==0},bt=function(){var n=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t=="x"?i:i&7|8).toString(16)})},g=function(){var n="";switch(AVL.UTILITIES.FUNCTIONS.GetAvlBrand()){case"0":n="DM";break;case"4":n="OAS";break;case"5":n="CDB";break;case"12":n="TC";break;case"14":n="BB";break;case"16":n="BS"}return n},nt=function(){return"/EventRecorderWebService/EventRecorder.asmx"};return{init:it,push:et,getRecording:h}}(jQuery,document,window);$(document).ready(function(){typeof ERMV!="undefined"&&ERMV.on&&EventRecorder.init(!0,null,!1)})