var offercodeValue,loadingMessages,global,j2,validation;cachedItems={messages:"j2.messages",genericScripts:"j2.genericScripts",dynamicModals:"j2.dynamicModals",userCollection:"j2.userCollection",confirmationCollection:"j2.confirmationCollection",confirmationExpired:"j2.store.confirmation.time",storeCacheTime:"j2.store.cache.time"};j2RegEx={EmailRegEx:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,DigitsOnly:/[^0-9]/g,TwoOrMoreWords:/\b[^\d\s]+\b/g,CreditCardLength:/^[0-9]{13,16}$/};widgetTypes={NumberChooser:1,Countries:2,States:3,Cities:4,RateTable:5,ExistingNumber:6,PlanConfirmation:7};"use strict";try{offercodeValue="";j2app.controller("PlanConfirmationCtrl",["StorageContainer","$scope","$http","$sce","$q",function(n,t,i,r){offercodeValue=url("?offercode")!==undefined&&url("?offercode")!==""?url("?offercode"):global.getCookie("OFFERCODE")!==undefined?global.getCookie("OFFERCODE"):"default";t.showLoadingConfirmation=!0;t.showConfirmation=!1;i({url:appRoot+"PlanConfirmation/GetLayoutContent/"+offercodeValue,method:"POST",dataType:"html",cache:!0,data:{layout:planLayout,offercodeValue:offercodeValue}}).then(function(n){t.planConfirmation=r.trustAsHtml(n.data)},function(n){Sentry.captureException(n.data)})}])}catch(e){}"use strict";try{j2app.controller("AccountConfirmationCtrl",["StorageContainer","$scope","$http","$sce","$q",function(n,t,i){var r=!1,u=0,f=null;t.showLoadingConfirmation=!0;t.showConfirmation=!1;t.hideTempNumber=!0;n.get("userCollection")!==null&&n.get("userCollection").userinfoid!==undefined?(u=parseInt(n.get("userCollection").userinfoid),f=n.get("userCollection").encryptedtoken,r=!0):n.get(cachedItems.confirmationCollection)!==null&&n.get(cachedItems.confirmationCollection).UserInfoID!==undefined&&(u=parseInt(n.get(cachedItems.confirmationCollection).UserInfoID),f=n.get(cachedItems.confirmationCollection).encryptedtoken,r=!0);r&&(n.get(cachedItems.confirmationCollection).PhoneNumber!==undefined?($("#phoneNumber").val(n.get(cachedItems.confirmationCollection).PhoneNumber),$(".phoneNumber").html(n.get(cachedItems.confirmationCollection).PhoneNumber)):($("#phoneNumber").val(n.get("currentnumber").PhoneNumber),$(".phoneNumber").html(n.get("currentnumber").PhoneNumber)),n.get(cachedItems.confirmationCollection).Pin!==undefined&&($("#pin").val(n.get(cachedItems.confirmationCollection).Pin),$(".pin").html(n.get(cachedItems.confirmationCollection).Pin)),t.showLoadingConfirmation=!1,t.showConfirmation=!0,n.remove(cachedItems.userCollection),i({url:appRoot+"AccountConfirmation/ConfrimationCollection",method:"POST",cache:!0,data:{userInfoID:u,token:f}}).then(function(){},function(n){Sentry.captureException(n.data)}));t.populateConfirmationCollection=function(n){angular.forEach(n,function(n,i){t.saveConfirmationStorage(i.toLowerCase(),n)})};t.saveConfirmationStorage=function(t,i){var r=n.get(cachedItems.confirmationCollection)!==null?n.get(cachedItems.confirmationCollection):{};r[t]=i;n.save(cachedItems.confirmationCollection,r)}}])}catch(e){}MessagesType={DuplicateEmail:1,DuplicateEmailBilling:2,BillingErrorMessage:3,PhoneNumber:4,GeneralErrorMessage:5,NoResults:6,reCaptcha:7,FullName:8,Freephone:9,SelectaRegion:10,SelectaState:11,State:12,TollFree:13,Loading:14,SelectaPrefix:15,LocalNumbers:16,CookiePolicy:17,CookieDismissText:18,CookiePolicyLink:19,EmailCompare:20,reCaptchaValidationError:21,PostalCode:22,DefaultDropDownValue:23,SelectACity:24,CannotBePorted:25,OptInOptOutSuccess:26,OptInOptOutError:27,Monthly:28,Annually:29,National:30,VoiceFreephone:31,VoiceNationalFreephoneCombo:32,ThankYouMessage:33,NumberTypeDropDownDefault:34,CostPerMinute:35,NumberReserved:36,FailedLoginAttempt:37,AccountNotFound:38,ForgotPasswordSuccess:39,SendTestFaxSuccess:40,ForgotPasswordFail:41,SendTestFaxFail:42,NoCities:43,CookieHref:44,CreditCardExpiration:45,CompanyLength:46,ThreeDSRefused:50};Messages={Get:function(n,t){var i="";return $.ajax({type:"POST",dataType:"json",async:!1,url:appRoot+"Widget/GetDisplayMessage",data:{messageTypeID:n,language:t},success:function(n){i=n}}),i},GetList:function(n,t){var i="";return $.ajax({type:"POST",dataType:"json",async:!0,url:appRoot+"Widget/GetDisplayMessageList",data:{messageTypeIDList:n,language:t},success:function(n){i=n}}),i}};country={init:function(){$(".country:first-child").val("").change()},isFaxPlatform:!1,defaultStateText:"",setCountryDefaultDropdown:function(){var n=JSON.parse(localStorage.getItem("j2.userCollection"))!==null&&JSON.parse(localStorage.getItem("j2.userCollection")).country!==undefined?JSON.parse(localStorage.getItem("j2.userCollection")).country:global.getGeoInfoCountry();try{selectedCountryDropdownID!==undefined&&n!==undefined&&global.setDropDownValue("select[id="+selectedCountryDropdownID+"]:first",n)}catch(t){}},getRegions:function(n,t){var i=$(n).find("option:selected").val();if(i.length===0){$(".container-state select").val("").attr("disabled","disabled").change();$('.container-zipcode input[type="text"]').val("").attr("disabled","disabled");return}$(".container-state select").removeAttr("disabled");$('.container-zipcode input[type="text"]').removeAttr("disabled");country.defaultStateText=$(".container-state select").length>0?$(".container-state select").children("option:first").text():"";country.isFaxPlatform=t;country.FaxCountrySelection(n,i)},FaxCountrySelection:function(n,t){var s=$(n).find("option:selected").data("hasregion").toLowerCase(),a=$(n).find("option:selected").data("emailoption"),v=$(n).find("option:selected").data("haspostalcode").toLowerCase(),u=$(n).find("option:selected").data("region"),i,f,r,e,h,c,o,l;$(".container-state label").length>0&&$(".container-state label").html().toLowerCase().indexOf("*")>=0&&(u=u+"*");global.saveUserCollectionToLocalStorage("country",t);i=$(n).find("option:selected").data("postallabel");i=i+"*";$(".container-state select").removeAttr("disabled");$(".container-state select option").not('[value=""]').remove();countryActions.displayOption();$("#HasRegions").length>0&&$("#HasRegions").val(s);$("#EmailOption").length>0&&$("#EmailOption").val(a);s==="true"?(f=$(".container-state label").text(),$(".container-state label").html(u),$(".container-state select").removeAttr("disabled"),country.setStateDropdown(t)):(f=$(".container-state label").text(),$(".container-state label").text(f.replace("*","")),$(".container-state select").attr("data-error","Please select a "+u.replace("*","")),$(".container-state").find(".error-msg").html('<i class="fa fa-exclamation-triangle"><\/i> Please enter a '+u.replace("*","")));v==="true"?($(".container-zipcode").length>0&&window.location.href.indexOf(".efax.pl")==-1&&($(".container-zipcode label").html(i),$('.container-zipcode input[type="text"]').attr("placeholder",i.replace("*","")),$(".container-zipcode label").text(i.replace("*","")),$(".container-zipcode input").attr("data-error","Please Enter "+i.replace("*","")+"."),$(".container-zipcode").find(".error-msg").html('<i class="fa fa-exclamation-triangle"><\/i> Please enter a '+i.replace("*",""))),$('.container-zipcode input[type="text"]').removeAttr("disabled"),$(".container-zipcode").length>0&&($(".container-zipcode").show(),r=$('.container-zipcode input[type="text"]'),r.inputmask("unmaskedvalue"),r.inputmask("remove"),e=postalValidation.Mask(t),e.length>0&&r.inputmask({mask:e}),h=new RegExp(postalValidation.RegEx(t)),h.test(r.val())?(c=$(".zipcode").prop("id"),o=localStorage.getItem(cachedItems.userCollection)!==null?JSON.parse(localStorage.getItem(cachedItems.userCollection)):null,o!==null&&(l=o.zipcode,$("#"+c+"[type=text]").val(l))):r.val(""))):(i=i.length>1?i:"Postal Code",$(".container-zipcode label").text(i.replace("*","")),$('.container-zipcode input[type="text"]').attr("placeholder",i.replace("*","")))},setStateDropdown:function(n){var t,i;if(n<=0){$(".container-state select").append('<option value=" " disabled selected>'+country.defaultStateText+"<\/option>");$(".container-state select").val("");return}$(".container-state").length>0&&($(".container-state").show(),$(".container-state select").empty(),country.defaultStateText!==""?$(".container-state select").append('<option value="" disabled selected>'+country.defaultStateText+"<\/option>"):(t=global.getMessageByMessageTypeID(MessagesType.SelectaState),$(".container-state select").append('<option value="" disabled selected>'+t+"<\/option>")),i="Widget/GetRegions/"+n,$.get(appRoot+i,function(n){var i,t,r;country.isFaxPlatform?$.each(n.states.Regions,function(n,t){$(".container-state select").append("<option value="+t.Code+">"+t.Name+"<\/option>")}):n.states!==null&&n.states.length>0&&$.each(n.states,function(n,t){$(".container-state select").append("<option value="+t.StateAbbrv+">"+t.StateName+"<\/option>")});i=global.getGeoInfoState();t=null;i!==undefined&&i.length>0?(r=global.setDropDownValue(".container-state select",i),r||($(".container-state select").prop("selectedIndex",0),$(".container-state select").prop("selected",!0),$(".container-state select").change(),t=$(".container-state select option:selected").val(),$('.container-state input[type="hidden"]').val(t))):($(".container-state select").prop("selectedIndex",0),$(".container-state select").prop("selected",!0),$(".container-state select").change(),t=$(".container-state select option:selected").val(),$('.container-state input[type="hidden"]').val(t))}))},togglePaymentMethodType:function(n){var t="Widget/TogglePaymentMethodTypes/"+n;global.displaySpinner(".paymentMethodContainer",!1,"xsml");$.ajax({url:appRoot+t,dataType:"json",cache:!0,data:{country:n,selectedLayout:selectedLayoutPaymentTypes},success:function(n){$(".paymentMethodContainer").html(n)}})}};j2CommonFax={contactNumber:null,successPageUrl:null,init:function(){$(".country").change(function(){country.getRegions(this,!0)});country.setCountryDefaultDropdown();$(".optInOutLabel").click(function(n){var t=!$("#sp_optInOut").prop("checked"),i;return $("#sp_optInOut").prop("checked",t),n.stopPropagation(),i=MyAccountApiUrl+"/myaccount/setAllowMarketingEmails",j2CommonFax.setOptInOutEmailOptions(i,t),!1});$("#sp_optInOut").on("change",function(n){var t=$(this).prop("checked"),i=MyAccountApiUrl+"/myaccount/setAllowMarketingEmails";return j2CommonFax.setOptInOutEmailOptions(i,t),n.stopPropagation(),!1})},changeSuccessPage:function(n){var i,t;n.is("select")?(i=n.find("option:selected").val(),$("input[type=hidden]#PaymentMethod").val(i),t=n.find("option:selected").attr("data-url"),t!=undefined&&t.length>0&&(j2CommonFax.successPageUrl=t)):(i=n.find("input").val(),$("input[type=hidden]#PaymentMethod").val(i),t=n.find("input").attr("data-url"),t!=undefined&&t.length>0&&(j2CommonFax.successPageUrl=t))},toggleCompanyNameOfAddressType:function(n){$(".container-companyname").addClass("hide");var t=$(n);t.val()=="B"&&$(".container-companyname").removeClass("hide")}};loadingMessages={message:"...Loading...",displayLoadingMessages:function(n){$(n).html(message).show()}};ContactNumber={showInfo:function(n,t,i,r){var u=$(n).find("option:selected"),h,c,f,e,o,s;$(".sales").hide();$(".support").hide();u.val()!=undefined&&(h=t.toLowerCase()==="true",c=i.toLowerCase()==="true",h&&($(".sales").show(),f=u.attr("data-salesnumberincountry"),e=u.attr("data-salesnumberuniversal"),f!=undefined&&f.length>0&&$("#salesCountry_"+r).html(f),e!=undefined&&e.length>0&&$("#salesUniversal_"+r).html(e)),c&&($(".support").show(),o=u.attr("data-supportnumberincountry"),s=u.attr("data-supportnumberuniversal"),o!=undefined&&o.length>0&&$("#supportCountry_"+r).html(o),s!=undefined&&s.length>0&&$("#supportUniversal_"+r).html(s)))}},function(n){var t=function(){function n(){var n=this;$(document).ready(function(){$(".currency-Selector").change(function(){var n=localStorage.getItem(cachedItems.userCollection)!==null?localStorage.getItem(cachedItems.userCollection):{},t=n.length>0?JSON.parse(n):n;t.currency=$(this).val();localStorage.setItem(cachedItems.userCollection,JSON.stringify(t));$(".container-planselector").wrap("<div class='main-container'><\/div>");$(".main-container").html(data);$(".container-planselector").length>0&&$(".container-planselector").owlCarousel({loop:!0,margin:0,responsiveClass:!0,dots:!1,responsive:{0:{items:1,nav:!0,stagePadding:20,margin:10},768:{items:2,nav:!1,loop:!1,mouseDrag:!1,stagePadding:0,margin:0}}})})})}return n}();n.currencySelector=t}(j2||(j2={}));SendRate={ShowSendRates:function(n,t){var s=$("#SendRateCountryDropdown").find("option:selected").attr("value"),h=$("#SendRateCurrencyDropdown").find("option:selected").attr("value"),o=$("#RateType").val(),i;if(s!=undefined&&h!=undefined)if(o=="undefined"||o==null||o==""){var i=JSON.parse(n)[0].toLowerCase()==="true",r=JSON.parse(n)[1].toLowerCase()==="true",u=JSON.parse(n)[2].toLowerCase()==="true",f=JSON.parse(n)[3].toLowerCase()==="true",e=JSON.parse(n)[4].toLowerCase()==="true",c=JSON.parse(n)[5].toLowerCase()==="true";$("#LocalRate, #MobileRate, #PremiumRate, #NationalRate").html("");$("#LocalRate").html("<span><img width='20' height='20' src='"+commonBaseURL+"/images/common/loading_sml.gif'/><\/span>");$.get(appRoot+"CFAPI/GetSendRates/"+h+"/"+s,function(){}).done(function(n){$("#LocalRate").hide();var o=n[0].Local.length!=0?n[0].Local[0].Value:"",s=n[0].Mobile.length!=0?n[0].Mobile[0].Value:"",h=n[0].Premium.length!=0?n[0].Premium[0].Value:"",l=n[0].National.length!=0?n[0].National[0].Value:"",a=n[0].Rural.length!=0?n[0].Rural[0].Value:"";if(c)if(o&&(s||h||l||a)){var v=document.getElementById("SendRateCurrencyDropdown").options[document.getElementById("SendRateCurrencyDropdown").selectedIndex].text,w=v.substr(0,v.indexOf(" ")),y=v.substr(v.indexOf(" ")+1),d=o.replace(/[^\d\.]/g,""),g=s.replace(/[^\d\.]/g,""),nt=h.replace(/[^\d\.]/g,""),tt=l.replace(/[^\d\.]/g,""),it=a.replace(/[^\d\.]/g,""),b=[d,g,nt,tt,it],k=b.filter(function(n){return n!==""}).reduce(function(n,t){return Math.min(n,t)},Infinity).toFixed(2),p=Math.max.apply(null,b).toFixed(2);k==p?($("#LocalRate").html(p+" ("+y+")"+t+" "),$("#LocalRate").show()):($("#LocalRate").html("Between "+w+k+" ("+y+") and "+w+p+" ("+y+")"+t+" "),$("#LocalRate").show())}else $("#LocalRate").html(o+t+" "),$("#LocalRate").show();else i&&(r==!1&&u==!1&&f==!1&&e==!1?($("#LocalRate").html(o+t+" "),$("#LocalRate").show()):o!=""&&($("#LocalRate").html(n[0].Local[0].Name+": "+o+t+" "),$("#LocalRate").show())),r&&(i==!1&&u==!1&&f==!1&&e==!1?($("#MobileRate").html(s+t+" "),$("#MobileRate").show()):s!=""&&($("#MobileRate").html(n[0].Mobile[0].Name+": "+s+t+" "),$("#MobileRate").show())),u&&(i==!1&&r==!1&&f==!1&&e==!1?($("#ShowPremium").html(h+t+" "),$("#ShowPremium").show()):h!=""&&($("#PremiumRate").html(n[0].Premium[0].Name+": "+h+t+" "),$("#PremiumRate").show())),f&&(i==!1&&r==!1&&u==!1&&e==!1?($("#NationalRate").html(l+t+" "),$("#NationalRate").show()):l!=""&&($("#NationalRate").html(n[0].National[0].Name+": "+l+t+" "),$("#NationalRate").show())),e&&(i==!1&&r==!1&&u==!1&&f==!1?($("#RuralRate").html(a+t+" "),$("#RuralRate").show()):a!=""&&($("#RuralRate").html(n[0].Rural[0].Name+": "+a+t+" "),$("#RuralRate").show()))}).fail(function(){Sentry.captureException("SendRates");$("#LocalRate").html("<span style='color:red; font-weight:bold;'>There was an error communicating with our services.<\/span>");$("#LocalRate").show()})}else i=JSON.parse(n)[0].toLowerCase()==="true",$("#LocalRate, #MobileRate, #PremiumRate, #NationalRate").html(""),$("#LocalRate").html("<span><img width='20' height='20' src='"+commonBaseURL+"/images/common/loading_sml.gif'/><\/span>"),$.get(appRoot+"CFAPI/GetSendRatesByDisplayOption/"+h+"/"+s+"/"+o,function(){}).done(function(n){$("#LocalRate").html(n+t+" ");$("#LocalRate").show()}).fail(function(){Sentry.captureException("SendRates");$("#LocalRate").html("<span style='color:red; font-weight:bold;'>There was an error communicating with our services.<\/span>");$("#LocalRate").show()})}},function(n){var t=function(){function n(){var n=this;$(document).ready(function(){n.disableDefaultDropdownOption();n.placeHolder();n.provisionData();n.updateHiddenField();n.generateDynamicModals();n.frameworkVersion();n.safariBrowserFix();$("input").keypress(function(n){var t=$("a.btnValidate, button.btnValidate").is("[disabled=disabled]"),i=$("a.btnValidate, button.btnValidate").is(":visible");n.which===13&&t===!1&&i&&(n.preventDefault(),$("a.btnValidate:first").click(),$("button.btnValidate:first").click())});var t=new Date,i=t.getFullYear();$(".copyright-year, #year").html(i+" ");$(".btn-container").removeClass("noscript");$(".btnDisabled").attr("disabled","disabled").addClass("disabled");$(".customer-agreement").on("click",function(){$(".agreement, .btnValidate").attr("disabled","disabled").addClass("disabled");this.checked&&($(".agreement-error-message").hide(),$(".container-agreement").css({border:""}),$(".agreement, .btnValidate").removeAttr("disabled").removeClass("disabled"))});$(".btnValidate").on("click",function(t){var i=$(this).is("[disabled=disabled]");if(i===!0)return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!1;n.validateEntireForm(t)});$("body").on("click",".modal-close",function(n){if($(n.target).is(".modal-close")){var t=$(this).attr("id");$("#"+t).modal("hide")}});$('[data-toggle="tooltip"]').tooltip({html:!0});$('[data-toggle="popover"]').popover({html:!0})})}return n.prototype.safariBrowserFix=function(){var n=navigator.userAgent.indexOf("Safari")>-1;n&&$(window).bind("pageshow",function(n){n.originalEvent.persisted&&window.location.reload()})},n.prototype.generateDynamicModals=function(){if(!defaultValues.Preview){$("body > div.modalCollection").length===0&&$("body").append('<div class="modalCollection">');var n=localStorage.getItem(cachedItems.dynamicModals);$(document).ready(function(){n!==null?$(".modalCollection").html(JSON.parse(n)):$.ajax({url:appRoot+"DynamicModals/Modals",dataType:"html",success:function(n){$(".modalCollection").html(n)}})})}},n.prototype.frameworkVersion=function(){var t={};$("body").on("keydown",function(i){t[i.which]=!0;t[17]&&t[70]&&t[16]&&($("body > div.frameworkContainer").length===0&&($("body").append('<div class="frameworkContainer">'),n.prototype.displaySpinner(".frameworkContainer",!1,"xsml")),$.ajax({url:appRoot+"Framework/Version",dataType:"html",async:!1,success:function(n){$(".frameworkContainer").html("Framework version: "+n)}}))});$("body").on("keyup",function(){(t[17]||t[70]||t[16])&&($(".frameworkContainer").fadeOut("slow",function(){$(".frameworkContainer").remove()}),delete t[17],delete t[70],delete t[16])})},n.prototype.displayHiddenContainer=function(){var n={};$("body").on("keydown",function(t){n[t.which]=!0;n[17]&&n[65]&&n[16]&&$(".hiddenContainer").attr("type","text").show()});$("body").on("keyup",function(){delete n[17];delete n[65];delete n[16]})},n.prototype.utf8LengthCheck=function(n){try{return unescape(encodeURIComponent(n)).length}catch(t){return n.length}},n.prototype.disableButton=function(){$(".btnValidate,.agreement,.enabledGreenbtn").attr("disabled","disabled").addClass("disabled").show()},n.prototype.enableButton=function(){$(".btnValidate,.agreement,.enabledGreenbtn").removeAttr("disabled").removeClass("disabled").show()},n.prototype.validateEntireForm=function(t){var i=0,r;if($(".field-validation").each(function(){var n=$(this),t;n.prop("required")&&(validation.hideErrorMsg(n),t=validation.validationChecks(n),t||i++)}),validation.reCaptchaValidation()||i++,$(".customer-agreement").length&&$(".customer-agreement").hasClass("field-validation")&&($(".customer-agreement")[0].checked||i++),$(".email").length>0&&$(".email").hasClass("isFax")&&$(".email").hasClass("field-validation")&&!$(".email").parent().hasClass("has-error")&&(r=validation.EmailDuplicate($(".email"),!1),r||i++),i>0){try{n.prototype.scrollToElement(".has-error:first");$("div").hasClass("has-error")&&$("html, body").animate({scrollTop:$(".has-error:first").offset().top},500)}catch(u){Sentry.captureException(u);$(window).scrollTop($(".has-error").offset())}$(".customer-agreement").attr("checked",null);$(".agreement-error-message").show();$(".agreement").length>0&&$(".agreement,.btnValidate").attr("disabled","disabled").addClass("disabled");try{t.preventDefault();t.stopPropagation();t.stopImmediatePropagation()}catch(u){}return!1}return!0},n.prototype.showGeneralModal=function(n){$(n).modal({backdrop:"static",keyboard:!1})},n.prototype.hideGeneralModal=function(n){$(n).modal("hide")},n.prototype.setDropDownValue=function(n,t){if($(n).find("option[value='"+t+"']").length>0){var i=$(n).attr("id");return $("input#"+i+"[type='hidden']").val(t),$(n).val(t).change(),$(n).focusout(),!0}return!1},n.prototype.updateHiddenField=function(){$(".account-provision,.creditcardname,.creditcardnumber,.creditcard-exp-month,.creditcard-exp-year,.cvv,.creditcardtype, .creditcard-exp-monthyear").on("keyup",function(){var n=$(this),t,i;n.is("select")?n.find("option:selected").length>0&&n.find("option:selected").val().length>0&&(t=n.find("option:selected").val(),i=n.attr("name"),(i===undefined||i.length===0)&&(i=n.attr("id")),t!==undefined&&t.length>0&&$("input:hidden[name="+i+"]").val(t)):n.val().length>0&&(t=n.val(),t!==undefined&&t.length>0&&n.parent().find("input[type=hidden]").val(t))});$(".creditCardTypeRadioBtn, .creditCardTypeRadioBtn > input[type=radio]").on("click",function(){var t=$(this),n;t.val().length>0&&(n=t.val(),n!==undefined&&n.length>0&&t.parent().parent().find("input[type=hidden]").val(n))})},n.prototype.checkFieldValidation=function(n){var t=!0;$(".field-validation").each(function(){if(!$(this).hasClass("creditcardtype")&&(t=validation.validationChecks($(this),!0),!t&&!n))return!1});t&&($(".btnValidate").removeAttr("disabled").removeClass("disabled"),validation.disabledButtonClass!==null&&$(".btnValidate").hasClass(validation.disabledButtonClass)&&$(".btnValidate").removeClass(validation.disabledButtonClass).addClass(validation.enabledButtonClass))},n.prototype.provisionData=function(){$(".firstname").length&&$(".firstname").is(":visible")&&n.prototype.checkFieldValidation(!0);$(".creditcard-exp-month,.creditcard-exp-year").change(function(){n.prototype.checkFieldValidation(!1)});$(".account-provision,.creditcardname,.creditcardnumber,.creditcard-exp-month,.creditcard-exp-year,.cvv,.creditcardtype, .creditcard-exp-monthyear").bind("keyup",function(){var n=!0;$(".field-validation").each(function(){if(!$(this).hasClass("creditcardtype")&&$(this).is(":visible")&&($(this).is("input")&&!$(this).val().trim().length?n=!1:$(this).val()===null||$(this).val().trim().length||(n=!1),!n))return!1})});$(".account-provision,.creditcardname,.creditcardnumber,.creditcard-exp-month,.creditcard-exp-year,.cvv,.creditcardtype, .creditcard-exp-monthyear").focusout(function(){var t,u,f,i,r;if(n.prototype.checkFieldValidation(!1),t=$(this),t.hasClass("field-validation")&&t.prop("required")&&(validation.hideErrorMsg(t),u=validation.validationChecks(t),!u))return!1;t.parent().hasClass("has-error")||(t.is("select")?t.find("option:selected").length>0&&t.find("option:selected").val().length>0&&(f=t.attr("data-item"),i=t.find("option:selected").val(),r=t.attr("name"),(r===undefined||r.length===0)&&(r=t.attr("id")),i!==undefined&&i.length>0&&$("input:hidden[name="+r+"]").val(i)):(f=t.attr("data-item"),t.val().length>0&&(i=t.val(),i!==undefined&&i.length>0&&t.parent().find("input[type=hidden]").val(i))))})},n.prototype.submitForm=function(n){$(n).closest("form").submit()},n.prototype.placeHolder=function(){jQuery().placeholder&&$("input, textarea").placeholder()},n.prototype.phoneMask=function(){$(".USphone").inputmask(USphoneMask)},n.prototype.scrollToTopPage=function(n){$(n).animate({scrollTop:0},"fast")},n.prototype.scrollToElement=function(n){$(n).animate({scrollTop:0},"fast")},n.prototype.showErrorMessage=function(n){$("#errorMessage").find("p").html(n);$("#errorMessage").show();$("#errorMessageContainer").show().find(".alert-danger").html(n)},n.prototype.clearErrorMessage=function(){$("#errorMessage").find("p").html("");$("#errorMessage").hide();$("#errorMessageContainer").hide().find(".alert-danger").html("")},n.prototype.triggerDragAndDrop=function(n,t,i){var r,u=$(n).sortable({group:t,pullPlaceholder:!1,onDrop:function(n,t,r){var f=$("<li/>").css({height:0});n.before(f);f.animate({height:n.height()});n.removeClass("highlight");n.parent().hasClass("disabled")&&n.addClass("highlight");n.animate(f.position(),function(){f.detach();var s=u.sortable("serialize").get()[0],h=u.sortable("serialize").get()[1],e=[],o=[];$.each(s,function(n,t){var i={};i.id=t.id;i.name=t.name;e.push(i)});$.each(h,function(n,t){var i={};i.id=t.id;i.name=t.name;o.push(i)});i!==null&&(i.collectedList=e.length>0?JSON.stringify(e):"",i.disabledList=o.length>0?JSON.stringify(o):"",updateCurrency(i,i.collectedList,"CollectedList"),updateCurrency(i,i.disabledList,"DisabledList"));r(n,t)})},onDragStart:function(n,t,i){var u=n.offset(),f=t.rootGroup.pointer;r={left:f.left-u.left,top:f.top-u.top};i(n,t)},onDrag:function(n,t){n.css({left:t.left-r.left,top:t.top-r.top})}})},n.prototype.containsImagePath=function(n){return/\.(gif|jpg|jpeg|tiff|png)$/i.test(n)},n.prototype.convertStringToBool=function(n){return n.toLowerCase()==="true"?!0:!1},n.prototype.getGeoInfoCountry=function(){return this.getCookie("GEOINFO")!==undefined?this.getValueFromCookie("GEOINFO","country"):undefined},n.prototype.getGeoInfoState=function(){return this.getCookie("GEOINFO")!==undefined?this.getValueFromCookie("GEOINFO","state"):undefined},n.prototype.slidePanel=function(n,t){$(n).click(function(){$(t).toggle("slide",{direction:"left"},1e3)})},n.prototype.hideEditButton=function(n){$(".rdTitleBar:first-child:contains("+n+")").each(function(){$(this).find(".rdCommands").find(".rdMoreCommand").attr("style","border: 0px !important").end().find('a[title="Edit"]').parent().hide()})},n.prototype.hideAdvanceButton=function(){$(document).find("a:contains('Advanced')").hide()},n.prototype.getCookie=function(n){try{return Cookies.get(n)}catch(t){return Sentry.captureException(t),""}},n.prototype.getValueFromCookie=function(n,t){var i=this.getCookieJson(n),r="";return i!==undefined&&$.each(i.split("&"),function(n,i){var u=i.split("=");if(u[0]===t){r=u[1];return}}),r},n.prototype.getCookieJson=function(n){try{return Cookies.getJSON(n)}catch(t){return Sentry.captureException(t),""}},n.prototype.setCookie=function(n,t){Cookies.set(n,t)},n.prototype.removeCookie=function(n){try{return Cookies.remove(n)}catch(t){return Sentry.captureException(t),""}},n.prototype.redirect=function(n,t){var i=window.location.search;window.location.href=t?n:n+i},n.prototype.displaySpinner=function(t,i,r){var u=n.prototype.getMessageByMessageTypeID(MessagesType.Loading);switch(r){case"lrg":$(t).html('<div class="loadingImg"><div class="lds-ellipsis"><div><\/div><div><\/div><div><\/div><div><\/div><\/div>'+(i?"<div>..."+u+"...<\/div>":"")+"<\/div>");break;case"med":$(t).html('<div class="loadingImg"><div class="lds-ellipsis"><div><\/div><div><\/div><div><\/div><div><\/div><\/div>'+(i?"<div>..."+u+"...<\/div>":"")+"<\/div>");break;case"sml":$(t).html('<div class="loadingImg"><div class="lds-ellipsis"><div><\/div><div><\/div><div><\/div><div><\/div><\/div>'+(i?"<div>..."+u+"...<\/div>":"")+"<\/div>");break;case"xsml":$(t).html('<div class="loadingImg"><div class="lds-ellipsis"><div><\/div><div><\/div><div><\/div><div><\/div><\/div>'+(i?"<div>..."+u+"...<\/div>":"")+"<\/div>")}},n.prototype.hideLoadingModal=function(){$("#loading-modal,#account-modal,.modal").modal("hide")},n.prototype.fixedEncodeURIComponent=function(n){try{return encodeURIComponent(n).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16)})}catch(t){return Sentry.captureException(t),""}},n.prototype.disableDefaultDropdownOption=function(){var i=localStorage.getItem("j2.dropdownbackground")!==null?localStorage.getItem("j2.dropdownbackground"):null,n,t;i!==undefined&&i!==null&&i!=""&&(n=JSON.parse(localStorage.getItem("j2.dropdownbackground")).disabled,t=JSON.parse(localStorage.getItem("j2.dropdownbackground"))["default"],n!==undefined&&n!==null&&t!==undefined&&n!=null&&($(".disable-dropdown select").change(function(){$(this).val()===""||$(this).val()===null||$(this).val()==="-1"?($(this).css("background-color",n),$(this).find("option").css("background-color",t)):$(this).css("background-color",t)}),$(".disable-dropdown select").each(function(){$(this).val()==""||$(this).val()===null||$(this).val()==="-1"?($(this).css("background-color",n),$(this).find("option").css("background-color",t)):$(this).css("background-color",t)})))},n.prototype.clearLocalStorageItems=function(n){$.each(n,function(n,t){localStorage.removeItem(t)})},n.prototype.getMessageList=function(){return localStorage.getItem("j2.messages")},n.prototype.getCookiePolicyCotent=function(){var t,i,r,u;return t=n.prototype.getMessageByMessageTypeID(MessagesType.CookiePolicy),i=n.prototype.getMessageByMessageTypeID(MessagesType.CookieDismissText),r=n.prototype.getMessageByMessageTypeID(MessagesType.CookiePolicyLink),u=n.prototype.getMessageByMessageTypeID(MessagesType.CookieHref),{message:t,dismiss:i,link:r,href:u}},n.prototype.localStorageSize=function(){var i=0,n;for(var t in localStorage)n=((localStorage[t].length||0)+(t.length||0))*2,i+=n,console.log(t.substr(0,50)+" = "+(n/1024).toFixed(2)+" KB");return(i/1024).toFixed(2)+" KB"},n.prototype.saveUserCollectionToLocalStorage=function(n,t){var i=localStorage.getItem(cachedItems.userCollection)!==null?localStorage.getItem(cachedItems.userCollection):{},r=i.length>0?JSON.parse(i):i;r[n]=t;localStorage.setItem(cachedItems.userCollection,JSON.stringify(r))},n.prototype.saveConfirmationCollectionToLocalStorage=function(n,t){var i=localStorage.getItem(cachedItems.confirmationCollection)!==null?localStorage.getItem(cachedItems.confirmationCollection):{},r=i.length>0?JSON.parse(i):i;r[n]=t;localStorage.setItem(cachedItems.confirmationCollection,JSON.stringify(r))},n.prototype.getMessageByMessageTypeID=function(t){var r=n.prototype.getMessageList(),i=null;return $.each(jQuery.parseJSON(r),function(n,r){if(r.MessageTypeID===t)return i=r.MessageDisplayed,!0}),i},n.prototype.cookiePolicy=function(){(n.prototype.getCookie("cookieconsent_status")===undefined||n.prototype.getCookie("cookieconsent_status")!=="dismiss")&&window.addEventListener("load",function(){localStorage.getItem(cachedItems.messages)===null?setTimeout(function(){window.cookieconsent.initialise({palette:{popup:{background:cookiePolicyOptions.popupBackgroundColor,text:cookiePolicyOptions.popupTextColor},button:{background:cookiePolicyOptions.buttonColor}},cookie:{expiryDays:cookiePolicyOptions.expireyDay},content:n.prototype.getCookiePolicyCotent()})},1e3):window.cookieconsent.initialise({palette:{popup:{background:cookiePolicyOptions.popupBackgroundColor,text:cookiePolicyOptions.popupTextColor},button:{background:cookiePolicyOptions.buttonColor}},cookie:{expiryDays:cookiePolicyOptions.expireyDay},content:n.prototype.getCookiePolicyCotent()})})},n.prototype.addScriptTag=function(n){var t=document.createElement("script");t.src=n;document.body.appendChild(t)},n.prototype.triggerScriptAfterLoad=function(t){window.addEventListener?window.addEventListener("load",n.prototype.addScriptTag(t),!1):window.attachEvent?window.attachEvent("onload",n.prototype.addScriptTag(t)):window.onload=n.prototype.addScriptTag(t)},n.prototype.showSessionModal=function(){$("#session-modal").modal({backdrop:"static",keyboard:!1})},n}();n.global=t}(j2||(j2={}));global=new j2.global;cookiePolicyOptions={popupBackgroundColor:"#edeff5",popupTextColor:"#838391",buttonColor:"#4b81e8",expireyDay:30};String.prototype.toTitleCase=function(n){var t=this;return 1!==n&&(t=t.toLowerCase()),t.replace(/(^|\s)[a-z]/g,function(n){return n.toUpperCase()})};Array.prototype.remove=function(){for(var n,t=arguments,i=t.length,r;i&&this.length;)for(n=t[--i];(r=this.indexOf(n))!==-1;)this.splice(r,1);return this};creditCardExpirationValidation={init:function(){var n=$(".creditcard-exp-monthyear");if(n.length>0)n.on("keypress",function(n){creditCardExpirationValidation.restrictNumeric(n);creditCardExpirationValidation.restrictCombinedExpiration(n);creditCardExpirationValidation.formatExpiration(n)})},errorElement:$(".creditcard-exp-monthyear").closest("span"),formatExpiration:function(n){creditCardExpirationValidation.errorElement.html("");var r,i,t;if(r=String.fromCharCode(n.which),/^\d+$/.test(r))return(i=n.target,t=creditCardExpirationValidation.val(i)+r,/^\d$/.test(t)&&t!=="0"&&t!=="1")?(n.preventDefault(),creditCardExpirationValidation.val(i,"0"+t+" / "),this.trigger(i,"change")):/^\d\d$/.test(t)?(n.preventDefault(),creditCardExpirationValidation.val(i,t+" / "),creditCardExpirationValidation.trigger(i,"change")):void 0},restrictExpiration:function(n,t){var r,u,i;if(u=n.target,r=String.fromCharCode(n.which),/^\d+$/.test(r))return i=creditCardExpirationValidation.val(u)+r,i=i.replace(/\D/g,""),i.length>t?n.preventDefault():void 0},restrictNumeric:function(n){var t;return n.metaKey||n.ctrlKey?!0:n.which===32?n.preventDefault():n.which===0?!0:n.which<33?!0:(t=String.fromCharCode(n.which),/[\d\s]/.test(t)?void 0:n.preventDefault())},restrictCombinedExpiration:function(n){return creditCardExpirationValidation.restrictExpiration(n,4)},carriageReturn:/\r/g,val:function(n,t){var i;return arguments.length>1?n.value=t:(i=n.value,typeof i=="string"?i.replace(creditCardExpirationValidation.carriageReturn,""):i===null?"":i)},trigger:function(n,t,i){var u,f,r;try{r=new CustomEvent(t,{detail:i})}catch(f){u=f;Sentry.captureException(u);r=document.createEvent("CustomEvent");r.initCustomEvent?r.initCustomEvent(t,!0,!0,i):r.initEvent(t,!0,!0,i)}return n.dispatchEvent(r)}},function(n){var t=function(){function n(){var n=this;$(document).ready(function(){n.rules()})}var i='<i class="fa fa-exclamation-triangle"><\/i>&nbsp;',t=[],r="�";return n.prototype.disabledButtonClass=null,n.prototype.enabledButtonClass=null,n.prototype.BucketList=[],n.prototype.ErrorCheckList=[],n.prototype.rules=function(){var t=1;$("input[required]").each(function(){n.prototype.BucketList.push(t++)});$(".restrict-char").alphanum({allow:"()&\\'.,\"-#_+/[]",disallow:'\ud83c[\udf00-\udfff]\ud83d[\udc00-\ude4f]\ud83d[\ude80-\udeff]',allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0});$(".alphaOnly").alphanum({disallow:'\ud83c[\udf00-\udfff]\ud83d[\udc00-\ude4f]\ud83d[\ude80-\udeff]',allowSpace:!0,allowNumeric:!1,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0});$(".phonenumber-extension").alphanum({allow:"xX0123456789",disallow:"!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- _",allowNumeric:!0,allowCaseless:!1,allowLatin:!1});$(".numbers-only, .cvv, .existingNumber").numeric({allow:"0123456789",allowNumeric:!0,disallow:"!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- _"});$(".numbers-only-cc").numeric({allowNumeric:!0,maxDigits:16,disallow:"!@#$%^&*()+=[]\\';,/{}|\":<>?~`.- _"});creditCardExpirationValidation.init()},n.prototype.reCaptchaValidation=function(){if($(".g-recaptcha").length>0&&$(".container-recaptcha").is(":visible")){var n=$("#recaptcha-error");if(n.hide(),grecaptcha!=undefined&&grecaptcha.getResponse()=="")return n.show(),!1}return!0},n.prototype.validationChecks=function(r,u){var e=!0,c,y,s,h,k,d,g,nt,tt,it,rt,p,f;if(u==!0&&(e=!1),r.hasClass("creditcard-exp-monthyear")&&$(".container-creditcard").is(":visible")){if(n.prototype.hideErrorMsg(r),r.val().length==0)return n.prototype.fieldValidation(r,e),!1;if(c=global.getMessageByMessageTypeID(MessagesType.CreditCardExpiration),f=r.val().split(" / "),f.length<2)return r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+c).show(),!1;var w=new Date,l=f[0],a=f[1],v=w.getFullYear().toString().substr(-2),f=l>=1&&l<=12&&a>=v&&a<parseInt(v)+20&&(a==v?l>=w.getMonth()+1:!0);if(!f)return e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+c).show()),!1}if(r.hasClass("creditcardname")&&$(".container-creditcard").is(":visible")){if(y=r.val(),s=y.match(j2RegEx.TwoOrMoreWords),n.prototype.hideErrorMsg(r),y.length==0)return n.prototype.fieldValidation(r,e),!1;if(s&&s.length<2||s==null)return e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+r.attr("data-error")).show(),r.attr("data-error")in t||t.push(r.attr("data-error")),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1}if(r.hasClass("cvv")&&$(".container-creditcard").is(":visible")){n.prototype.hideErrorMsg(r);var b=r.val(),ut=$(".creditcardtype:first").is("select"),o="";if(o=ut?$(".creditcardtype:first").find("option:selected").text():$(".creditcardtype").is(":checkbox")?$($(".creditcardtype").find("input[type=radio]:checked")).prop("id"):$("#CreditCardType").val(),o!=undefined&&o.length>0&&(h=3,(o.toLowerCase()==="amex"||o.toLowerCase()==="american express")&&(h=4),b.length<h||b.length>h))return e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+r.attr("data-error")).show(),r.attr("data-error")in t||t.push(r.attr("data-error")),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;if(f=n.prototype.fieldValidation(r,e),!f)return f}if(r.hasClass("creditcardnumber")&&$(".container-creditcard").is(":visible")){if(n.prototype.hideErrorMsg(r),k=r.val().replace(/\s/g,""),d=j2RegEx.CreditCardLength,!d.test(k))return e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+r.attr("data-error")).show(),r.attr("data-error")in t||t.push(r.attr("data-error")),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;if(f=n.prototype.fieldValidation(r,e),!f)return f}if(r.hasClass("zipcode")&&r.is(":visible")&&(!r.hasClass("disabled")||!n.prototype.hasAttribute("disabled"))){if(n.prototype.hideErrorMsg(r),g=n.prototype.ZipCodeValidation(r),!g)return e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+r.attr("data-error")).show(),r.attr("data-error")in t||t.push(r.attr("data-error")),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;if(f=n.prototype.fieldValidation(r,e),!f)return f}if(r.hasClass("companyName")&&r.is(":visible"))return(n.prototype.hideErrorMsg(r),nt=r.prop("maxlength"),tt=global.utf8LengthCheck(r.val()),tt>nt)?(e&&(r.parent().addClass("has-error"),$("#"+r.prop("id")+"-error").html(i+global.getMessageByMessageTypeID(MessagesType.CompanyLength)).show(),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1):!0;if(r.hasClass("phone")&&r.hasClass("None")){if(n.prototype.hideErrorMsg(r),it=r.val().replace(j2RegEx.DigitsOnly,""),rt=r.attr("data-minlength"),it.length<parseInt(rt))return e&&(r.parent().addClass("has-error"),p=r.attr("data-errorPhoneNumber"),$("#"+r.prop("id")+"-error").html(i+p).show(),r.attr("data-error")in t||t.push(p),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;e&&n.prototype.AddElementToErrorCheckList(r.attr("id"),!1)}if(r.hasClass("email")&&r.hasClass("field-validation"))return(global.clearErrorMessage(),n.prototype.hideErrorMsg($(".email")),f=n.prototype.emailValidation(r,e),!f)?f:(f=n.prototype.EmailCompare(e),!f)?f:(n.prototype.EmailCompareMsgCheck(),n.prototype.EmailDuplicate(r));if(r.hasClass("emailconfirm")&&r.hasClass("field-validation"))return(global.clearErrorMessage(),n.prototype.hideErrorMsg($(".emailconfirm")),f=n.prototype.emailValidation(r,e),!f)?f:(f=n.prototype.EmailCompare(e),!f)?f:(n.prototype.EmailCompareMsgCheck(),n.prototype.EmailDuplicate(r));if((r.hasClass("password")||r.hasClass("passwordconfirm"))&&r.hasClass("field-validation")&&(global.clearErrorMessage(),$(".password").length>0&&$(".passwordconfirm").length>0)){if($("#"+$(".password").attr("id")).parent().find("input[type=hidden]").val($(".password").val()),$(".password").val().length===0||$(".passwordconfirm").val().length===0||$(".password").val().toLowerCase()!==$(".passwordconfirm").val().toLowerCase())return e&&($(".password").parent().addClass("has-error"),$(".passwordconfirm").parent().addClass("has-error"),$("#"+$(".password").prop("id")+"-error").html(i+"Passwords do not match").show(),$("#"+$(".passwordconfirm").prop("id")+"-error").html(i+"Passwords do not match").show(),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;if(this.passwordResult==="Weak"||this.passwordResult==="Too short")return e&&($(".password").parent().addClass("has-error"),$(".passwordconfirm").parent().addClass("has-error"),$("#"+$(".password").attr("id")+"-error").html(i+"Password is "+this.passwordResult).show(),$("#"+$(".passwordconfirm").attr("id")+"-error").html(i+"Password is "+this.passwordResult).show(),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1;n.prototype.hideErrorMsg($(".password"));n.prototype.hideErrorMsg($(".passwordconfirm"))}if(r.hasClass("existingNumber")&&r.hasClass("field-validation")){if(e=!0,!n.prototype.fieldValidation(r,e))return $(".numberLockedbtn:first").attr("disabled","disabled"),e&&n.prototype.removeElementFromErrorCheckList(r.attr("id")),!1;$("#SelectedPhoneNumber:first")!=undefined&&$("#SelectedPhoneNumber:first").val()!=undefined&&$("#SelectedPhoneNumber:first").val().length>0&&$(".existingNumber").val().length>0&&$(".numberLockedbtn:first").attr("disabled",null).removeClass("disabled")}return r.hasClass("customer-agreement")&&r.hasClass("field-validation")&&!n.prototype.fieldValidation(r,e)?(e&&n.prototype.removeElementFromErrorCheckList(r.attr("id")),!1):(f=!1,r.hasClass("field-validation")&&r.is(":visible")&&!r.prop("disabled")&&(n.prototype.hideErrorMsg(r),f=n.prototype.fieldValidation(r,e),!f))?f:(e&&n.prototype.AddElementToErrorCheckList(r.attr("id"),!1),!0)},n.prototype.EmailCompareMsgCheck=function(){var t=$(".email"),i=$(".emailconfirm");if(t.length>0&&i.length>0&&t.val().toLowerCase()!=i.val().toLowerCase()&&i.val().length>0&&t.val().length>0&&!n.prototype.compareEmailError){var r=global.getMessageByMessageTypeID(MessagesType.EmailCompare),u=$("#"+t.prop("id")+"-error:contains('"+r+"')").length>0,f=$("#"+i.prop("id")+"-error:contains('"+r+"')").length>0;(u||f)&&(n.prototype.hideErrorMsg($(".email")),n.prototype.hideErrorMsg($(".emailconfirm")))}},n.prototype.EmailCompare=function(t){var r=$(".email"),u=$(".emailconfirm"),f;return r.length>0&&u.length>0&&r.val().toLowerCase()!==u.val().toLowerCase()&&u.val().length>0&&r.val().length>0?(t&&(f=global.getMessageByMessageTypeID(MessagesType.EmailCompare),$("#"+r.prop("id")+"-error").html(i+f).show(),$("#"+u.prop("id")+"-error").html(i+f).show(),$("#"+r.attr("id")).parent().find("input[type=hidden]").val($(".email").val()),n.prototype.compareEmailError=!0,n.prototype.removeElementFromErrorCheckList(r.attr("id")),n.prototype.removeElementFromErrorCheckList(u.attr("id"))),!1):(n.prototype.compareEmailError=!1,!0)},n.prototype.emailValidation=function(r,u){r.val($.trim(r.val()));var f=r.formance("validate_email");return(f&&(f=j2RegEx.EmailRegEx.test(r.val())),!f)?(u&&(r.parent().addClass("has-error"),t.push(r.attr("data-invalidemail")),ErrorValidation.displayErrorSummary||$("#"+$(r).prop("id")+"-error").html(i+$(r).attr("data-invalidemail")).show(),n.prototype.removeElementFromErrorCheckList(r.attr("id"))),!1):(u&&n.prototype.AddElementToErrorCheckList(r.attr("id"),$(".emailconfirm").length>0?!0:!1),!0)},n.prototype.EmailDuplicate=function(r){if(r.hasClass("isFax")){global.displaySpinner("#processEmailSpinner",!1,"xsml");var u=r.val();$.get(appRoot+"GeneralFunnel/Demographics",{email:global.fixedEncodeURIComponent(u)},function(){}).done(function(u){try{$("#processEmailSpinner").html("");var f=u.result;if(f.Errors.length>0)return $(".customer-agreement").attr("checked",null),r.parent().addClass("has-error"),ErrorValidation.displayErrorSummary||$("#"+r.prop("id")+"-error").html(i+global.getMessageByMessageTypeID(MessagesType.DuplicateEmail)).show(),r.attr("data-error")in t||t.push(global.getMessageByMessageTypeID(MessagesType.DuplicateEmail)),n.prototype.removeElementFromErrorCheckList(r.attr("id")),!1}catch(e){return Sentry.captureException(e),n.prototype.removeElementFromErrorCheckList(r.attr("id")),!1}return!0}).fail(function(){return r.parent().addClass("has-error"),ErrorValidation.displayErrorSummary||$("#"+r.prop("id")+"-error").html(i+global.getMessageByMessageTypeID(MessagesType.GeneralErrorMessage)).show(),r.attr("data-error")in t||t.push(global.getMessageByMessageTypeID(MessagesType.DuplicateEmail)),$("#processEmailSpinner").html(""),n.prototype.removeElementFromErrorCheckList(r.attr("id")),!1});$(".btnValidate").hasClass("agreement")||$(".btnValidate").removeAttr("disabled").removeClass("disabled")}return n.prototype.AddElementToErrorCheckList(r.attr("id"),!1),!0},n.prototype.ZipCodeValidation=function(n){var t=$(".country option:selected").val(),i,r;return t!=undefined&&t.length>0&&(i=postalValidation.RegEx(t),i.length>0)?(r=new RegExp(i),r.test(n.val())):!0},n.prototype.hideErrorMsg=function(n){n.parent().removeClass("has-error");$("#"+n.prop("id")+"-error").hide()},n.prototype.fieldValidation=function(u,f){var e=u;return e.val()==null||e.val().indexOf(r)>-1||e.attr("data-minlength")!=undefined&&e.val().replace(/ /g,"").length<e.attr("data-minlength")||e.attr("data-error")!=undefined&&e.attr("data-error").length>0&&e.val().replace(/ /g,"").length==0||e.attr("data-error")!=undefined&&e.attr("data-error").length>0&&(e.find("option:selected").val()=="-1"||e.find("option:selected").val()=="")||e.is(":checkbox")&&!e.is(":checked")?(f&&(e.parent().addClass("has-error"),ErrorValidation.displayErrorSummary||$("#"+e.prop("id")+"-error").html(i+e.attr("data-error")).show(),e.val($.trim(e.val())),e.attr("data-error")in t||t.push(e.attr("data-error")),n.prototype.removeElementFromErrorCheckList(e.attr("id"))),!1):(f&&n.prototype.AddElementToErrorCheckList(e.attr("id"),!1),!0)},n.prototype.removeElementFromErrorCheckList=function(t){$(".btnValidate").removeClass("btnHighlightStyle");n.prototype.ErrorCheckList.remove(t)},n.prototype.AddElementToErrorCheckList=function(t,i){t==undefined||i||(jQuery.inArray(t,n.prototype.ErrorCheckList)===-1&&n.prototype.ErrorCheckList.push(t),n.prototype.ErrorCheckList.length===n.prototype.BucketList.length&&$(".btnValidate").hasClass("proceedBtnHighlight")&&$(".btnValidate").addClass("btnHighlightStyle"))},n.prototype.hasAttribute=function(n){return!!element.attr(n)},n.prototype.validate=function(i){var r,u;return(t=[],r=$(i).find("button").attr("id"),$("#errorSummary-"+r).html(""),$(i).find("button").attr("disabled","disabled"),$(i).find("div").removeClass("has-error"),$(i).find("input").each(function(){$(this).attr("required")&&($("#"+$(this).prop("id")+"-error").hide(),$(this).hasClass("email")&&$(this).val().replace(/ /g,"").length>0?n.prototype.emailValidation($(this)):($(this).parent().addClass("has-error"),n.prototype.fieldValidation($(this)),n.prototype.validationChecks($(this))))}),$(i).find("select").each(function(){$(this).attr("required")&&$(this).attr("data-error").length>0&&($(this).val()==-1||$(this).val()=="")&&($(this).parent().addClass("has-error"),t.push($(this).attr("data-error")))}),t.length>0)?(ErrorValidation.displayErrorSummary&&(u=[],$.each(t,function(n,t){u.push("<div>"+t+"<\/div>")}),$("#errorSummary-"+r).html(u.join(""))),$(i).find("button").attr("disabled",null),!1):!0},n}();n.validation=t}(j2||(j2={}));validation=new j2.validation;ErrorValidation={displayErrorSummary:!1};$(document).ready(function(){function n(n){var t=0;return n.length<6?($("#result").removeClass(),$("#result").addClass("short"),"Too short"):(n.length>7&&(t+=1),n.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(t+=1),n.match(/([a-zA-Z])/)&&n.match(/([0-9])/)&&(t+=1),n.match(/([!,%,&,@,#,$,^,*,?,_,~])/)&&(t+=1),n.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)&&(t+=1),t<2?"Weak":t==2?"Good":"Strong")}$(".password").keyup(function(){validation.passwordResult=n($(".password").val())})}),function(n){var t=[];n.preLoadImages=function(){for(var n,r=arguments.length,i=r;i--;)n=document.createElement("img"),n.src=arguments[i],t.push(n)}}(jQuery);ErrorHandling={HandleError:function(n,t){try{Sentry.captureException(n+t===undefined?"":"; customMessage: "+t);$.ajax({type:"POST",dataType:"json",async:!1,url:appRoot+"HandleError",data:{errorMessage:n,custom:t===undefined?"":t},success:function(){}})}catch(i){}}};$(document).ready(function(){try{var n=!!navigator.userAgent.match(/Trident.*rv\:11\./);n||(Sentry.init({dsn:sentry}),Sentry.configureScope(function(n){n.setTag("domain",location.hostname);n.setTag("country",global.getGeoInfoCountry());n.setTag("userinfoID",localStorage.getItem("j2.userCollection")!==null?JSON.parse(localStorage.getItem("j2.userCollection")).userinfoid:null)}))}catch(t){}})