function gacallagent(){var n=$(window).width();return n<768?(GoogleEventTracking("Join Us - Phone Number Click"),!0):!1}$(function(){function n(n,t){n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),i=r.exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}$(document).on("click","#contactSubmitBtn",function(){var f=null,t,i,r;$("#FirstName").val()!="Name"&&(f=$("#FirstName").val());t=null;$("#Email").val()!="Email"&&(t=$("#Email").val());i=null;$("#Phone").val()!="Phone"&&(i=$("#Phone").val());r=null;$("#PostalCode").val()!="Postal Code"&&(r=$("#PostalCode").val());var u=window.parent.document.URL,o=n("utm_source",u),s=n("utm_medium",u),h=n("utm_campaign",u),c=document.referrer,l=window.location.pathname,a=window.navigator.userAgent,e;e=navigator.userAgent.indexOf("Mobile")>0?"Mobile":navigator.userAgent.indexOf("Tablet")>0?"Tablet":"Desktop";$.ajax("/JoinUs/AddCareerLead",{cache:!1,async:!0,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify({FirstName:f,Email:t,Phone:i,PostalCode:r,UtmSource:o,UtmMedium:s,UtmCampaign:h,Referrer:c,HeaderInfo:a,DeviceType:e,Url:l}),beforeSend:function(){$("#LeadAjaxLoading").show()},success:function(){$("#LeadAjaxLoading").hide();GoogleEventTracking("Join Us - Become Agent");$("#sucessLabel").css("display","block");$("#sucessLabel").css("visibility","visible");$("#errorLabel").html("");$("#errorLabel").css("visibility","hidden");$(".contact-form div").removeClass("validate");$(".contact-form div input").removeClass("validate");$(".contact-form div select").removeClass("validate");$("#sucessLabel_M").css("display","block");$("#sucessLabel_M").css("visibility","visible");$("#errorLabel_M").html("");$("#errorLabel_M").css("visibility","hidden")},error:function(n){var i,t;for($("#LeadAjaxLoading").hide(),console.log("Error"),$("#sucessLabel").css("display","block"),$("#sucessLabel").css("visibility","hidden"),$("#errorLabel").html(""),$("#errorLabel").css("display","block"),$("#sucessLabel_M").css("display","block"),$("#sucessLabel_M").css("visibility","hidden"),$("#errorLabel_M").html(""),$("#errorLabel_M").css("display","block"),$(".contact-form div input").removeClass("validate"),$(".contact-form div input").removeClass("validate"),$(".contact-form div select").removeClass("validate"),i=JSON.parse(n.responseText),t=0;t<i.errors.length;t++){var u=i.errors[t],f=u.Key,r=u.Message;console.log(f+": "+r);$("#errorLabel").append(r+"<br>");$("#errorLabel_M").append(r+"<br>");$("#"+f).addClass("validate")}$("#errorLabel").css("visibility","visible");$("#errorLabel_M").css("visibility","visible")}})});$(document).on("click","#fiftyYrsLink",function(){$("html,body").animate({scrollTop:$("#FiftyYearsContainer").offset().top-100},"slow")});$(document).on("click","#topProducersLink",function(){$("html,body").animate({scrollTop:$("#CultureContainer").offset().top-100},"slow")});$(document).on("click","#technologiesLink",function(){$("html,body").animate({scrollTop:$("#TechnologyContainer").offset().top-100},"slow")})});$(document).ready(function(){$("#Country").val("US");var n=$("#Country").val();n!=""?n=="US"?$("#CountryCode").hide():$("#CountryCode").show():$("#CountryCode").hide()});$("#Country").change(function(){var n=$(this).val();n!=""?n=="US"?$("#CountryCode").hide():$("#CountryCode").show():$("#CountryCode").hide()});$("#CallZipCode").keyup(function(n){var t,i;n.keyCode==13&&(t=null,$("#CallZipCode").val()!="Postal/Zip Code"&&(t=$("#CallZipCode").val()),t!=null&&t?(i=$("#SiteType").val(),$.ajax("/JoinUs/GetCareerLeadManagerInfoByType",{cache:!1,async:!0,type:"POST",data:{type:i,zipcode:t},beforeSend:function(){$("#LeadAjaxLoading").show()},success:function(n){if($("#LeadAjaxLoading").hide(),n.LeadContactName&&n.LeadContactPhNum){var t=$(window).width();$("#callContainer").hide();$("#callAgntname").html(n.LeadContactName);$("#idcallagent").html(n.LeadContactPhNum);t<768&&$("#idcallagent").attr("href","tel:"+n.LeadContactPhNum);$("#callAgntname").css("display","block");$("#callAgntphone").css("display","block");$("#errorLabel").html("");$("#errorLabel").css("visibility","hidden");$("#sucessLabel").html("");$("#sucessLabel").css("visibility","hidden")}else $("#errorLabel").html("Some error occured.  Please try later"),$("#errorLabel").css("display","block"),$("#errorLabel").css("visibility","visible")},error:function(){$("#LeadAjaxLoading").hide();console.log("Error");$("#sucessLabel").css("display","block");$("#sucessLabel").css("visibility","hidden");$("#errorLabel").html("Some error occured.  Please try later");$("#errorLabel").css("display","block");$("#errorLabel").css("visibility","visible")}})):($("#errorLabel").html("Please enter valid zipcode."),$("#errorLabel").css("display","block"),$("#errorLabel").css("visibility","visible")))});$("#CallZipCode_M").keyup(function(n){var t,i;n.keyCode==13&&(t=null,$("#CallZipCode_M").val()!="Postal/Zip Code"&&(t=$("#CallZipCode_M").val()),t!=null&&t?(i=$("#SiteType").val(),$.ajax("/JoinUs/GetCareerLeadManagerInfoByType",{cache:!1,async:!0,type:"POST",data:{type:i,zipcode:t},beforeSend:function(){$("#LeadAjaxLoading").show()},success:function(n){if(GoogleEventTracking("Join Us - Connect with a broker"),$("#LeadAjaxLoading").hide(),n.LeadContactName&&n.LeadContactPhNum){var t=$(window).width();$("#callContainer").hide();$("#callAgntname").html(n.LeadContactName);$("#idcallagent").html(n.LeadContactPhNum);t<768&&$("#idcallagent").attr("href","tel:"+n.LeadContactPhNum);$("#callAgntname").css("display","block");$("#callAgntphone").css("display","block");$("#errorLabel_M").html("");$("#errorLabel_M").css("visibility","hidden")}else $("#errorLabel_M").html("Some error occured.  Please try later"),$("#errorLabel_M").css("display","block"),$("#errorLabel_M").css("visibility","visible")},error:function(){$("#LeadAjaxLoading").hide();console.log("Error");$("#sucessLabel_M").css("display","block");$("#sucessLabel_M").css("visibility","hidden");$("#errorLabel_M").html("Some error occured.  Please try later");$("#errorLabel_M").css("display","block");$("#errorLabel_M").css("visibility","visible")}})):($("#errorLabel").html("Please enter valid zipcode."),$("#errorLabel").css("display","block"),$("#errorLabel").css("visibility","visible")))});$(function(){$(document).on("click","#callNwClick",function(){var n=null,t;$("#CallZipCode")&&$("#CallZipCode").val()!="Postal/Zip Code"&&(n=$("#CallZipCode").val());$("#CallZipCode_M")&&$("#CallZipCode_M").val()!="Postal/Zip Code"&&(n=$("#CallZipCode_M").val());n!=null&&n?(t=$("#SiteType").val(),$.ajax("/JoinUs/GetCareerLeadManagerInfoByType",{cache:!1,async:!0,type:"POST",data:{type:t,zipcode:n},beforeSend:function(){$("#LeadAjaxLoading").show()},success:function(n){if(GoogleEventTracking("Join Us - Connect with a broker"),$("#LeadAjaxLoading").hide(),n.LeadContactName&&n.LeadContactPhNum){var t=$(window).width();$("#callContainer").hide();$("#callAgntname").html(n.LeadContactName);$("#idcallagent").html(n.LeadContactPhNum);t<768&&$("#idcallagent").attr("href","tel:"+n.LeadContactPhNum);$("#callAgntname").css("display","block");$("#callAgntphone").css("display","block");$("#errorLabel").html("");$("#errorLabel").css("visibility","hidden");$("#sucessLabel").html("");$("#sucessLabel").css("visibility","hidden")}else $("#errorLabel").html("Some error occured.  Please try later"),$("#errorLabel").css("display","block"),$("#errorLabel").css("visibility","visible")},error:function(){$("#LeadAjaxLoading").hide();console.log("Error");$("#sucessLabel").css("display","block");$("#sucessLabel").css("visibility","hidden");$("#errorLabel").html("Some error occured.  Please try later");$("#errorLabel").css("display","block");$("#errorLabel").css("visibility","visible")}})):($("#errorLabel").html("Please enter valid zipcode."),$("#errorLabel").css("display","block"),$("#errorLabel").css("visibility","visible"))});$(document).on("click","#fiftyYrsLink",function(){$("html,body").animate({scrollTop:$("#FiftyYearsContainer").offset().top-100},"slow")});$(document).on("click","#topProducersLink",function(){$("html,body").animate({scrollTop:$("#CultureContainer").offset().top-100},"slow")});$(document).on("click","#technologiesLink",function(){$("html,body").animate({scrollTop:$("#TechnologyContainer").offset().top-100},"slow")})})