$(document).ready(function(){function n(n){try{var t={},i=$(n).data("page-position");return i&&(t.pagePosition=i),t}catch(r){return{}}}$("form.findAgentForm").each(function(){$(this).UX().validate({rules:{ZipCode:{minlength:5,maxlength:5,digits:!0}},messages:{ZipCode:{required:"Please enter a valid 5 digit Zip Code."}}})});$("form.searchForAgentsForm").each(function(){$(this).UX().validate({rules:{ZipCode:{minlength:5,maxlength:5,digits:!0}},submitHandler:function(t){var e=this,u={},f=n(t),r,i,o;$($(t).serializeArray()).each(function(){u[this.name]=this.value});r=u.Product.replace(/\s*\+*/g,"").toUpperCase();try{i=loadingOptions.defaultOption(t)}catch(s){}return typeof _gaObj!="undefined"&&_gaObj instanceof Object&&_gaObj.GATrackEvent("progCom","FindAgent-Attempt",r,0,!1,f),o=(new Date).getTime(),$.ajax({url:$(t).attr("action"),type:"POST",data:JSON.stringify(u),dataType:"json",contentType:"application/json; charset=utf-8",retryCount:1,tryCount:0,error:function(n,t,u){if(typeof i=="function")try{i.call()}catch(h){}try{var e="",s=(new Date).getTime()-o;e+="status="+n.status;e+=";jqError="+t;e+=";serverError="+u;e+=";Time Taken(ms)="+s;HandleException({errorCode:15044,errorMessage:e,errorCategory:"Ajax",errorType:"FAA",sevlvl:"Error"})}catch(c){}try{typeof _gaObj!="undefined"&&_gaObj instanceof Object&&_gaObj.GATrackEvent("progCom","FindAgent-Failed",r,0,!1,f)}catch(c){}},success:function(n){if(typeof i=="function")try{i.call()}catch(u){}if(n.ResponseType=="Success")typeof _gaObj!="undefined"&&_gaObj instanceof Object&&typeof dataLayer!="undefined"&&_gaObj.GATrackEvent("progCom","FindAgent",r,0,!1,f),window.location=n.RedirectUrl;else if(n.RedirectUrl)window.location=n.RedirectUrl;else{var t={};n.ResponseType=="ZipNotFoundError"&&$.extend(t,{ZipCode:"Please enter the ZIP code where you live."});n.ResponseType=="StateProductExclusion"&&$.extend(t,{ZipCode:"Sorry, this product is not available in this state."});n.ResponseType=="FaaInvalidZipCodeError"&&$.extend(t,{ZipCode:"Incorrectly formatted zip code."});$.isEmptyObject(t)&&$.extend(t,{ZipCode:"We're having technical issues. We're sorry for the inconvenience."});e.showErrors(t);$(e.errorList[0].element).focus()}}}),!1}})})})