function flashLoader(m,l,f,e,o,b,h,a,k){var g="";var d="";if(l.indexOf("ssl=true")!=-1||m.indexOf("https://")!=-1){d="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";g="https://www.macromedia.com/go/getflashplayer"}else{d="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0";g="http://www.macromedia.com/go/getflashplayer"}document.write('<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+d+'" width="'+e+'" height="'+f+'" id="'+a+'" align="'+o+'">');document.write('<param name="flashvars" value="'+l+'">');document.write('<param name="movie" value="'+m+'">');document.write('<param name="quality" value="'+b+'">');if(k==null){var k="";var n=""}else{document.write('<param name="scale" value="'+k+'">');var n=' scale="'+k+'"'}document.write('<param name="bgcolor" value="'+h+'">');document.write('<param name="wmode" value="transparent">');document.write('<param name="allowscriptaccess" value="always">');document.write('<embed src="'+m+'" quality="'+b+'"'+n+' bgcolor="'+h+'"  width="'+e+'" height="'+f+'" name="'+a+'" align="'+o+'" TYPE="application/x-shockwave-flash" pluginspage="'+g+'" flashvars="'+l+'" wmode="transparent" allowscriptaccess="always"></embed>');document.write("</object>")}function OpenWindow(d,b,a,e){if(typeof(wl_bj_pre)!="undefined"){d=wl_bj_pre+d}window.open(d,b,"width="+a+",height="+e)}function OpenWindowResizable(d,b,a,e){if(typeof(wl_bj_pre)!="undefined"){d=wl_bj_pre+d}window.open(d,b,"width="+a+",height="+e+",resizable=1")}var _width,_height;var _openedUrl;var _popupObject;var _documentHead;function OpenWindowCenter(b,d,e,m,l,k){if(b.indexOf("embedded=true")==-1){var g="";if(l){g+="scrollbars=yes, ";e=e+16}var a=(document.all)?window.screenLeft:window.screen.left;var f=a+(window.screen.width-e)/2;var h=(window.screen.height-m)/2;g+="width="+e+", height="+m;g+=", top="+h+", left="+f;if(typeof(wl_bj_pre)!="undefined"){b=wl_bj_pre+b}popupWin=window.open(b,d,g);if(popupWin!=null){popupWin.focus()}}else{_width=e;_height=m;_openedUrl=b;_popupObject=$('<div id="PopupLoaderPopupContent">'+globalPopupHeader.replace("{PopupHeader}",k)+'<iframe src="'+b+'" frameborder="0" scrolling="no" width="'+e+'" height="'+m+'"></iframe></div>').modal({zIndex:20000,close:true,positionStyle:"absolute",containerCss:{width:_width,height:_height},containerId:"PopupLoaderContainer",position:[73,]});$("body").animate({scrollTop:0},"slow");$(".ClosePopup").bind("click.simplemodal",function(n){n.preventDefault();if(document.getElementById("_extIntViewContainer")!=null){document.getElementById("_extIntViewContainer").style.visibility="visible"}_popupObject.close()})}}function closeSelf(){window.open("","_parent","");window.opener=top;window.close()}function checkEmail(b){var a=b.value;return checkEmailStr(a)}function checkEmailStr(a){if(!(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/.test(trim(a)))){return false}else{return true}}function checkEmpty(a){if(a.value.length>0){return true}else{return false}}function checkAllowedChars(b){var a=/<|>|\\/;return !a.test(b.value)}function checkDate(b){var a;if(b.value!=null){a=b.value}else{a=b}if(((/^([1-9]|0[1-9]|1[012]|)[- /.]([1-9]|0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d/.test(a)))){return true}return false}function checkOfferPrice(b){var a=b.value;if(!(/^(\$)?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)$/.test(a))){return false}else{return true}}function trim(d){var b,a;b=0;a=d.length-1;d=d.split("");while(b<d.length){if(d[b]==" "){d[b]=""}else{break}b++}while(a>0){if(d[a]==" "){d[a]=""}else{break}a--}return d.join("")}function remove(a){}function googleMapSubmit(){s0=document.getElementById("tmpAddr");s1=document.getElementById("tmpAddr1");s2=document.getElementById("tmpAddr2");s0.value=s1.value+", "+s2.value}var delay=null;var delaySecs=500;var current=null;function isIE6(){version=0;if(navigator.appVersion.indexOf("MSIE")!=-1){tempVer=navigator.appVersion.split("MSIE");version=parseFloat(tempVer[1])}return(version==6)?true:false}function mX(a){if(a.pageX){return a.pageX}else{if(a.clientX){return a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)}else{return null}}}function mY(a){if(a.pageY){return a.pageY}else{if(a.clientY){return a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}else{return null}}}function ExecuteCampaignConversionTrackingCode(d){var b=document.createElement("div");window.onload=function(){document.body.appendChild(b)};b.style.visibility="hidden";var a=d+"shared/campaignconversiontrackingcode/campaignconversiontrackingcode.aspx";try{var f=document.createElement("object");f.data=a;if(!isIE6()){f.type="text/html"}b.appendChild(f);if(isIE6()){f.classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"}}catch(e){}}function ExecuteConversionTrackingCode(b,a){$(b).append(a)}function FixPngTransparency(){var f=document.getElementsByTagName("img");var a=/\.png/i;var b=f.length;while(b-->0){var d=f[b];var e=d.style;if(d.src&&d.src.match(a)&&!e.filter){e.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"',sizingMethod='crop')"}}}if(isIE6()){window.attachEvent("onload",FixPngTransparency)}function getSelectedText(d){var b=document.getElementById(d);var a=b.selectedIndex;if(typeof(a)!="undefined"){return b.getElementsByTagName("option")[a].innerHTML}else{return null}}function getItemsAdvancedSearchDataMakes(hostURL,siteId,newUsedCpoCtrlId,makeCtrlId,modelCtrlId){var newUsedCpo=$("#"+newUsedCpoCtrlId).val();if(newUsedCpo=="0"){$("#"+makeCtrlId).empty().append('<option value="">Select Make</option>');return}else{$("#"+makeCtrlId).empty().append('<option value="">Loading...</option>')}$("#"+modelCtrlId).empty().append('<option value="">Select Model</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetItemsAdvancedSearchDataMakes",data:"{ siteId: "+siteId+", isNew:"+(newUsedCpo=="1")+", isCpo: "+(newUsedCpo=="3")+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var makes=(typeof response)=="string"?eval("("+response+")"):response;var makesList=$("#"+makeCtrlId).empty().append('<option value="">Select Make</option>');for(var i=0;i<makes.length;i++){makesList.append('<option value="'+makes[i]+'">'+makes[i]+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function getItemsAdvancedSearchDataModels(hostURL,siteId,newUsedCpoCtrlId,makeCtrlId,modelCtrlId){var newUsedCpo=$("#"+newUsedCpoCtrlId).val();var make=$("#"+makeCtrlId).val();if(newUsedCpo=="0"){$("#"+makeCtrlId).empty().append('<option value="">Select Make</option>');return}else{if(make==""){$("#"+modelCtrlId).empty().append('<option value="">Select Model</option>');return}else{$("#"+modelCtrlId).empty().append('<option value="">Loading...</option>')}}$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetItemsAdvancedSearchDataModels",data:"{ siteId: "+siteId+", isNew:"+(newUsedCpo=="1")+", isCpo: "+(newUsedCpo=="3")+", make:'"+make+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var models=(typeof response)=="string"?eval("("+response+")"):response;var modelsList=$("#"+modelCtrlId).empty().append('<option value="">Select Model</option>');for(var i=0;i<models.length;i++){modelsList.append('<option value="'+models[i]+'">'+models[i]+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function GetModelHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,yearFromControlID,yearToControlID,bodyStyleControlID,siteId,country){var make=$("#"+makeControlID).val();$("#"+modelControlID).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelHomePageAdvancedSearchContent",data:"{make: '"+make+"', siteId: "+siteId+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var models=(typeof response)=="string"?eval("("+response+")"):response;var modelsList=$("#"+modelControlID);modelsList.empty().append('<option value="">Select Model</option>');for(var i=0;i<models.length;i++){modelsList.append('<option value="'+models[i]+'">'+models[i]+"</option>")}GetYearsHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,yearFromControlID,yearToControlID,bodyStyleControlID,siteId,country);GetBodyStylesHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,bodyStyleControlID,siteId,country)},failure:function(msg){$("#output").text(msg)}})}function GetYearsHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,yearFromControlID,yearToControlID,bodyStyleControlID,siteId,country){var make=$("#"+makeControlID).val();var model=$("#"+modelControlID).val();$("#"+yearFromControlID).empty().append('<option value="">Loading...</option>');$("#"+yearToControlID).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearsHomePageAdvancedSearchContent",data:"{make: '"+make+"', model: '"+model+"', siteId: "+siteId+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var years=(typeof response)=="string"?eval("("+response+")"):response;$("#"+yearFromControlID).empty().append('<option value="">Low Year</option>');for(var i=years.length-1;i>=0;i--){$("#"+yearFromControlID).append('<option value="'+years[i]+'">'+years[i]+"</option>")}$("#"+yearToControlID).empty().append('<option value="">High Year</option>');for(var j=0;j<years.length;j++){$("#"+yearToControlID).append('<option value="'+years[j]+'">'+years[j]+"</option>")}GetBodyStylesHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,bodyStyleControlID,siteId,country)},failure:function(msg){$("#output").text(msg)}})}function GetBodyStylesHomePageAdvancedSearchContent(hostURL,makeControlID,modelControlID,bodyStyleControlID,siteId,country){var make=$("#"+makeControlID).val();var model=$("#"+modelControlID).val();$("#"+bodyStyleControlID).empty().append('<option value="">Loading...</option>');var bodyStylesTemp=[];$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetBodyStylesHomePageAdvancedSearchContent",data:"{make: '"+make+"', model: '"+model+"', siteId: "+siteId+", country: "+country+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var bodyStyles=(typeof response)=="string"?eval("("+response+")"):response;$("#"+bodyStyleControlID).empty().append('<option value="">Select Body Style</option>');for(var i=0;i<bodyStyles.length;i++){bodyStylesTemp[i]=eval("("+bodyStyles[i]+")");$("#"+bodyStyleControlID).append('<option value="'+bodyStylesTemp[i].Value+'">'+bodyStylesTemp[i].Name+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function homePageAdvancedSearchReset(a,h,e,b,l,n,m,d,k,g,f){$("#"+a).val("");$("#"+h).val("");$("#"+e).val("");$("#"+b).val("");$("#"+l).val("");$("#"+n).val("");$("#"+m).val("");$("#"+d).val("");$("#"+k).val("");if(!isNullOrEmpty($("#"+g))){$("#"+g).removeAttr("checked")}if(!isNullOrEmpty($("#"+f))){$("#"+f).removeAttr("checked")}}function homePageAdvancedSearch(a,b,k,g,d,n,m,l,e,f,h){$("#"+m).val($("#"+b).val());$("#"+l).val($("#"+k).val());$("#"+e).val($("#"+g).val());$("#"+f).val($("#"+d).val());$("#"+h).val($("#"+n).val());$("#"+a).submit()}var numPopups=3;function processGetAQuoteOnClickEvent(e,a,d){if(IsGetAQuoteFormValid(e,a,d)){var b=document.getElementById("_txtGetAQuoteClientEmail");if(b!=null){b.innerHTML=document.getElementById("_txtGetAQuoteEmail").value}submitGetAQuote()}}function IsEmailStringValid(a){if(!(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/.test(a))){return false}else{return true}}function IsEmpty(a){return a.value.length==0}function IsGetAQuoteFormValid(f,b,e){var a;var d="";if(f){a=document.getElementById("_txtGetAQuoteFirstName");if(IsEmpty(a)){d+="Please fill out first name.\n"}}if(b){a=document.getElementById("_txtGetAQuoteLastName");if(IsEmpty(a)){d+="Please fill out last name.\n"}}if(e){a=document.getElementById("_txtGetAQuotePhone");if(IsEmpty(a)){d+="Please enter phone number.\n"}}a=document.getElementById("_txtGetAQuoteEmail");if(!IsEmailStringValid(a.value)){d+="Email address has wrong format.\n"}if(d.length>0){alert(d);return false}return true}var mediaViewerUrl="";function OpenMediaViewer(a){PageTracking(23,false,false,true,"",false);_popupObject=$('<div id="MVContainer"><div class="ClosePopupBtn" onmouseover="this.className=\'ClosePopupBtn_hover\'" onmouseout="this.className=\'ClosePopupBtn\'"><b></b></div><div class="MVContainerInner"></div></div>').modal({zIndex:20000,close:true,positionStyle:"absolute",containerCss:{width:821},containerId:"PopupLoaderContainer",position:[40,]});$("body").animate({scrollTop:0},"slow");$("#MVContainer .ClosePopupBtn").bind("click.simplemodal",function(b){b.preventDefault();_popupObject.close()});$.ajax({type:"POST",url:mediaViewerUrl+"&tab="+a,success:function(b){$("#MVContainer .MVContainerInner").html(b)},error:function(b,d){$("#MVContainer .MVContainerInner").html('<div style="height:200px">Error occured while loading content.</div>')}})}function SwitchMediaViewerTab(f,b,e){var d,a;for(d=1;d<=b;d++){if(d!=f){a=document.getElementById(e+d);if(a!=null&&a.className!="mvtab"){break}}}if(a&&d<=b){a.className="mvtab";document.getElementById(e+d+"Content").style.display="none";document.getElementById(e+f+"Content").style.display="block";document.getElementById(e+f).className="mvtab_s"}}function ReturnToMediaViewer(){var a=document.getElementById("returnToMediaViewer").value;location.replace(a)}function validateShareVideoControls(){var b="";var d=document.getElementById("txtName");var a=false;if(!checkEmpty(d)){b=b+"- Please provide your name. \n";a=true}else{if(!checkAllowedChars(d)){b=b+"- Chars '<' and '>' are not allowed in Your Name \n";a=true}}if(!checkEmail(document.getElementById("txtYourEmail"))){a=true;b=b+"- Please provide your email address  \n"}var e=document.getElementById("txtRecipientEmails").value.replace(/\s/gi," ").split(",");for(i=0;i<e.length;i++){if(trim(e[i]).length>0&&!checkEmailStr(trim(e[i]))){a=true;b=b+"- Please provide correct recepient email addresses (separated by commas)  \n";break}}if(!checkAllowedChars(document.getElementById("txtMessage"))){a=true;b=b+"- - Chars '<' and '>' are not allowed in Personal Message text \n"}if(a){alert("You must enter a proper value in the following fields:\n"+b)}return !a}function clearShareVideoControls(){document.getElementById("txtName").value="";document.getElementById("txtYourEmail").value="";document.getElementById("txtRecipientEmails").value="";document.getElementById("txtMessage").value="";document.getElementById("chkSendCopy").checked=false}function OpenPrintModal(){var a;a=$("#PrintModalContent").modal({zIndex:20000,close:true,positionStyle:"absolute",position:[20,]});$("body").animate({scrollTop:0},"slow");$(".ClosePopup").bind("click.simplemodal",function(b){b.preventDefault();a.close()})}var isActive=false;var isActiveLinks=false;var timeId=0;function hideLinksPopup(){if(!isActive&&!isActiveLinks){var a=document.getElementById("SocialLinksPopup");a.style.display="none";a=document.getElementById("SocialLinksIcons");a.style.borderBottom=""}else{timeId=setTimeout(hideLinksPopup,200)}}function showLinksPopup(){var a=document.getElementById("SocialLinksPopup");a.style.display="block";a=document.getElementById("SocialLinksIcons");a.style.borderBottom="solid 1px #ffffff"}function on_mouseoverSocialBookmarking(){if(!isActive){isActive=true;showLinksPopup()}clearTimeout(timeId);timeId=setTimeout(hideLinksPopup,200)}function on_mouseoverLinks(){if(!isActiveLinks){isActiveLinks=true;showLinksPopup()}clearTimeout(timeId);timeId=setTimeout(hideLinksPopup,200)}function on_mouseoutLinks(){isActiveLinks=false}function OnMouseOverImg(e,a){var d=document.getElementById(e);var b=document.getElementById(e+"hover");if(a){d.style.display="none";b.style.display="inline"}else{d.style.display="inline";b.style.display="none"}}function OnMouseOverSection(e,d,a){var b=document.getElementById(e+"Body");OnMouseOverImg(e+(b.style.display!="none"?"Close":"Open"),d);if(d){document.getElementById(e+"Hdr").style.color=a}else{document.getElementById(e+"Hdr").style.color=""}}function SwitchVisibility(b){var a=document.getElementById(b+"Content");if(a.style.display!="none"){a.style.display="none";document.getElementById(b+"Close").style.display="none";document.getElementById(b+"Open").style.display="inline"}else{a.style.display="block";document.getElementById(b+"Close").style.display="inline";document.getElementById(b+"Open").style.display="none"}}function onfocus_input(d,a,e){var b=document.getElementById(a);if(e){b.className=e}if(b.value==d){b.value=""}}function onblur_input(d,a,e){var b=document.getElementById(a);if(b.value==""){if(e){b.className=e}b.value=d}}function RefineSearchYears(b,g,h){var k="";var l="";if(b.indexOf("?")!=-1){l=b.substring(0,b.indexOf("?")+1);k=b.substring(b.indexOf("?")+1)}else{l=b}if(k.length>0){k+="&"}else{k="?"}var a=document.getElementById(g);var e=document.getElementById(h);var d,f;if(a.value>e.value){d=e.value;f=a.value}else{d=a.value;f=e.value}k=l+k+a.name+"="+d+"&"+e.name+"="+f;window.location.href=k}function setPageSize(d,b){var a=new Date();a.setTime(a.getTime()+(2592000000));document.cookie="EBizAutosBuyersSiteCookiePageSize="+d+";expires="+a.toGMTString()+";path=/";if(b=="?"){b=document.URL;var e=b.indexOf("?");if(e!=-1){b=b.substr(0,e)}}if(b==""){b=document.URL}if(document.all){window.navigate(b)}else{window.location.reload(true);window.location.href=b}}function setInventoryView(a,d){var b=new Date();b.setTime(b.getTime()+(2592000000));document.cookie="EBizAutosBuyersSiteCookieInventoryView="+a+";expires="+b.toGMTString()+";path=/";if(d=="?"){d=document.URL;var e=d.indexOf("?");if(e!=-1){d=d.substr(0,e)}}if(d==""){d=document.URL}if(document.all){window.navigate(d)}else{window.location.reload(true);window.location.href=d}}function toggleHeaderDescriptionText(){var a=$("#DescriptionText span");var b=$("#DescriptionText a.moreLessLink");if(a.css("display")=="none"){a.css("display","inline");b.html("less")}else{a.css("display","none");b.html("more")}}function TruncateChromeDescription(f,b){var e=document.getElementById("DescriptionText");if(e){if(e.offsetHeight>b){var d="<span>";var h=e.innerHTML+" "+d+' </span>... <a class="moreLessLink" href="'+f+'">more</a>';var a=h.split(" ");var g=jQuery.inArray(d.toString(),a);e.innerHTML=h;for(i=g;i>0;i--){a[i]=a[i-1];a[i-1]=d;e.innerHTML=a.join(" ");$("#DescriptionText span").css("display","none");if(e.offsetHeight<b){break}}}e.style.visibility="visible"}}function selectShowLocation(d,a){var b=d.options[d.selectedIndex].value;if(b!="none"){window.location.href=a+b}}var salesPriceLoan=0;var salesTaxLoan=0;var loanTermLoan=0;var interestRateLoan=0;var downPaymentLoan=0;var tradeInValueLoan=0;var rebatesLoan=0;var salesPriceLease=0;var salesTaxLease=0;var loanTermLease=0;var interestRateLease=0;var residualValueLease=0;var downPaymentLease=0;var tradeInValueLease=0;var rebatesLease=0;function CalculateLoanControl(){salesPriceLoan=0;salesTaxLoan=0;loanTermLoan=0;interestRateLoan=0;downPaymentLoan=0;tradeInValueLoan=0;rebatesLoan=0;var b=document.getElementById("Loan");var d=document.getElementById("LoanWarning");if(doLoanValidationControl()){interestRateLoan=interestRateLoan/100;interestRateLoan=interestRateLoan/12;salesTaxLoan=salesTaxLoan/100;var a=(salesPriceLoan*(1+salesTaxLoan))-downPaymentLoan-tradeInValueLoan-rebatesLoan;var e=a*(interestRateLoan*Math.pow(1+interestRateLoan,loanTermLoan))/(Math.pow(1+interestRateLoan,loanTermLoan)-1);if(e<0||isNaN(e)){e=0}b.innerHTML="$"+e.toFixed(2);d.style.display="none"}else{d.style.display="block";b.innerHTML="$0.00"}}function CalculateLeaseControl(){salesPriceLease=0;salesTaxLease=0;loanTermLease=0;interestRateLease=0;residualValueLease=0;downPaymentLease=0;tradeInValueLease=0;rebatesLease=0;var g=document.getElementById("Lease");var h=document.getElementById("LeaseWarning");if(doLeaseValidationControl()){if(Number(residualValueLease)!=0){if(salesTaxLease>=1){salesTaxLease=salesTaxLease/100}var b=salesPriceLease-downPaymentLease-tradeInValueLease-rebatesLease;var d=b-residualValueLease;var a=0;if(loanTermLease>=1){a=d/loanTermLease}a=Math.round(a*100)/100;var e=interestRateLease/2400;e=Math.round(e*100000)/100000;var f=(b+residualValueLease)*e+a;f=Math.round(f*100)/100;f=f+f*salesTaxLease;if(f<0||isNaN(f)){f=0}g.innerHTML="$"+f.toFixed(2)}else{g.innerHTML="$0.00"}h.style.display="none"}else{h.style.display="block";g.innerHTML="$0.00"}}function doLoanValidationControl(){if(doFieldValidation(document.getElementById("SalesPriceLoan"),false)){salesPriceLoan=parseFloat(document.getElementById("SalesPriceLoan").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("SalesTaxLoan"),true)){salesTaxLoan=parseFloat(document.getElementById("SalesTaxLoan").value.replace(/,/gi,""))}else{if(IsEmpty(document.getElementById("SalesTaxLoan"))){salesTaxLoan=0}else{return false}}if(doFieldValidation(document.getElementById("TermLoan"),false)){loanTermLoan=parseFloat(document.getElementById("TermLoan").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("InterestRateLoan"),false)){interestRateLoan=parseFloat(document.getElementById("InterestRateLoan").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("CashTradeLoan"),true)){tradeInValueLoan=parseFloat(document.getElementById("CashTradeLoan").value.replace(/,/gi,""))}else{if(IsEmpty(document.getElementById("CashTradeLoan"))){tradeInValueLoan=0}else{return false}}return true}function doLeaseValidationControl(){if(doFieldValidation(document.getElementById("SalesPriceLease"),false)){salesPriceLease=parseFloat(document.getElementById("SalesPriceLease").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("SalesTaxLease"),true)){salesTaxLease=parseFloat(document.getElementById("SalesTaxLease").value.replace(/,/gi,""))}else{if(IsEmpty(document.getElementById("SalesTaxLease"))){salesTaxLease=0}else{return false}}if(doFieldValidation(document.getElementById("TermLease"),false)){loanTermLease=parseFloat(document.getElementById("TermLease").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("InterestRateLease"),false)){interestRateLease=parseFloat(document.getElementById("InterestRateLease").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("ResidualLease"),false)){residualValueLease=parseFloat(document.getElementById("ResidualLease").value.replace(/,/gi,""))}else{return false}if(doFieldValidation(document.getElementById("CashTradeLease"),true)){tradeInValueLease=parseFloat(document.getElementById("CashTradeLease").value.replace(/,/gi,""))}else{if(IsEmpty(document.getElementById("CashTradeLease"))){tradeInValueLease=0}else{return false}}return true}function CalculateLoan(g){salesPriceLoan=0;salesTaxLoan=0;loanTermLoan=0;interestRateLoan=0;downPaymentLoan=0;tradeInValueLoan=0;rebatesLoan=0;var d=document.getElementById("loan"+g);var a=document.getElementById("loanAmount"+g);var e=document.getElementById("loanAmountWarning"+g);e.style.display="none";if(doLoanValidation(g)){interestRateLoan=interestRateLoan/100;interestRateLoan=interestRateLoan/12;salesTaxLoan=salesTaxLoan/100;var b=(salesPriceLoan*(1+salesTaxLoan))-downPaymentLoan-tradeInValueLoan-rebatesLoan;var f=b*(interestRateLoan*Math.pow(1+interestRateLoan,loanTermLoan))/(Math.pow(1+interestRateLoan,loanTermLoan)-1);if(f<0||isNaN(f)){f=0}d.innerHTML=f.toFixed(2);a.style.display="";e.style.display="none"}else{a.style.display="none";e.style.display=""}}function CalculateLease(b){salesPriceLease=0;salesTaxLease=0;loanTermLease=0;interestRateLease=0;residualValueLease=0;downPaymentLease=0;tradeInValueLease=0;rebatesLease=0;var l=document.getElementById("lease"+b);var k=document.getElementById("leaseAmount"+b);var a=document.getElementById("leaseAmountWarning"+b);a.style.display="none";if(doLeaseValidation(b)){if(salesTaxLease>=1){salesTaxLease=salesTaxLease/100}var e=salesPriceLease-downPaymentLease-tradeInValueLease-rebatesLease;var f=e-residualValueLease;var h=0;if(loanTermLease>=1){h=f/loanTermLease}h=Math.round(h*100)/100;var d=interestRateLease/2400;d=Math.round(d*100000)/100000;var g=(e+residualValueLease)*d+h;g=Math.round(g*100)/100;g=g+g*salesTaxLease;if(g<0||isNaN(g)){g=0}l.innerHTML=g.toFixed(2);k.style.display="";a.style.display="none"}else{k.style.display="none";a.style.display=""}}function doCalculation(a){if(document.getElementById("loan"+a)){CalculateLoan(a)}if(document.getElementById("lease"+a)){CalculateLease(a)}}function doLeaseValidation(a){if(doFieldValidation(document.getElementById("_txtSalesPriceLease"+a),false)){salesPriceLease=parseFloat(document.getElementById("_txtSalesPriceLease"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtSalesTaxLease"+a),true)){salesTaxLease=parseFloat(document.getElementById("_txtSalesTaxLease"+a).value)}else{if(IsEmpty(document.getElementById("_txtSalesTaxLease"+a))){salesTaxLease=0}else{return false}}if(doFieldValidation(document.getElementById("_txtTermLease"+a),false)){loanTermLease=parseFloat(document.getElementById("_txtTermLease"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtInterestRateLease"+a),false)){interestRateLease=parseFloat(document.getElementById("_txtInterestRateLease"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtResidualValueLease"+a),false)){residualValueLease=parseFloat(document.getElementById("_txtResidualValueLease"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtDownPaymentLease"+a),true)){downPaymentLease=parseFloat(document.getElementById("_txtDownPaymentLease"+a).value)}else{if(IsEmpty(document.getElementById("_txtDownPaymentLease"+a))){downPaymentLease=0}else{return false}}if(doFieldValidation(document.getElementById("_txtTradeInValueLease"+a),true)){tradeInValueLease=parseFloat(document.getElementById("_txtTradeInValueLease"+a).value)}else{if(IsEmpty(document.getElementById("_txtTradeInValueLease"+a))){tradeInValueLease=0}else{return false}}if(doFieldValidation(document.getElementById("_txtRebatesLease"+a),true)){rebatesLease=parseFloat(document.getElementById("_txtRebatesLease"+a).value)}else{if(IsEmpty(document.getElementById("_txtRebatesLease"+a))){rebatesLease=0}else{return false}}return true}function doLoanValidation(a){if(doFieldValidation(document.getElementById("_txtSalesPriceLoan"+a),false)){salesPriceLoan=parseFloat(document.getElementById("_txtSalesPriceLoan"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtSalesTaxLoan"+a),true)){salesTaxLoan=parseFloat(document.getElementById("_txtSalesTaxLoan"+a).value)}else{if(IsEmpty(document.getElementById("_txtSalesTaxLoan"+a))){salesTaxLoan=0}else{return false}}if(doFieldValidation(document.getElementById("_txtTermLoan"+a),false)){loanTermLoan=parseFloat(document.getElementById("_txtTermLoan"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtInterestRateLoan"+a),false)){interestRateLoan=parseFloat(document.getElementById("_txtInterestRateLoan"+a).value)}else{return false}if(doFieldValidation(document.getElementById("_txtDownPaymentLoan"+a),true)){downPaymentLoan=parseFloat(document.getElementById("_txtDownPaymentLoan"+a).value)}else{if(IsEmpty(document.getElementById("_txtDownPaymentLoan"+a))){downPaymentLoan=0}else{return false}}if(doFieldValidation(document.getElementById("_txtTradeInValueLoan"+a),true)){tradeInValueLoan=parseFloat(document.getElementById("_txtTradeInValueLoan"+a).value)}else{if(IsEmpty(document.getElementById("_txtTradeInValueLoan"+a))){tradeInValueLoan=0}else{return false}}if(doFieldValidation(document.getElementById("_txtRebatesLoan"+a),true)){rebatesLoan=parseFloat(document.getElementById("_txtRebatesLoan"+a).value)}else{if(IsEmpty(document.getElementById("_txtRebatesLoan"+a))){rebatesLoan=0}else{return false}}return true}function doFieldValidation(d,a){var b="";if(!a&&IsEmpty(d)){select(d);return false}else{if(a&&IsEmpty(d)){return false}}b=parseFloat(d.value,10);if(isNaN(b)||(b!=d.value)){alert(d.name+" must be a number.");select(d);return false}return true}function select(a){a.focus();a.select()}function SwitchToLease(b){var a=document.getElementById("_loanCalculator"+b);a.style.display="none";a=document.getElementById("_leaseCalculator"+b);a.style.display="block"}function SwitchToLoan(b){var a=document.getElementById("_loanCalculator"+b);a.style.display="block";a=document.getElementById("_leaseCalculator"+b);a.style.display="none"}function resizePrintAdImage(a){if($(a).width()>870){$(a).width(870)}}var QQerrorString="Please enter the required information";var QQYearErrorString="Required";var ZipCodeError="Please provide a 5 digit numeric zip code";function onQQinput_focus(a){if(a.value==QQerrorString||a.value==QQYearErrorString||ZipCodeError){a.value=""}a.style.color=""}$(document).ready(function(){setInterval("VehicleRowCycle()",100);$("#udm").mousemove(function(a){removeSelect()});$("#QuickQuoteButton input.basic, #QuickQuoteButtonHover input.basic, #QuickQuoteButton a.basic, #QuickQuoteButton div.basic, span.specialItemClickHere, div.specialItemRightSideBoxClickHere").click(function(a){a.preventDefault();InitializationQuickQuote()});syncPopup();syncFreeFormPopup()});function removeSelect(){$("#QuickQuoteMake").blur();$("#QuickQuoteModel").blur();$("#YearFrom").blur();$("#YearTo").blur()}function syncPopup(){if($("#MakeIDHidden").val()!=null){$("#QuickQuoteMakeModal").val($("#MakeIDHidden").val())}}function InitializationQuickQuote(){var a=document.getElementById("specialQuoteArrows");var b;if(a){a.style.visibility="hidden"}var d=$("#HasToDisplayFreeFormHidden").val();if(d=="False"){syncPopup()}else{syncFreeFormPopup()}if($.browser.msie){b="590px"}else{b="610px"}$("#QuickQuotePopup").modal({zIndex:20000,close:true,containerId:"QuickQuoteContainer",positionStyle:"absolute",containerCss:{width:b},position:[73,],onHide:function(){if(a){a.style.visibility="visible"}}});$(".ClosePopup").bind("click.simplemodal",function(f){f.preventDefault()});$("body").animate({scrollTop:0},"slow")}function syncFreeFormPopup(){$("#QuickQuoteMakeModalInput").val($("#MakeNameHidden").val());$("#QuickQuoteModelModalInput").val($("#ModelNameHidden").val());$("#QuickQuoteYearFromModalInput").val($("#YearFromHidden").val());$("#QuickQuoteYearToModalInput").val($("#YearToHidden").val())}function getModels(hostURL,accountId,isCrossPromotionOn,isModelsFranchisedOnly){$("#QuickQuoteModel").append('<option value="0">Select Model</option>').empty();$("#QuickQuoteModel").append('<option value="0">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelList",data:"{accountId: "+accountId+", makeId: "+$("#QuickQuoteMake").val()+", makeName: '"+$("#QuickQuoteMake :selected").text()+"', isCrossPromotionOn: '"+isCrossPromotionOn+"', isModelsFranchisedOnly: "+isModelsFranchisedOnly+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var cars=(typeof response)=="string"?eval("("+response+")"):response;$("#QuickQuoteModel").append('<option value="0">Select Model</option>').empty();$("#QuickQuoteModel").append('<option value="0">Select Model</option>');$("#QuickQuoteModelModal").append('<option value="0">Select Model</option>').empty();$("#QuickQuoteModelModal").append('<option value="0">Select Model</option>');var quickQuoteMake_selected=$("#QuickQuoteMake").val();$("#QuickQuoteMakeModal").val(quickQuoteMake_selected);$("#YearFrom").append('<option value="0">Year</option>').empty();$("#YearTo").append('<option value="0">Year</option>').empty();$("#YearFrom").append('<option value="0">Year</option>');$("#YearTo").append('<option value="0">Year</option>');for(var i=0;i<cars.length;i++){$("#QuickQuoteModel").append('<option value="'+cars[i].replace(" ","_")+'">'+cars[i]+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function getYears(hostURL,accountId,isModelsFranchisedOnly){$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearList",data:"{accountId:"+accountId+", modelName: '"+$("#QuickQuoteModel :selected").text()+"', isModelsFranchisedOnly: '"+isModelsFranchisedOnly+"' }",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var years=(typeof response)=="string"?eval("("+response+")"):response;$("#YearFrom").append('<option value="0">Year</option>').empty();$("#YearTo").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearFrom").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearTo").append('<option value="0">Year</option>').empty();var quickQuoteModel_selected=$("#QuickQuoteModel").val();$("#QuickQuoteModelModal").val(quickQuoteModel_selected);$("#YearFrom").append('<option value="0">Year</option>');$("#YearTo").append('<option value="0">Year</option>');$("#QuickQuoteYearFrom").append('<option value="0">Year</option>');$("#QuickQuoteYearTo").append('<option value="0">Year</option>');for(var i=0;i<years.length;i++){$("#QuickQuoteYearFrom").append('<option value="'+years[i]+'">'+years[i]+"</option>");$("#YearFrom").append('<option value="'+years[i]+'">'+years[i]+"</option>")}for(var i=years.length-1;i>=0;i--){$("#QuickQuoteYearTo").append('<option value="'+years[i]+'">'+years[i]+"</option>");$("#YearTo").append('<option value="'+years[i]+'">'+years[i]+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function getYearsModel(hostURL,accountId,isModelsFranchisedOnly){var modelName="";modelName=$("#ModelNameHidden").val().toLowerCase();if(modelName==0){modelName=$("#QuickQuoteModelModal :selected").text()}$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearList",data:"{accountId:"+accountId+", modelName: '"+modelName+"', isModelsFranchisedOnly: '"+isModelsFranchisedOnly+"' }",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var years=(typeof response)=="string"?eval("("+response+")"):response;$("#QuickQuoteYearFrom").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearTo").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearFrom").append('<option value="0">Year</option>');$("#QuickQuoteYearTo").append('<option value="0">Year</option>');for(var i=0;i<years.length;i++){$("#QuickQuoteYearFrom").append('<option value="'+years[i]+'">'+years[i]+"</option>")}for(var i=years.length-1;i>=0;i--){$("#QuickQuoteYearTo").append('<option value="'+years[i]+'">'+years[i]+"</option>")}if($("#YearFromHidden").val()!=null){$("#QuickQuoteYearFrom").val($("#YearFromHidden").val())}if($("#YearToHidden").val()!=null){$("#QuickQuoteYearTo").val($("#YearToHidden").val())}$("#ModelNameHidden").val("")},failure:function(msg){$("#output").text(msg)}})}function getModelsModal(hostURL,accountId,isCrossPromotionOn,isModelsFranchisedOnly){$("#QuickQuoteModelModal").append('<option value="0">Select Model</option>').empty();$("#QuickQuoteModelModal").append('<option value="0">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelList",data:"{accountId: "+accountId+", makeId: "+$("#QuickQuoteMakeModal").val()+", makeName: '"+$("#QuickQuoteMakeModal :selected").text()+"', isCrossPromotionOn: '"+isCrossPromotionOn+"', isModelsFranchisedOnly: "+isModelsFranchisedOnly+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var cars=(typeof response)=="string"?eval("("+response+")"):response;$("#QuickQuoteModelModal").append('<option value="0">Select Model</option>').empty();$("#QuickQuoteModelModal").append('<option value="0">Select Model</option>');$("#QuickQuoteYearFrom").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearTo").append('<option value="0">Year</option>').empty();$("#QuickQuoteYearFrom").append('<option value="0">Year</option>');$("#QuickQuoteYearTo").append('<option value="0">Year</option>');for(var i=0;i<cars.length;i++){$("#QuickQuoteModelModal").append('<option value="'+cars[i].toLowerCase().replace(" ","_")+'">'+cars[i]+"</option>")}if($("#ModelNameHidden").val()!=null){$("#QuickQuoteModelModal").val($("#ModelNameHidden").val().toLowerCase())}},failure:function(msg){$("#output").text(msg)}})}function saveGetAQuoteLead(G,K,p,x,t,F,r,M,k){if(!validateQQForm()){return}var a=$("#HasToDisplayFreeFormHidden").val();var B=$("#HasToHideYearHidden").val();var J=$("#ExportIDHidden").val();var C=$("#OriginalUrlEncodedHidden").val();var n=$("#InitialTargetEncodedHidden").val();var L=0;var u=0;var l=0;if(a=="False"){var f=getSelectedText("QuickQuoteMakeModal");var h=getSelectedText("QuickQuoteModelModal");if(B=="False"){u=getSelectedText("QuickQuoteYearFrom");L=getSelectedText("QuickQuoteYearTo")}}else{var f=$("#QuickQuoteMakeModalInput").attr("value");var h=$("#QuickQuoteModelModalInput").attr("value");if(B=="False"){u=$("#QuickQuoteYearFromModalInput").attr("value");L=$("#QuickQuoteYearToModalInput").attr("value")}}var d=getSelectedText("QuickQuoteBodyStyle");var o=getSelectedText("QuickQuoteExtColor");var e=getSelectedText("QuickQuoteMilesFrom");var I=getSelectedText("QuickQuoteMilesTo");var E=getSelectedText("QuickQuoteWeek");var g=getSelectedText("QuickQuoteTransmission");var w=getSelectedText("QuickQuoteIntColor");var m=getSelectedText("QuickQuotePriceFrom");var q=getSelectedText("QuickQuotePriceTo");var b=$("#QuickQuoteFirstName").attr("value").replace("'","\\'").replace('"','\\"');var y=$("#QuickQuoteLastName").attr("value").replace("'","\\'").replace('"','\\"');var z=$("#QuickQuoteDayPhone").attr("value");var H=$("#QuickQuoteDayZip").attr("value");var s=encodeURI($("#QuickQuoteMessage").attr("value").replace("'","\\'").replace('"','\\"'));var A=$("#QuickQuoteEmail").attr("value");var D=A+((z!=undefined&&z.length>0)?(" or "+z+" "):" ");if(u==L){l=u}else{l=u+((L.length>0)?(" to "+L+""):" ")}if(b!=null&&b!=""){$("#spnFirstName").html(b+",")}$("#spnYearStartYearEnd").html(l);if(u==0&&L==0){document.getElementById("spnYearStartYearEnd").style.display="none";$("#spnMake").html("<br />"+f)}else{$("#spnMake").html(f)}$("#spnModel").html(h);$("#spnEmailPhone").html(D);$.ajax({type:"POST",url:K+"masterpagewebservice.asmx/SaveGetAQuoteLead",data:'{"make": "'+f+'","model": "'+h+'","yearFrom": "'+u+'","yearTo": "'+L+'","bodyStyle": "'+d+'","extColor": "'+o+'","milesFrom": "'+e+'","milesTo": "'+I+'","week": "'+E+'","transmission": "'+g+'","intColor": "'+w+'","priceFrom": "'+m+'","priceTo": "'+q+'","firstName": "'+b+'","lastName": "'+y+'","dayPhone": "'+(z!=undefined?z:"")+'", zip: "'+(H!=undefined?H:"")+'","message": "'+s+'","email": "'+A+'","siteId": "'+G+'","sourcePage": "'+p+'","exportID": "'+J+'", "originalUrlEncoded": "'+C+'","initialTargetEncoded": "'+n+'"}',contentType:"application/json; charset=utf-8",dataType:"json",success:function(N){PageTracking(r,M,false,k,x,t);ExecuteConversionTrackingCode("#QuickQuoteModalContentResponse",F);$("#QuickQuoteModalContentResponse2").hide();$("#QuickQuoteModalContentResponse").show();$("body").animate({scrollTop:0},"slow")},failure:function(N){$("#output").text(N)}})}function validateQQForm(){var f=true;var h=$("#HasToDisplayFreeFormHidden").val();var g=$("#HasToHideYearHidden").val();var d=$("#FirstNameRequiredHiden").val();var b=$("#LastNameRequiredHidden").val();var a=$("#PhoneNumberRequiredHiden").val();var k=$("#ZipCodeRequiredHiden").val();var e=document.getElementById("QuickQuoteDayZip");if(e!=null&&!/\d{5}/.test(e.value)&&(!isNullOrEmpty(e.value)||k=="True")){e.value="Please provide a 5 digit numeric zip code";e.style.color="red";f=false}if(h=="False"){obj=document.getElementById("QuickQuoteMakeModal")}else{obj=document.getElementById("QuickQuoteMakeModalInput")}if(obj.value=="0"){document.getElementById("QuickQuoteMakeMessage").style.visibility="visible";f=false}else{document.getElementById("QuickQuoteMakeMessage").style.visibility="hidden"}document.getElementById("spnMake").innerText=obj.value;if(h=="False"){obj=document.getElementById("QuickQuoteModelModal")}else{obj=document.getElementById("QuickQuoteModelModalInput")}if(obj.value=="0"){document.getElementById("QuickQuoteModelMessage").style.visibility="visible";f=false}else{document.getElementById("QuickQuoteModelMessage").style.visibility="hidden"}document.getElementById("spnModel").innerText=obj.value;if(h=="False"&&g=="False"){if(document.getElementById("QuickQuoteYearFrom").value=="0"||document.getElementById("QuickQuoteYearTo").value=="0"){document.getElementById("QuickQuoteYearsMessage").style.visibility="visible";f=false}else{document.getElementById("QuickQuoteYearsMessage").style.visibility="hidden"}document.getElementById("spnYearStartYearEnd").innerText=document.getElementById("QuickQuoteYearFrom").value+" to "+document.getElementById("QuickQuoteYearTo").value}if(h=="True"){obj=document.getElementById("QuickQuoteMakeModalInput");if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}obj=document.getElementById("QuickQuoteModelModalInput");if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}if(g=="False"){obj=document.getElementById("QuickQuoteYearFromModalInput");if(obj.value.length==0||obj.value==QQYearErrorString){obj.value=QQYearErrorString;obj.style.color="red";f=false}obj=document.getElementById("QuickQuoteYearToModalInput");if(obj.value.length==0||obj.value==QQYearErrorString){obj.value=QQYearErrorString;obj.style.color="red";f=false}}}if(d.toLowerCase()=="true"){obj=document.getElementById("QuickQuoteFirstName");if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}}obj=document.getElementById("QuickQuoteEmail");if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}else{if(!checkEmailStr(obj.value)){obj.style.color="red";f=false}}if(b.toLowerCase()=="true"){obj=document.getElementById("QuickQuoteLastName");if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}}obj=document.getElementById("QuickQuoteDayPhone");if(obj){if(a.toLowerCase()=="true"){if(obj.value.length==0||obj.value==QQerrorString){obj.value=QQerrorString;obj.style.color="red";f=false}}}return f}function toggleDescriptionDiv(b){var a=document.getElementById("specialItemDescription"+b);if(a.className.indexOf("hidden")>-1){a.className=a.className.split(" ")[0]}else{a.className=a.className+" hidden"}}var _specialsDataList=null;var _specialsData=null;var _specialsAnimation=false;var _specialsWebService=true;var _fadeTime=500;function LoadSpecialsData(hostURL,accountId){_specialsWebService=true;$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetSpecialsList",data:"{accountId: "+accountId+"}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){specialsDataList=(typeof response)=="string"?eval("("+response+")"):response;_specialsDataList=[];for(var i=0;i<specialsDataList.length;i++){_specialsDataList[i]=eval("("+specialsDataList[i]+")")}_specialsWebService=false;GetData(accountId,"","");PrepareSpecialsContent()},failure:function(msg){$("#output").text(msg)}})}function GetIndex(b){for(var a=0;a<_specialsDataList.length;a++){if(_specialsDataList[a].SpecialId==b){return a}}return 0}function GetData(d,b,a){if(a==""){b=""}_specialsData=[];if(_specialsDataList==null||_specialsDataList.length==0){return}switch(b){case"next":currentIndex=GetIndex(a);if(currentIndex+3<_specialsDataList.length){_specialsData=[_specialsDataList[currentIndex+2],_specialsDataList[currentIndex+3]]}else{if(currentIndex+3==_specialsDataList.length){_specialsData=[_specialsDataList[currentIndex+2]]}else{GetData(d,"","")}}break;case"previous":currentIndex=GetIndex(a);if(currentIndex>1){_specialsData=[_specialsDataList[currentIndex-2],_specialsDataList[currentIndex-1]]}else{if(currentIndex==0){if(_specialsDataList.length%2==1){_specialsData=[_specialsDataList[_specialsDataList.length-1]]}else{_specialsData=[_specialsDataList[_specialsDataList.length-2],_specialsDataList[_specialsDataList.length-1]]}}else{GetData(d,"","")}}break;default:if(_specialsDataList.length==0){_specialsData=[]}else{if(_specialsDataList.length==1){_specialsData=[_specialsDataList[0]]}else{_specialsData=[_specialsDataList[0],_specialsDataList[1]]}}break}}function getSpecials(f,e,d){if(_specialsDataList==null){LoadSpecialsData(f,e)}if(_specialsDataList==null||_specialsDataList.length<3){return}var a=$("#hiddenSpecialIdFirst").val();var b=$("#hiddenSpecialIdSecond").val();_specialsAnimation=true;$(".homeSpecialItems, .homeSpecialItemsEmpty").fadeTo(_fadeTime,0,function(){_specialsAnimation=false;GetData(e,d,a);PrepareSpecialsContent()})}function PrepareSpecialsContent(){if(!_specialsAnimation&&!_specialsWebService){_specialsAnimation=true;FillOutSpecialsContent();$(this).oneTime(200,function(){$(".homeSpecialItems, .homeSpecialItemsEmpty").fadeTo(_fadeTime,1,function(){$(".homeSpecial").css("background",$(".homeSpecial").css("background"));$(".itemsFoundDiv").css("background",$(".itemsFoundDiv").css("background"))})})}}function FillOutSpecialsContent(){if(_specialsData=="undefined"||_specialsData.length<1){$(".homeSpecialItems").addClass("hidden");$(".homeSpecialItemsEmpty").removeClass("hidden");$("#hiddenSpecialIdFirst").val(-1);$("#hiddenSpecialIdSecond").val(-1)}else{$(".homeSpecialItems").removeClass("hidden");$(".homeSpecialItemsEmpty").addClass("hidden");for(var b=1;b<=2;b++){var d="First";if(b==2){d="Second"}if(b>_specialsData.length){$(".specialSwapDiv"+d).addClass("hidden");$(".specialItemsNotFound"+d).removeClass("hidden");$("#hiddenSpecialId"+d).val(-1)}else{$(".specialSwapDiv"+d).removeClass("hidden");$(".specialItemsNotFound"+d).addClass("hidden");var a=_specialsData[b-1];$("#hiddenSpecialId"+d).val(a.SpecialId);$("#a"+d).attr("href",a.SpecialDetailLink);$("#image"+d).attr("src",a.PhotoPath);if(a.AllAligible){$("#itemsFoundNumberDiv"+d).addClass("itemsFoundNumberDiv fArial fBold fs26");$("#itemsFoundNumberDiv"+d).html("ALL");$("#itemsFoundTextDiv"+d).html("Customers Eligible ")}else{if(a.VehicleNum=="0"){$("#itemsFoundNumberDiv"+d).removeClass("itemsFoundNumberDiv fArial fBold fs26");$("#itemsFoundNumberDiv"+d).addClass("itemsFoundTextDiv fArial fs10");$("#itemsFoundNumberDiv"+d).html('<div style="padding-top: 7px; margin-left: 5px; margin-right: 5px;">Currently no inventory for this special. Need a Quote?</div>');$("#itemsFoundTextDiv"+d).html('<a href="'+quickQuoteUrl+"\" rel='nofollow'>Click Here</a>")}else{$("#itemsFoundNumberDiv"+d).removeClass("itemsFoundTextDiv fArial fs10");$("#itemsFoundNumberDiv"+d).addClass("itemsFoundNumberDiv fArial fBold fs26");$("#itemsFoundNumberDiv"+d).html(a.VehicleNum);$("#itemsFoundTextDiv"+d).html("<a href="+a.InventoryLink+">Vehicles Found<br />With This Special</a>")}}$("#titleDiv"+d).html("<a href="+a.SpecialDetailLink+">"+a.HeaderText+"</a>");$("#line1"+d).html(a.Line1Text);$("#line2"+d).html(a.Line2Text)}}}}var _specPopupEventTimer=0;var _specPopupMouseMoveTime=0;var _specPopupNeedToShow=false;var _specPopupActiveItemId=null;var _specPopupActiveItemNativeColor;var _specPopupActiveItemTextColor;var _specPopupMouseX=0;var _specPopupMouseY=0;var _specPopupVehicleInfoRowId;var _specPopupVehicleHeader;var _specPopupVihiclePrice;var _specPopupVehicleImage;var _specPopupVehicleDescription;var _specPopupVehicleLink;function VehicleRowCycle(){_specPopupEventTimer++;if((_specPopupEventTimer-_specPopupMouseMoveTime)==4){if(_specPopupNeedToShow){ShowVehicleInfoPopup();_specPopupNeedToShow=false}}}function mX(a){if(a.pageX&&!$.browser.msie){return a.pageX}else{if(a.clientX){return a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)}else{return null}}}function mY(a){if(a.pageY&&!$.browser.msie){return a.pageY}else{if(a.clientY){return a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}else{return null}}}function HideVehicleInfoPopup(){popupBody=document.getElementById("vehicleInfoPopup");if(popupBody==null){return}popupBody.style.display="none";if(_specPopupActiveItemId!=null){document.getElementById(_specPopupActiveItemId).style.backgroundColor=_specPopupActiveItemNativeColor;document.getElementById(_specPopupActiveItemId).style.color=_specPopupActiveItemTextColor;_specPopupActiveItemId=null}}function SpecialVehilceRowEventHandler(d,a,f,h,g,b,k){_specPopupVehicleInfoRowId=d;_specPopupVehicleHeader=a;_specPopupVihiclePrice=f;_specPopupVehicleImage=h;_specPopupVehicleDescription=g;_specPopupVehicleLink=b;_specPopupMouseMoveTime=_specPopupEventTimer;_specPopupNeedToShow=true;_specPopupMouseX=mX(k);_specPopupMouseY=mY(k)}function ShowVehicleInfoPopup(){if(_specPopupActiveItemId!=null){document.getElementById(_specPopupActiveItemId).style.backgroundColor=_specPopupActiveItemNativeColor;document.getElementById(_specPopupActiveItemId).style.color=_specPopupActiveItemTextColor}_specPopupActiveItemId=_specPopupVehicleInfoRowId;_specPopupActiveItemNativeColor=document.getElementById(_specPopupVehicleInfoRowId).style.backgroundColor;document.getElementById(_specPopupVehicleInfoRowId).style.backgroundColor="#"+_attentionColor;_specPopupActiveItemTextColor=document.getElementById(_specPopupVehicleInfoRowId).style.color;document.getElementById(_specPopupVehicleInfoRowId).style.color="#"+_pageColor;popupBody=document.getElementById("vehicleInfoPopup");if(popupBody==null){return}if(document.getElementById("vehicleInfoPopupLink").href!=_specPopupVehicleLink){document.getElementById("vehicleInfoPopupVehicleHeader").innerHTML=_specPopupVehicleHeader;document.getElementById("vehicleInfoPopupVehiclePrice").innerHTML=_specPopupVihiclePrice;document.getElementById("vehicleInfoPopupImage").src=_specPopupVehicleImage;document.getElementById("vehicleInfoPopupDescription").innerHTML=_specPopupVehicleDescription;document.getElementById("vehicleInfoPopupLink").href=_specPopupVehicleLink}popupBody.style.display="block";var b;var e;var f=document.getElementById("vehicleInfoPopup").offsetHeight;var d=document.getElementById("vehicleInfoPopupArea").offsetHeight;var a=document.getElementById("vehicleInfoArrow").offsetHeight;var g=10;if($.browser.msie){g=16}b=_specPopupMouseY-d-a-g;e=_specPopupMouseX;popupBody.style.top=b;popupBody.style.left=e}function ShowHideSection(b,a,e){var f=document.getElementById(e+b+"Body");if(f){if(a==null){a=f.style.display=="none"}var d=document.getElementById(e+b+"Closehover").style.display=="inline"||document.getElementById(e+b+"Openhover").style.display=="inline";if(a){f.style.display="block";if(d){document.getElementById(e+b+"Closehover").style.display="inline";document.getElementById(e+b+"Openhover").style.display="none";document.getElementById(e+b+"Close").style.display="none";document.getElementById(e+b+"Open").style.display="none"}else{document.getElementById(e+b+"Closehover").style.display="none";document.getElementById(e+b+"Openhover").style.display="none";document.getElementById(e+b+"Close").style.display="inline";document.getElementById(e+b+"Open").style.display="none"}}else{f.style.display="none";if(d){document.getElementById(e+b+"Closehover").style.display="none";document.getElementById(e+b+"Openhover").style.display="none";document.getElementById(e+b+"Close").style.display="none";document.getElementById(e+b+"Open").style.display="inline"}else{document.getElementById(e+b+"Closehover").style.display="none";document.getElementById(e+b+"Openhover").style.display="none";document.getElementById(e+b+"Close").style.display="none";document.getElementById(e+b+"Open").style.display="inline"}}}}function SwitchSection(a,d,b){if(document.getElementById(b+a+"Body").style.display=="none"){for(i=1;i<=d;i++){ShowHideSection(i,i==a,b)}}else{ShowHideSection(a,false,b)}}function SwitchSectionSimple(a,d,b){if(document.getElementById(b+a+"Content").style.display=="none"){for(i=1;i<=d;i++){ShowHideSectionSimple(i,i==a,b)}}else{ShowHideSectionSimple(a,false,b)}}function ShowHideSectionSimple(b,a,d){var e=document.getElementById(d+b+"Content");if(e){if(a==null){a=e.style.display=="none"}if(a){e.style.display="block";document.getElementById(d+b+"Close").style.display="inline";document.getElementById(d+b+"Open").style.display="none"}else{e.style.display="none";document.getElementById(d+b+"Close").style.display="none";document.getElementById(d+b+"Open").style.display="inline"}}}(function(d){var a=d.scrollTo=function(g,f,e){d(window).scrollTo(g,f,e)};a.defaults={axis:"xy",duration:parseFloat(d.fn.jquery)>=1.3?0:1};a.window=function(e){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var f=this,e=!f.nodeName||d.inArray(f.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!e){return f}var g=(f.contentWindow||f).document||f.ownerDocument||f;return d.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement})};d.fn.scrollTo=function(g,f,e){if(typeof f=="object"){e=f;f=0}if(typeof e=="function"){e={onAfter:e}}if(g=="max"){g=9000000000}e=d.extend({},a.defaults,e);f=f||e.speed||e.duration;e.queue=e.queue&&e.axis.length>1;if(e.queue){f/=2}e.offset=b(e.offset);e.over=b(e.over);return this._scrollable().each(function(){var o=this,m=d(o),n=g,l,h={},p=m.is("html,body");switch(typeof n){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(n)){n=b(n);break}n=d(n,this);case"object":if(n.is||n.style){l=(n=d(n)).offset()}}d.each(e.axis.split(""),function(t,u){var w=u=="x"?"Left":"Top",y=w.toLowerCase(),s="scroll"+w,r=o[s],q=a.max(o,u);if(l){h[s]=l[y]+(p?0:r-m.offset()[y]);if(e.margin){h[s]-=parseInt(n.css("margin"+w))||0;h[s]-=parseInt(n.css("border"+w+"Width"))||0}h[s]+=e.offset[y]||0;if(e.over[y]){h[s]+=n[u=="x"?"width":"height"]()*e.over[y]}}else{var x=n[y];h[s]=x.slice&&x.slice(-1)=="%"?parseFloat(x)/100*q:x}if(/^\d+$/.test(h[s])){h[s]=h[s]<=0?0:Math.min(h[s],q)}if(!t&&e.queue){if(r!=h[s]){k(e.onAfterFirst)}delete h[s]}});k(e.onAfter);function k(q){m.animate(h,f,e.easing,q&&function(){q.call(this,g,e)})}}).end()};a.max=function(m,l){var k=l=="x"?"Width":"Height",f="scroll"+k;if(!d(m).is("html,body")){return m[f]-d(m)[k.toLowerCase()]()}var h="client"+k,g=m.ownerDocument.documentElement,e=m.ownerDocument.body;return Math.max(g[f],e[f])-Math.min(g[h],e[h])};function b(e){return typeof e=="object"?e:{top:e,left:e}}})(jQuery);function submitAQuoteLead(y,t,q,n,h,g,k,u,s){var a=$("#TxtAQuoteFirstName").val().replace("'","\\'").replace('"','\\"');var l=$("#TxtAQuoteLastName").val().replace("'","\\'").replace('"','\\"');var b=$("#TxtAQuotePhone").val();var w=$("#TxtAQuoteZip").val();var o=$("#TxtAQuoteEmail").val();var d=$("#TxtAQuoteComments").val().replace("'","\\'").replace('"','\\"');var x=$("#ExportIDHidden").val();var p=$("#OriginalUrlEncodedHidden").val();var f=$("#InitialTargetEncodedHidden").val();var m=false;var r=0;var e=$("#TxtAQuoteOfferPrice");if(e.val()){r=Number(e.val().replace("$",""));m=true}if(isValidAQuoteLead()){$.ajax({type:"POST",url:y+"masterpagewebservice.asmx/SubmitAQuoteLead",data:"{siteId: '"+t+"', iid: '"+q+"', spItemId: '"+n+"', pageType: '"+h+"', firstName: '"+a+"', lastName: '"+l+"', phone: '"+(b==undefined?"":b)+"', zip: '"+(w==undefined?"":w)+"', email: '"+o+"', comments: '"+d+"', priceOffered: "+r+", isMakeAnOffer:"+m+", sourcePage: '"+g+"', exportID: '"+x+"', originalUrlEncoded: '"+p+"', initialTargetEncoded: '"+f+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(z){PageTracking(0,false,false,false,k,u);ExecuteConversionTrackingCode("#_GetAQuoteConfirmation",s);$("#_GetAQuoteLeadForm").hide();$("#_GetAQuoteConfirmation").show()},failure:function(z){$("#output").text(z)}})}}function isValidAQuoteLead(){var n=$("#TxtAQuoteFirstName").val();var o=$("#TxtAQuoteLastName").val();var k=$("#TxtAQuotePhone").val();var l=$("#TxtAQuoteEmail").val();var a=$("#TxtAQuoteZip").val();var g="";var f=$("#TxtAQuoteOfferPrice");if(f){g=f.val()}var b=$("#IsAQuoteFirstNameRequiredHidden").val().toLowerCase();var e=$("#IsAQuoteLastNameRequiredHidden").val().toLowerCase();var m=(k==undefined?"false":$("#IsAQuotePhoneNumberRequiredHidden").val().toLowerCase());var d=(a==undefined?"false":$("#IsAQuoteZipCodeRequiredHidden").val().toLowerCase());var p=true;var h="You must enter a value in the following fields: \n";if(f.val()&&(isNullOrEmpty(g)||!Number(g.replace("$","")))){h+="- Please enter a price.\n";p=false}if(b=="true"){if(isNullOrEmpty(n)||n=="First Name"){h+="- Please enter first name.\n";p=false}}if(e=="true"){if(isNullOrEmpty(o)||o=="Last Name"){h+="- Please enter last name.\n";p=false}}if(m=="true"){if(isNullOrEmpty(k)||k=="Phone"){h+="- Please enter phone number.\n";p=false}}if(a&&!/\d{5}/.test(a)&&((!isNullOrEmpty(a)&&a!="Zip Code")||d=="true")){h+="- Please provide a 5 digit numeric zip code.\n";p=false}if(checkEmailStr(l)&&!isNullOrEmpty(l)&&p){p=true}else{if(isNullOrEmpty(l)){h+="- Please enter email address.\n";p=false}else{if(!checkEmailStr(l)){h+="- Email address has wrong format.\n";p=false}}}if(!p){alert(h)}return p}function isValidateNumber(a){var b=window.event?a.keyCode:a.which;return((b>47&&b<58)||b==0||b==8||b==13)}function submitATestDrive(k,a,o,h){var l=$("#RequestATestDriveFirstName").val().replace("'","\\'").replace('"','\\"');var n=$("#RequestATestDriveLastName").val().replace("'","\\'").replace('"','\\"');var f=$("#RequestATestDrivePhone").val();var g=$("#RequestATestDriveEmailAddress").val();var d=$("#RequestATestDriveComments").val().replace("'","\\'").replace('"','\\"');var m=$("#ExportIDHidden").val();var e=$("#OriginalUrlEncodedHidden").val();var b=$("#InitialTargetEncodedHidden").val();if(isValidATestDrive()){$.ajax({type:"POST",url:k+"masterpagewebservice.asmx/SubmitATestDrive",data:"{siteId: '"+a+"', iid: '"+o+"', firstName: '"+l+"', lastName: '"+n+"', phone: '"+f+"', email: '"+g+"', comments: '"+d+"', sourcePage: '"+h+"', exportID: '"+m+"', originalUrlEncoded: '"+e+"', initialTargetEncoded: '"+b+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(p){$("#RequestATestDriveLeadForm").hide();$("#RequestATestDriveConfirmation").show()},failure:function(p){$("#output").text(p)}})}}function isValidATestDrive(){var k=$("#RequestATestDriveFirstName").val();var l=$("#RequestATestDriveLastName").val();var g=$("#RequestATestDrivePhone").val();var h=$("#RequestATestDriveEmailAddress").val();var f=$("#RequestATestDriveComments").val();var a=$("#IsFirstNameRequiredHidden").val().toLowerCase();var d=$("#IsLastNameRequiredHidden").val().toLowerCase();var b=$("#IsPhoneNumberRequiredHidden").val().toLowerCase();var m=true;var e="You must enter a value in the following fields: \n";if(a=="true"){if(isNullOrEmpty(k)){e+="- Please enter first name.\n";m=false}}if(d=="true"){if(isNullOrEmpty(l)){e+="- Please enter last name.\n";m=false}}if(b=="true"){if(isNullOrEmpty(g)){e+="- Please enter phone number.\n";m=false}}if(checkEmailStr(h)&&!isNullOrEmpty(h)){m=true}else{if(isNullOrEmpty(h)){e+="- Please enter email address.\n";m=false}else{if(!checkEmailStr(h)){e+="- Email address has wrong format.\n";m=false}}}if(!m){alert(e)}return m}function submitContact(m,f,b,a,e,l){var n=$("#TxtFirstName").val().replace("'","\\'").replace('"','\\"');var o=$("#TxtLastName").val().replace("'","\\'").replace('"','\\"');var k=$("#TxtEmail").val();var h=$("#TxtPhone").val();var d=$("#TxtZip").val();var g=$("#TxtEmailMessage").val().replace("'","\\'").replace('"','\\"');if(isValidContactInputs(k,h,d)){$.ajax({type:"POST",url:m+"masterpagewebservice.asmx/SubmitContact",data:"{firstName: '"+n+"', lastName: '"+o+"', email: '"+k+"', phone: '"+(h==null?"":h)+"', zip: '"+(d==null?"":d)+"', emailMessage: '"+g+"', pageId: '"+f+"', siteId: '"+b+"'}",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(p){PageTracking(l,true,false,true,a,e);$("#InputFieldBox").hide();$("#ContactFormThankYou").show();$("#ErrorMessageBox").hide()},failure:function(p){$("#output").text(p)}})}}function isValidContactInputs(e,d,g){var k=$("#IsPhoneRequiredHidden").val();var h=$("#IsZipRequiredHidden").val();var f=h==null?"false":h;var b=k==null?"false":k;var a=true;$("#PhoneMessageContainer").empty();$("#ZipMessageContainer").empty();if(isNullOrEmpty(d)&&b=="true"){$("#PhoneMessageContainer").append("<br />* Please provide your Phone Number in 999-999-9999 format.");a=false}if(g&&!/\d{5}/.test(g)&&(!isNullOrEmpty(g.value)||f=="true")){$("#ZipMessageContainer").append("<br />* Please provide a 5 digit numeric zip code.");a=false}$("#ErrorMessageBox").show();return(isValidEmail(e)&&a)}function isValidEmail(a){$("#EmailMessageContainer").empty();if(checkEmailStr(a)&&a.length!=0){return true}else{if(a.length==0){$("#EmailMessageContainer").append("* Please fill out Email Address.")}else{if(!checkEmailStr(a)){$("#EmailMessageContainer").append("* Email address has wrong format.")}}}$("#ErrorMessageBox").show();return false}function submitTradeAppraisal(D,A,l,o,z,p){var d=$("#_txtVin").val();var r=$("#_txtYear").val();var e=$("#_txtMake").val();var k=$("#_txtComments").val();var t=$("#_txtMileage").val();var g=$("#_txtModel").val();var s=$("#_txtIntColor").val();var n=$("#_txtExtColor").val();var b=$("#_txtPayOffBalance").val();var a=$("#_txtFirstName").val().replace("'","\\'").replace('"','\\"');var x=$("#_txtEmail").val();var u=$("#_txtLastName").val().replace("'","\\'").replace('"','\\"');var h=$("#_txtPhone").val();var B=$("#_txtZip").val();var q=$("#_txtMessage").val().replace("'","\\'").replace('"','\\"');var y=$("#_ddlCondition").val();var f=$("#_ddlBestTime").val();var E=$("#_ddlPurchaseTime").val();var C=$("#ExportIDHidden").val();var w=$("#OriginalUrlEncodedHidden").val();var m=$("#InitialTargetEncodedHidden").val();if(isValidForm()){$.ajax({type:"POST",url:D+"masterpagewebservice.asmx/SubmitTradeAppraisal",data:"{vinNumber: '"+d+"', year: '"+r+"', make: '"+e+"', comments: '"+k+"', mileage: '"+t+"', model: '"+g+"', intColor: '"+s+"', extColor: '"+n+"', payOffBalance: '"+b+"', firstName: '"+a+"', email: '"+x+"', lastName: '"+u+"', phone: '"+h+"', zip: '"+B+"', message: '"+q+"', condition: '"+y+"', bestTime: '"+f+"', purchaseTime: '"+E+"', siteId: '"+A+"', contactEmail: '"+l+"', sourcePage: '"+o+"', exportID: '"+C+"', originalUrlEncoded: '"+w+"', initialTargetEncoded: '"+m+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(F){PageTracking(p,true,false,true,"",false);ExecuteConversionTrackingCode("#ThankYouContainer",z);$("#TradeAppraisalFormContainer").hide();$("#ThankYouContainer").show()},failure:function(F){$("#output").text(F)}})}}function isValidForm(){var o=$("#_txtYear").val();var f=$("#_txtMake").val();var r=$("#_txtMileage").val();var g=$("#_txtModel").val();var q=$("#_txtIntColor").val();var m=$("#_txtExtColor").val();var d=$("#_txtPayOffBalance").val();var b=$("#_txtComments").val();var a=$("#_txtFirstName").val();var u=$("#_txtEmail").val();var s=$("#_txtLastName").val();var l=$("#_txtPhone").val();var y=$("#_txtZip").val();var n=$("#_txtMessage").val();var e=$("#IsPhoneTradeRequiredHidden").val();var t=$("#IsZipTradeRequiredHidden").val();var p=t==null?"false":t;var k=e==null?"false":e;var x=true;var w="You must enter a value in the following fields: \n";if(o.length==0){w+="- Vehicle Year.\n";x=false}if(f.length==0){w+="- Vehicle Make.\n";x=false}if(!IsValueValid(b)){w+="- Please fill out Condition Comments with plain text. No HTML allowed.\n";x=false}if(r.length==0){var h=$("#VehicleValidationMessage").val();w+="- "+h+".\n";x=false}if(g.length==0){w+="- Vehicle Model.\n";x=false}if(q.length==0){w+="- Vehicle Interior Color.\n";x=false}if(m.length==0){w+="- Vehicle Exterior Color.\n";x=false}if(d.length==0){w+="- Vehicle Payoff Balance.\n";x=false}if(a.length==0){w+="- Vehicle Payoff Balance.\n";x=false}if(checkEmailStr(u)&&u.length!=0){x=true}else{if(u.length==0){w+="- Email Address.\n";x=false}else{if(!checkEmailStr(u)){w+="- Email Address.\n";x=false}}}if(s.length==0){w+="- Last Name.\n";x=false}if(isNullOrEmpty(l)&&k=="true"){w+="- Phone Number.\n";x=false}if(y!=null&&!/\d{5}/.test(y)&&(!isNullOrEmpty(y)||p=="true")){w+="- Please provide a 5 digit numeric zip code.\n";x=false}if(!IsValueValid(n)){w+="- Please fill out Message with plain text. No HTML allowed.\n";x=false}if(!x){alert(w)}return x}function IsValueValid(b){var a=/^[^<>\\]*$/;return a.test(b)}function IsPhoneNumberValid(b){var a=/\d{3}-\d{3}-\d{4}/;return a.test(b)}function submitRequest(K,l,B,q,E,n,s,F,D,o,L,k){var a=$("#_txtFirstName").val().replace("'","\\'").replace('"','\\"');var t=$("#_txtLastName").val().replace("'","\\'").replace('"','\\"');var u=$("#_txtDayPhone").val();var A=$("#_txtEvePhone").val();var y=$("#_txtEmail").val();var g=$("#_txtAddress").val().replace("'","\\'").replace('"','\\"');var C=$("#_txtCity").val().replace("'","\\'").replace('"','\\"');var h=$("#_txtState").val().replace("'","\\'").replace('"','\\"');var H=$("#_txtZip").val();var G=$("#_txtContactMethod").val();var p=$("#_txtYear").val();var e=$("#_txtMake").val().replace("'","\\'").replace('"','\\"');var f=$("#_txtModel").val().replace("'","\\'").replace('"','\\"');var z=$("#_txtVIN").val();var r=$("#_txtMileage").val();var x=$("#_txtApptDate").val();var d=$("#_txtApptTime").val();var I="";if(document.getElementById("_txtPartsDescription")){I=$("#_txtPartsDescription").val().replace("'","\\'").replace('"','\\"')}var b=$("#_txtComment").val().replace("'","\\'").replace('"','\\"');var J=$("#ExportIDHidden").val();var w=$("#OriginalUrlEncodedHidden").val();var m=$("#InitialTargetEncodedHidden").val();if(isValidRequestForm()){$.ajax({type:"POST",url:K+"masterpagewebservice.asmx/SubmitRequest",data:"{contactEmail: '"+l+"', firstName: '"+a+"', lastName: '"+t+"', address: '"+g+"', city: '"+C+"', state: '"+h+"', dayPhone: '"+(u==null?"":u)+"', zip: '"+(H==null?"":H)+"', evePhone: '"+A+"', email: '"+y+"', contactMethod: '"+G+"', year: '"+p+"', make: '"+e+"', model: '"+f+"', vin: '"+z+"', mileage: '"+r+"', apptDate: '"+x+"', apptTime: '"+d+"', partsDescription: '"+I+"', comment: '"+b+"', contactId: '"+B+"', pageType: '"+q+"', siteId: '"+E+"', sourcePage: '"+n+"', exportID: '"+J+"', originalUrlEncoded: '"+w+"', initialTargetEncoded: '"+m+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(M){PageTracking(o,L,false,k,s,F);ExecuteConversionTrackingCode("#ThankYouContent",D);$("#RequestContent").empty();$("#RequestContent").hide();$("#ThankYouContent").show()},failure:function(M){$("#output").text(M)}})}}function isValidRequestForm(){var a=$("#_txtFirstName").val();var n=$("#_txtLastName").val();var p=$("#_txtDayPhone").val();var w=$("#_txtEvePhone").val();var r=$("#_txtEmail").val();var g=$("#_txtAddress").val();var y=$("#_txtCity").val();var k=$("#_txtState").val();var B=$("#_txtZip").val();var A=$("#_txtContactMethod").val();var l=$("#_txtYear").val();var e=$("#_txtMake").val();var f=$("#_txtModel").val();var t=$("#_txtVIN").val();var m=$("#_txtMileage").val();var s=$("#_txtApptDate").val();var d=$("#_txtApptTime").val();var C=$("#_txtPartsDescription").val();var b=$("#_txtComment").val();var q=$("#IsFirstNameHidden").val();var h=$("#IsLastNameHidden").val();var o=$("#IsPhoneNumberRequiredHidden").val();var D=$("#IsZipCodeRequiredHidden").val();var z=$("#IsToValidatePhoneFormatHidden").val();var x=true;var u="You must enter a value in the following fields: \n";$("#FirstNameError").empty();$("#LastNameError").empty();$("#DayPhoneError").empty();if(a.length==0&&q=="true"){u+="- Please fill out First Name. \n";$("#FirstNameError").html("*");x=false}if(n.length==0&&h=="true"){u+="- Please fill out Last Name. \n";$("#LastNameError").html("*");x=false}if(p!=null&&p.length==0&&o=="true"){u+="- Please fill out Day Phone. \n";$("#DayPhoneError").html("*");x=false}else{if(p!=null&&z=="true"&&!IsPhoneNumberValid(p)){u+="- Day Phone has wrong format (999-999-9999). \n";x=false}}if(B!=null&&!/\d{5}/.test(B)&&(!isNullOrEmpty(B)||D=="true")){u+="- Please provide a 5 digit numeric zip code.\n";x=false}if(r.length==0){u+="- Please fill out Email Address. \n";x=false}else{if(!checkEmailStr(r)){u+="- Email address has wrong format. \n";x=false}}if(l.length==0){u+="- Please fill out Vehicle Year. \n";x=false}else{if(!IsYearValid(l)){u+="- Vehicle Year has wrong format. \n";x=false}}if(e.length==0){u+="- Please fill out Vehicle Make. \n";x=false}if(f.length==0){u+="- Please fill out Vehicle Model. \n";x=false}if(!IsValueValid(b)){u+="- Please fill out Comment with plain text. No HTML allowed. \n";x=false}if(!x){alert(u)}return x}function IsYearValid(b){var a=/^[^<>]*$/;return a.test(b)}function submitTellAFriend(k,e,m,a,h){var b=$("#_txtName").val().replace("'","\\'").replace('"','\\"');var d=$("#_txtSendersEmail").val();var g=$("#_txtEmail").val();var l=$("#_txtCustomMessage").val().replace(/'/g,"_ampersand_");var f=false;if($("#_chkSendCopy").is(":checked")){f=true}if(isValidTellAFriendForm()){$.ajax({type:"POST",url:k+"masterpagewebservice.asmx/SubmitTellAFriend",data:"{vehiclePath: '"+e+"', iid: '"+m+"', name: '"+b+"', sendersEmail: '"+d+"', recipientEmailAddress: '"+g+"', customMessage: '"+l+"', isSendCopy: '"+f+"', siteId: "+a+"}",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(n){if(n==true){PageTracking(h,true,false,true,"",false);$("#ThankYouBox").show();$("#RejectedMessageBox").hide()}else{$("#RejectedMessageBox").show();$("#ThankYouBox").hide()}},failure:function(n){$("#output").text(n);$("#ThankYouBox").hide();$("#RejectedMessageBox").show()}})}}function clearForm(){$("#_txtName").val("");$("#_txtSendersEmail").val("");$("#_txtEmail").val("");$("#_txtCustomMessage").val("");$("#_chkSendCopy").removeAttr("checked");$("#ThankYouBox").hide();$("#RejectedMessageBox").hide()}function submitTellAFriendInventory(l,n,b,k,f,h){var a=$("#_txtName").val().replace("'","\\'").replace('"','\\"');var d=$("#_txtSendersEmail").val();var g=$("#_txtEmail").val();var m=$("#_txtCustomMessage").val().replace(/'/g,"_ampersand_");var e=false;m;if($("#_chkSendCopy").is(":checked")){e=true}if(isValidTellAFriendForm()){$.ajax({type:"POST",url:l+"masterpagewebservice.asmx/SubmitTellAFriendInventory",data:"{currentUrl: '"+n+"', dashboardUrlTail: '"+b+"', currentTitle: '"+k.replace("'",'"').replace("'",'"')+"', currentSource: '"+f+"', name: '"+a+"', sendersEmail: '"+d+"', recipientEmailAddress: '"+g+"', customMessage: '"+m+"', isSendCopy: '"+e+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(o){if(o==true){PageTracking(h,true,false,true,"",false);$("#ThankYouBox").show();$("#RejectedMessageBox").hide()}else{$("#RejectedMessageBox").show();$("#ThankYouBox").hide()}},failure:function(o){$("#output").text(o);$("#ThankYouBox").hide();$("#RejectedMessageBox").show()}})}}function isValidTellAFriendForm(){var b=$("#_txtName").val();var g=$("#_txtSendersEmail").val();var e=$("#_txtEmail").val();var d=$("#_txtCustomMessage").val();var a="You must enter a value in the following fields: \n";var f=true;$("#NameRequiredFieldValidator").empty();$("#RecipientEmailRequiredFieldValidator").empty();$("#EmailRequiredFieldValidator").empty();$("#PersonalMessageRequiredFieldValidator").empty();if(b.length==0){a+="- Your Name.\n";$("#NameRequiredFieldValidator").html("*");f=false}if(g.length==0){a+="- Your Email Address.\n";$("#EmailRequiredFieldValidator").html("*");f=false}else{if(!checkEmailStr(g)){a+="- Your Email Address.\n";$("#EmailRequiredFieldValidator").html("*");f=false}}if(e.length==0){a+="- Recipient's Email Address.\n";$("#RecipientEmailRequiredFieldValidator").html("*");f=false}else{if(!checkEmailStr(e)){a+="- Recipient's Email Address.\n";$("#RecipientEmailRequiredFieldValidator").html("*");f=false}}if(d.length==0){a+="- Personal Message.\n";$("#PersonalMessageRequiredFieldValidator").html("*");f=false}if(!IsValueValid(b)){a+='You have entered an invalid character in the field "Your Name"\nThese characters are not allowed: \\ > and <\n';$("#NameRequiredFieldValidator").html("*");f=false}if(!IsValueValid(d)){a+='You have entered an invalid character in the field "Personal Message"\nThese characters are not allowed: \\ > and <\n';$("#PersonalMessageRequiredFieldValidator").html("*");f=false}if(!f){alert(a)}return f}function submitCreditApp(){if(IsValidCreditApp()){$("#_chPermission").val("true");$("#CreditForm").submit()}}function showTradeInBox(){if($("#_chkShowTradeIn").is(":checked")){$("#ShowTradeInYear").show();$("#ShowTradeInMake").show();$("#ShowTradeInModel").show();$("#ShowTradeInMileage").show();$("#_chkShowTradeIn").val("true")}else{$("#ShowTradeInYear").hide();$("#ShowTradeInMake").hide();$("#ShowTradeInModel").hide();$("#ShowTradeInMileage").hide();$("#_chkShowTradeIn").val("false")}}function showPrevAddress(){var b=$("#IsShowPrevAddressHiden").val();var a=$("#_chkShowPrevAddress").is(":checked");if(!isNullOrEmpty(b)&&b.toLowerCase()=="true"&&a){$("#ShowPrevAddress").show();$("#ShowPrevCityAndZipCode").show()}else{$("#ShowPrevAddress").hide();$("#ShowPrevCityAndZipCode").hide()}}function showCoApplicant(){var b=$("#IsShowCoApplicantHiden").val();var a=$("#_chkShowCoApplicant").is(":checked");if(!isNullOrEmpty(b)&&b.toLowerCase()=="true"&&a){$("#ShowCoApplicantSocialSecurity").show();$("#ShowCoApplicantDateOfBirth").show();$("#ShowCoApplicantSpouse").show();$("#ShowCoApplicantEmailAddress").show();$("#ShowCoApplicantFullName").show();$("#ShowCoApplicantHomeAddress").show();$("#ShowCoApplicantCityAndZipCode").show();$("#ShowCoApplicantRentOrOwn").show();$("#ShowCoApplicanRentOrMortgageAmount").show();$("#ShowCoApplicanResidencyLength").show();$("#ShowCoApplicanHomeTelephone").show();$("#ShowCoApplicanMobileTelephone").show();$("#PreviousAddressFormText").show();$("#PreviousAddressFormTextHeader").show();$("#PreviousAddressFormTextBottom").show();$("#BankInfoFormText").show();$("#BankInfoFormTextHeader").show();$("#BankInfoBankName").show();$("#BankInfoAccountType").show();$("#BankInfoCheckingOrSavingsAccount").show();$("#EmploymentInfoFormText").show();$("#EmploymentInfoFormTextHeader").show();$("#EmploymentInfoEmployer").show();$("#EmploymentInfoSelfEmployment").show();$("#EmploymentInfoJobTitle").show();$("#EmploymentInfoWorkTelephone").show();$("#EmploymentInfoEmploymentLength").show();$("#EmploymentInfoApproxGrossIncome").show();$("#PreviousEmploymentInfoFormText").show();$("#PreviousEmploymentInfoFormTextHeader").show();$("#PreviousEmploymentInfoBottom").show();$("#AdditionalIncomeInfoFormText").show();$("#AdditionalIncomeInfoFormTextHeader").show();$("#AdditionalIncomeInfoAmount").show();$("#AdditionalIncomeInfoSource").show()}else{$("#ShowCoApplicantSocialSecurity").hide();$("#ShowCoApplicantDateOfBirth").hide();$("#ShowCoApplicantSpouse").hide();$("#ShowCoApplicantEmailAddress").hide();$("#ShowCoApplicantFullName").hide();$("#ShowCoApplicantHomeAddress").hide();$("#ShowCoApplicantCityAndZipCode").hide();$("#ShowCoApplicantRentOrOwn").hide();$("#ShowCoApplicanRentOrMortgageAmount").hide();$("#ShowCoApplicanResidencyLength").hide();$("#ShowCoApplicanHomeTelephone").hide();$("#ShowCoApplicanMobileTelephone").hide();$("#PreviousAddressFormText").hide();$("#PreviousAddressFormTextHeader").hide();$("#PreviousAddressFormTextBottom").hide();$("#ShowCoPrevAddress").hide();$("#ShowCoPrevAddressCity").hide();$("#BankInfoFormText").hide();$("#BankInfoFormTextHeader").hide();$("#BankInfoBankName").hide();$("#BankInfoAccountType").hide();$("#BankInfoCheckingOrSavingsAccount").hide();$("#EmploymentInfoFormText").hide();$("#EmploymentInfoFormTextHeader").hide();$("#EmploymentInfoEmployer").hide();$("#EmploymentInfoSelfEmployment").hide();$("#EmploymentInfoJobTitle").hide();$("#EmploymentInfoWorkTelephone").hide();$("#EmploymentInfoEmploymentLength").hide();$("#EmploymentInfoApproxGrossIncome").hide();$("#PreviousEmploymentInfoFormText").hide();$("#PreviousEmploymentInfoFormTextHeader").hide();$("#PreviousEmploymentInfoBottom").hide();$("#ShowCoPrevEmployment").hide();$("#ShowCoPrevEmploymentSelfEmployment").hide();$("#ShowCoPrevEmploymentJobTitle").hide();$("#ShowCoPrevEmploymentWorkTelephone").hide();$("#ShowCoPrevEmploymentLength").hide();$("#AdditionalIncomeInfoFormText").hide();$("#AdditionalIncomeInfoFormTextHeader").hide();$("#AdditionalIncomeInfoAmount").hide();$("#AdditionalIncomeInfoSource").hide();$("#_chkShowCoPrevEmployment").removeAttr("checked");$("#_chkShowCoPrevAddress").removeAttr("checked")}}function showCoPrevAddress(){var b=$("#IsShowCoApplicantHiden").val();var a=$("#_chkShowCoPrevAddress").is(":checked");if(!isNullOrEmpty(b)&&b.toLowerCase()=="true"&&a){$("#ShowCoPrevAddress").show();$("#ShowCoPrevAddressCity").show()}else{$("#ShowCoPrevAddress").hide();$("#ShowCoPrevAddressCity").hide()}}function showPrevEmployment(d){var a=$("#_chkShowPrevEmployment").is(":checked");var b=$("#IsShowPrevEmploymentHiden").val();if(!isNullOrEmpty(b)&&b.toLowerCase()=="true"&&a){$("#ShowPrevEmploymentEmployer").show();$("#ShowPrevEmploymentSelf").show();$("#ShowPrevEmploymentJobTitle").show();$("#ShowPrevEmploymentWorkTelephone").show();$("#ShowPrevEmploymentLength").show()}else{$("#ShowPrevEmploymentEmployer").hide();$("#ShowPrevEmploymentSelf").hide();$("#ShowPrevEmploymentJobTitle").hide();$("#ShowPrevEmploymentWorkTelephone").hide();$("#ShowPrevEmploymentLength").hide()}}function showCoPrevEmployment(){var a=$("#_chkShowCoPrevEmployment").is(":checked");var b=$("#IsShowCoPrevEmploymentHiden").val();if(!isNullOrEmpty(b)&&b.toLowerCase()=="true"&&a){$("#ShowCoPrevEmployment").show();$("#ShowCoPrevEmploymentSelfEmployment").show();$("#ShowCoPrevEmploymentJobTitle").show();$("#ShowCoPrevEmploymentWorkTelephone").show();$("#ShowCoPrevEmploymentLength").show()}else{$("#ShowCoPrevEmployment").hide();$("#ShowCoPrevEmploymentSelfEmployment").hide();$("#ShowCoPrevEmploymentJobTitle").hide();$("#ShowCoPrevEmploymentWorkTelephone").hide();$("#ShowCoPrevEmploymentLength").hide()}}function IsValidCreditApp(){var bd=$("#_txtYear").val();var B=$("#_txtMake").val();var k=$("#_txtModel").val();var a8=$("#_txtTradeInYear").val();var u=$("#_txtTradeInMake").val();var aP=$("#_txtTradeInModel").val();var K=$("#_txtTradeInMileage").val();var aN=$("#_txtSSN1").val();var aM=$("#_txtSSN2").val();var aK=$("#_txtSSN3").val();var aw=$("#_txtDriversLicense").val();var A=$("#_txtDOB").val();var bf=$("#_txtEmail").val();var aS=$("#_txtFirstName").val();var ap=$("#_txtLastName").val();var av=$("#_txtHomeAddressNumber").val();var ay=$("#_txtHomeAddress1").val();var U=$("#_txtHomeCity").val();var aX=$("#_txtHomeZip").val();var s=$("#_txtHomePhone1").val();var r=$("#_txtHomePhone2").val();var q=$("#_txtHomePhone3").val();var J=$("#_txtPrevHomeAddressNumber").val();var aV=$("#_txtPrevHomeAddress1").val();var aq=$("#_txtPrevHomeCity").val();var L=$("#_txtPrevHomeZip").val();var a2=$("#_txtBankName").val();var ar=$("#_txtEmployer").val();var aY=$("#_txtJobTitle").val();var W=$("#_txtWorkPhone1").val();var V=$("#_txtWorkPhone2").val();var T=$("#_txtWorkPhone3").val();var aU=$("#_txtPrevEmployer").val();var g=$("#_txtPrevJobTitle").val();var aC=$("#_txtPrevWorkPhone1").val();var aA=$("#_txtPrevWorkPhone2").val();var ax=$("#_txtPrevWorkPhone3").val();var bb=$("#_txtReFirstName").val();var t=$("#_txtReLastName").val();var e=$("#_txtReHomePhone1").val();var d=$("#_txtReHomePhone2").val();var b=$("#_txtReHomePhone3").val();var ab=$("#_txtReHomeAddressNumber").val();var y=$("#_txtReHomeAddress1").val();var bc=$("#_txtReHomeCity").val();var m=$("#_txtReHomeZip").val();var x=$("#_txtRe2FirstName").val();var h=$("#_txtRe2LastName").val();var ba=$("#_txtRe2HomePhone1").val();var a9=$("#_txtRe2HomePhone2").val();var a7=$("#_txtRe2HomePhone3").val();var X=$("#_txtRe2HomeAddressNumber").val();var aJ=$("#_txtRe2HomeCity").val();var al=$("#_txtRe2HomeZip").val();var a1=$("#_txtCoSSN1").val();var aZ=$("#_txtCoSSN2").val();var aW=$("#_txtCoSSN3").val();var aI=$("#_txtCoDOB").val();var P=$("#_txtCoEmail").val();var G=$("#_txtCoFirstName").val();var a4=$("#_txtCoLastName").val();var a0=$("#_txtCoHomeAddressNumber").val();var bg=$("#_txtCoHomeAddress1").val();var az=$("#_txtCoHomeCity").val();var aR=$("#_txtCoHomeZip").val();var ag=$("#_txtCoHomePhone1").val();var af=$("#_txtCoHomePhone2").val();var ae=$("#_txtCoHomePhone3").val();var D=$("#_txtCoPrevHomeAddressNumber").val();var M=$("#_txtCoPrevHomeAddress1").val();var aT=$("#_txtCoPrevHomeCity").val();var o=$("#_txtCoPrevHomeZip").val();var C=$("#_txtCoBankName").val();var a3=$("#_txtCoEmployer").val();var n=$("#_txtCoJobTitle").val();var aE=$("#_txtCoWorkPhone1").val();var aD=$("#_txtCoWorkPhone2").val();var aB=$("#_txtCoWorkPhone3").val();var a=$("#_txtCoPrevEmployer").val();var I=$("#_txtCoPrevJobTitle").val();var S=$("#_txtCoPrevWorkPhone1").val();var R=$("#_txtCoPrevWorkPhone2").val();var Q=$("#_txtCoPrevWorkPhone3").val();var aL=$("#_txtDownPayment").val();var w=$("#_txtRentMortgageAmount").val();var F=$("#_txtIncome").val();var ad=$("#_txtIncomeAmount").val();var aH=$("#_chkShowPrevAddress").is(":checked");var p=$("#_chkShowPrevEmployment").is(":checked");var aQ=$("#_chkShowCoApplicant").is(":checked");var l=$("#_chkShowCoPrevAddress").is(":checked");var a6=$("#IsShowPrevEmploymentHiden").val();var z=$("#IsShowCoApplicantHiden").val();var aF=$("#IsRquireEmploymentInfoHidden").val();var ak=$("#IsRequireRelativeSectionHiden").val();var ai=$("#IsShowPrevAddressHiden").val();var H=$("#IsShowCoApplicantHiden").val();var O=$("#IsRequireRelativeSection2Hiden").val();var aa=$("#IsRequireBankInfoHidden").val();if(z!=null){z=z.toLowerCase()}if(ai!=null){ai=ai.toLowerCase()}if(H!=null){H=H.toLowerCase()}if(ak!=null){ak=ak.toLowerCase()}if(O!=null){O=O.toLowerCase()}if(aa!=null){aa=aa.toLowerCase()}if(aF!=null){aF=aF.toLowerCase()}var aG="You must enter a value in the following fields: \n";var aj=true;$("#ErrorMessageContainer").empty();$("#ErrorMessageContainer").append("You must enter a value in the following fields:");$("#ErrorMessageContainer").append("<ul>");if(!isNullOrEmpty(aL)){if(!parseFloat(aL)){aG+="- Your downpayment format.\n";$("#ErrorMessageContainer").append("<li>Your downpayment format.</li>");aj=false}}if(!isNullOrEmpty(w)&&isNaN(parseFloat(w))){aG+="- Your Rent or Mortgage Amount.\n";$("#ErrorMessageContainer").append("<li>Your Rent or Mortgage Amount.</li>");aj=false}var ah=$("#IsIncomeHiden").val();if(!isNullOrEmpty(ah)&&ah.toLowerCase()=="true"){if(!isNullOrEmpty(F)){if(!parseFloat(F)){aG+="- Your Approx. Monthly Gross Income.\n";$("#ErrorMessageContainer").append("<li>Your Approx. Monthly Gross Income.</li>");aj=false}}}var Y=$("#IsIncomeAmountHiden").val();if(!isNullOrEmpty(Y)&&Y.toLowerCase()=="true"){if(!isNullOrEmpty(ad)){if(!parseFloat(ad)){aG+="- Your Additional Amount (annual).\n";$("#ErrorMessageContainer").append("<li>Your Additional Amount (annual).</li>");aj=false}}}var a5=$("#_ddlHomeState").val();if(!isNullOrEmpty(a5)&&a5=="N/A"){aG+="- Your Home State.\n";$("#ErrorMessageContainer").append("<li>Your Home State.</li>");aj=false}var at=$("#_ddlPrevHomeState").val();if(!isNullOrEmpty(ai)&&ai=="true"&&aH&&!isNullOrEmpty(at)&&at=="N/A"){aG+="- Your Previous Address State.\n";$("#ErrorMessageContainer").append("<li>Your Previous Address State.</li>");aj=false}var au=$("#_ddlCoHomeState").val();if(!isNullOrEmpty(z)&&z=="true"&&aQ&&au!=null&&au=="N/A"){aG+="- Co-Applicant Home State.\n";$("#ErrorMessageContainer").append("<li>Co-Applicant Home State.</li>");aj=false}var Z=$("#_ddlCoPrevHomeState").val();if(!isNullOrEmpty(z)&&z=="true"&&aQ&&H=="true"&&l!=null&&l&&!isNullOrEmpty(Z)&&Z=="N/A"){aG+="- Co-Applicant Previous Address State.\n";$("#ErrorMessageContainer").append("<li>Co-Applicant Previous Address State.</li>");aj=false}var E=$("#_ddlReHomeState").val();if(!isNullOrEmpty(ak)&&ak=="true"&&E!=null&&E=="N/A"){aG+="- Relative Address State.\n";$("#ErrorMessageContainer").append("<li>Relative Address State.</li>");aj=false}var ac=$("#_ddlRe2HomeState").val();if(!isNullOrEmpty(O)&&ac!=null&&ac=="N/A"){aG+="- Friend's Address State.\n";$("#ErrorMessageContainer").append("<li>Friend's Address State.</li>");aj=false}var aO=$("#ItemDataHidden").val();if(isNullOrEmpty(aO)){if(isNullOrEmpty(bd)){aG+="- Year of vehicle of interest.\n";$("#ErrorMessageContainer").append("<li>Year of vehicle of interest.</li>");aj=false}if(isNullOrEmpty(B)){aG+="- Make of vehicle on interest.\n";$("#ErrorMessageContainer").append("<li>Make of vehicle on interest.</li>");aj=false}if(isNullOrEmpty(k)){aG+="- Model of vehicle of interest.\n";$("#ErrorMessageContainer").append("<li>Model of vehicle of interest.</li>");aj=false}}if($("#_chkShowTradeIn").is(":checked")){if(isNullOrEmpty(a8)){aG+="- Year of Trade-In vehicle.\n";$("#ErrorMessageContainer").append("<li>Year of Trade-In vehicle.</li>");aj=false}if(isNullOrEmpty(u)){aG+="- Make of Trade-In vehicle.\n";$("#ErrorMessageContainer").append("<li>Make of Trade-In vehicle.</li>");aj=false}if(isNullOrEmpty(aP)){aG+="- Model of Trade-In vehicle.\n";$("#ErrorMessageContainer").append("<li>Model of Trade-In vehicle.</li>");aj=false}if(isNullOrEmpty(K)){aG+="- Mileage/KMs of Trade-In vehicle.\n";$("#ErrorMessageContainer").append("<li>Mileage/KMs of Trade-In vehicle.</li>");aj=false}}var f=$("#IsCountryCodeUSAHiden").val();if(!isNullOrEmpty(f)){f=f.toLowerCase()}if(isNullOrEmpty(aN)){aG+="- First three digits of your social security number.\n";$("#ErrorMessageContainer").append("<li>First three digits of your social security number.</li>");aj=false}else{if(!isNullOrEmpty(aN)&&!IsSSNValid(aN,"SSN1",f)){aG+="- First three digits of your social security number.\n";$("#ErrorMessageContainer").append("<li>First three digits of your social security number.</li>");aj=false}}if(isNullOrEmpty(aM)){aG+="- Second digits of your social security number.\n";$("#ErrorMessageContainer").append("<li>Second digits of your social security number.</li>");aj=false}else{if(!isNullOrEmpty(aM)&&!IsSSNValid(aM,"SSN2",f)){if(f=="true"){aG+="- Second two digits of your social security number.";$("#ErrorMessageContainer").append("<li>Second two digits of your social security number.</li>")}else{aG+="- Second three digits of your social security number.";$("#ErrorMessageContainer").append("<li>Second three digits of your social security number.</li>")}aj=false}}if(isNullOrEmpty(aK)){$("#ErrorMessageContainer").append("<li>Last digits of your social security number.</li>");aG+="- Last digits of your social security number.\n";aj=false}else{if(!isNullOrEmpty(aK)&&!IsSSNValid(aK,"SSN3",f)){if(f=="true"){aG+="- Last four digits of your social security number.\n";$("#ErrorMessageContainer").append("<li>Last four digits of your social security number.</li>")}else{aG+="- Last three digits of your social security number.";$("#ErrorMessageContainer").append("<li>Last three digits of your social security number.</li>")}aj=false}}if(isNullOrEmpty(aw)){aG+="- Your Drivers License.\n";$("#ErrorMessageContainer").append("<li>Your Drivers License.</li>");aj=false}if(isNullOrEmpty(A)){aG+="- Your date of birth. Date format expecting to be as mm-dd-yyyy or mm.dd.yyyy or mm/dd/yyyy.\n";$("#ErrorMessageContainer").append("<li>Your date of birth.</li>");aj=false}else{if(!isNullOrEmpty(A)&&!checkDate(A)){aG+="- Date format expecting to be as mm-dd-yyyy or mm.dd.yyyy or mm/dd/yyyy.\n";$("#ErrorMessageContainer").append("<li>Date format expecting to be as mm-dd-yyyy or mm.dd.yyyy or mm/dd/yyyy.</li>");aj=false}}if(isNullOrEmpty(bf)){aG+="- Your email address.  Email format expecting to be as username@domain.\n";$("#ErrorMessageContainer").append("<li>Your email address.</li>");aj=false}else{if(!isNullOrEmpty(bf)&&!checkEmailStr(bf)){$("#ErrorMessageContainer").append("<li>Your email address.</li>");aG+="- Your email address.\n";aj=false}}if(isNullOrEmpty(aS)){$("#ErrorMessageContainer").append("<li>Your first name.</li>");aG+="- Your first name.\n";aj=false}if(isNullOrEmpty(ap)){$("#ErrorMessageContainer").append("<li>Your last name.</li>");aG+="- Your last name.\n";aj=false}if(isNullOrEmpty(av)){$("#ErrorMessageContainer").append("<li>Your home address number.</li>");aG+="- Your home address number.\n";aj=false}if(isNullOrEmpty(ay)){$("#ErrorMessageContainer").append("<li>Your home address.</li>");aG+="- Your home address.\n";aj=false}if(isNullOrEmpty(U)){$("#ErrorMessageContainer").append("<li>Your home city.</li>");aG+="- Your home city.\n";aj=false}if(isNullOrEmpty(aX)){$("#ErrorMessageContainer").append("<li>Your home zip.</li>");aG+="- Your home zip.\n";aj=false}if(isNullOrEmpty(s)){$("#ErrorMessageContainer").append("<li>Your home phone number.</li>");aG+="- Your home phone number.\n";aj=false}if(isNullOrEmpty(r)){$("#ErrorMessageContainer").append("<li>Your home phone number.</li>");aG+="- Your home phone number.\n";aj=false}if(isNullOrEmpty(q)){$("#ErrorMessageContainer").append("<li>Your home phone number.</li>");aG+="- Your home phone number.\n";aj=false}if(ai=="true"&&aH){if(isNullOrEmpty(J)){$("#ErrorMessageContainer").append("<li>Your previous home address number.</li>");aG+="- Your previous home address number.\n";aj=false}if(isNullOrEmpty(aV)){$("#ErrorMessageContainer").append("<li>Your previous home address.</li>");aG+="- Your previous home address.\n";aj=false}if(isNullOrEmpty(aq)){$("#ErrorMessageContainer").append("<li>Your previous home city.</li>");aG+="- Your previous home city.\n";aj=false}if(isNullOrEmpty(L)){$("#ErrorMessageContainer").append("<li>Your previous home zip.</li>");aG+="- Your previous home zip.\n";aj=false}}if(!isNullOrEmpty(aa)&&aa=="true"){if(isNullOrEmpty(a2)){$("#ErrorMessageContainer").append("<li>Your banks name.</li>");aG+="- Your banks name.\n";aj=false}}if(!isNullOrEmpty(aF)&&aF=="true"){if(isNullOrEmpty(ar)){$("#ErrorMessageContainer").append("<li>Your employers name.</li>");aG+="- Your employers name.\n";aj=false}if(isNullOrEmpty(aY)){$("#ErrorMessageContainer").append("<li>Your job title.</li>");aG+="- Your job title.\n";aj=false}if(isNullOrEmpty(W)){$("#ErrorMessageContainer").append("<li>Your work phone number.</li>");aG+="- Your work phone number.\n";aj=false}if(isNullOrEmpty(V)){$("#ErrorMessageContainer").append("<li>Your work phone number.</li>");aG+="- Your work phone number.\n";aj=false}if(isNullOrEmpty(T)){$("#ErrorMessageContainer").append("<li>Your work phone number.</li>");aG+="- Your work phone number.\n";aj=false}}if(!isNullOrEmpty(a6)&&a6.toLowerCase()=="true"&&p){if(isNullOrEmpty(aU)){$("#ErrorMessageContainer").append("<li>Your previous employers name.</li>");aG+="- Your previous employers name.\n";aj=false}if(isNullOrEmpty(g)){$("#ErrorMessageContainer").append("<li>Your previous job title.</li>");aG+="- Your previous job title.\n";aj=false}if(isNullOrEmpty(aC)){$("#ErrorMessageContainer").append("<li>Your previous work phone number.</li>");aG+="- Your previous work phone number.\n";aj=false}if(isNullOrEmpty(aA)){$("#ErrorMessageContainer").append("<li>Your previous work phone number.</li>");aG+="- Your previous work phone number.\n";aj=false}if(isNullOrEmpty(ax)){$("#ErrorMessageContainer").append("<li>Your previous work phone number.</li>");aG+="- Your previous work phone number.\n";aj=false}}if(!isNullOrEmpty(ak)&&ak=="true"){if(isNullOrEmpty(bb)){$("#ErrorMessageContainer").append("<li>Relative First Name.</li>");aG+="- Relative First Name.\n";aj=false}if(isNullOrEmpty(t)){$("#ErrorMessageContainer").append("<li>Relative Last Name.</li>");aG+="- Relative Last Name.\n";aj=false}if(isNullOrEmpty(e)){$("#ErrorMessageContainer").append("<li>Relative Phone Number.</li>");aG+="- Relative Phone Number.\n";aj=false}if(isNullOrEmpty(d)){$("#ErrorMessageContainer").append("<li>Relative Phone Number.</li>");aG+="- Relative Phone Number.\n";aj=false}if(isNullOrEmpty(b)){$("#ErrorMessageContainer").append("<li>Relative Phone Number.</li>");aG+="- Relative Phone Number.\n";aj=false}if(isNullOrEmpty(ab)){$("#ErrorMessageContainer").append("<li>Relative home address number.</li>");aG+="- Relative home address number.\n";aj=false}if(isNullOrEmpty(y)){$("#ErrorMessageContainer").append("<li>Relative home address.</li>");aG+="- Relative home address.\n";aj=false}if(isNullOrEmpty(bc)){$("#ErrorMessageContainer").append("<li>Relative home city.</li>");aG+="- Relative home city.\n";aj=false}if(isNullOrEmpty(m)){$("#ErrorMessageContainer").append("<li>Relative home zip.</li>");aG+="- Relative home zip.\n";aj=false}}if(!isNullOrEmpty(O)&&O=="true"){if(isNullOrEmpty(x)){$("#ErrorMessageContainer").append("<li>Friend's First Name.</li>");aG+="- Friend's First Name.\n";aj=false}if(isNullOrEmpty(h)){$("#ErrorMessageContainer").append("<li>Friend's Last Name.</li>");aG+="- Friend's Last Name.\n";aj=false}if(isNullOrEmpty(ba)){$("#ErrorMessageContainer").append("<li>Friend's Phone Number.</li>");aG+="- Friend's Phone Number.\n";aj=false}if(isNullOrEmpty(a9)){$("#ErrorMessageContainer").append("<li>Friend's Phone Number.</li>");aG+="- Friend's Phone Number.\n";aj=false}if(isNullOrEmpty(a7)){$("#ErrorMessageContainer").append("<li>Friend's Phone Number.</li>");aG+="- Friend's Phone Number.\n";aj=false}if(isNullOrEmpty(X)){$("#ErrorMessageContainer").append("<li>Friend's home address number.</li>");aG+="- Friend's home address number.\n";aj=false}if(isNullOrEmpty(aJ)){$("#ErrorMessageContainer").append("<li>Friend's home city.</li>");aG+="- Friend's home city.\n";aj=false}if(isNullOrEmpty(al)){$("#ErrorMessageContainer").append("<li>Friend's home zip.</li>");aG+="- Friend's home zip.\n";aj=false}}if(z=="true"&&aQ){if(isNullOrEmpty(a1)){aG+="- First three digits of co-applicant social security number.\n";$("#ErrorMessageContainer").append("<li>First three digits of co-applicant social security number.</li>");aj=false}else{if(!isNullOrEmpty(a1)&&!IsSSNValid(a1,"SSN1",f)){aG+="- First three digits of co-applicant social security number.\n";$("#ErrorMessageContainer").append("<li>First three digits of co-applicant social security number.</li>");aj=false}}if(isNullOrEmpty(aZ)){$("#ErrorMessageContainer").append("<li>Second digits of co-applicant social security number.</li>");aG+="- Second digits of co-applicant social security number.\n";aj=false}else{if(!isNullOrEmpty(aZ)&&!IsSSNValid(aZ,"SSN2",f)){if(f=="true"){aG+="- Second two digits of co-applicant social security number.";$("#ErrorMessageContainer").append("<li>Second two digits of co-applicant social security number.</li>")}else{aG+="- Second three digits of co-applicant social security number.";$("#ErrorMessageContainer").append("<li>Second three digits of co-applicant social security number.</li>")}aj=false}}if(isNullOrEmpty(aW)){$("#ErrorMessageContainer").append("<li>Last digits of co-applicant social security number.</li>");aG+="- Last digits of co-applicant social security number.\n";aj=false}else{if(!isNullOrEmpty(aW)&&!IsSSNValid(aW,"SSN3",f)){if(f=="true"){aG+="- Last four digits of co-applicant social security number.";$("#ErrorMessageContainer").append("<li>Last four digits of co-applicant social security number.</li>")}else{aG+="- Second three digits of co-applicant social security number.";$("#ErrorMessageContainer").append("<li>Last three digits of co-applicant social security number.</li>")}aj=false}}if(isNullOrEmpty(aI)){$("#ErrorMessageContainer").append("<li>Co-applicant date of birth.</li>");aG+="- Co-applicant date of birth.\n";aj=false}else{if(!isNullOrEmpty(aI)&&!checkDate(aI)){$("#ErrorMessageContainer").append("<li>Co-Applicant date format expecting to be as mm-dd-yyyy or mm.dd.yyyy or mm/dd/yyyy.</li>");aG+="- Co-Applicant date format expecting to be as mm-dd-yyyy or mm.dd.yyyy or mm/dd/yyyy.\n";aj=false}}if(isNullOrEmpty(P)){$("#ErrorMessageContainer").append("<li>Co-applicant email address.</li>");aG+="- Co-applicant email address.\n";aj=false}else{if(!isNullOrEmpty(P)&&!checkEmailStr(P)){$("#ErrorMessageContainer").append("<li>Co-applicant email address.</li>");aG+="- Co-applicant email address.\n";aj=false}}if(isNullOrEmpty(G)){aG+="- Co-applicant first name.\n";$("#ErrorMessageContainer").append("<li>Co-applicant first name.</li>");aj=false}if(isNullOrEmpty(a0)){aG+="- Your coapplicant home address number.\n";$("#ErrorMessageContainer").append("<li>Your coapplicant home address number.</li>");aj=false}if(isNullOrEmpty(bg)){$("#ErrorMessageContainer").append("<li>Your coapplicant home address.</li>");aG+="- Your coapplicant home address.\n";aj=false}if(isNullOrEmpty(az)){$("#ErrorMessageContainer").append("<li>Co-applicant previous home city.</li>");aG+="- Co-applicant previous home city.\n";aj=false}if(isNullOrEmpty(aR)){$("#ErrorMessageContainer").append("<li>Co-applicant previous home zip.</li>");aG+="- Co-applicant previous home zip.\n";aj=false}if(isNullOrEmpty(ag)){$("#ErrorMessageContainer").append("<li>Your co-applicant home phone number.</li>");aG+="- Your co-applicant home phone number.\n";aj=false}var ao=$("#_txtCoRentMortgageAmount").val();if(!isNullOrEmpty(ao)&&isNaN(parseFloat(ao))){aG+="- Co-Applicant Rent or Mortgage Amount.\n";$("#ErrorMessageContainer").append("<li>Co-Applicant Rent or Mortgage Amount.</li>");aj=false}var an=$("#_txtCoIncome").val();if(!isNullOrEmpty(an)){if(!parseFloat(an)){aG+="- Co-Applicant Approx. Monthly Gross Income.\n";$("#ErrorMessageContainer").append("<li>Co-Applicant Approx. Monthly Gross Income.</li>");aj=false}}var am=$("#_txtCoIncomeAmount").val();if(!isNullOrEmpty(am)){if(!parseFloat(am)){aG+="- Co-Applicant Additional Amount (annual).\n";$("#ErrorMessageContainer").append("<li>Co-Applicant Additional Amount (annual).</li>");aj=false}}if(isNullOrEmpty(af)){aG+="- Your co-applicant home phone number.\n";$("#ErrorMessageContainer").append("<li>Your co-applicant home phone number.</li>");aj=false}if(isNullOrEmpty(ae)){aG+="- Your co-applicant home phone number.\n";$("#ErrorMessageContainer").append("<li>Your co-applicant home phone number.</li>");aj=false}if(H=="true"&&l){if(isNullOrEmpty(D)){aG+="- Your coapplicant previous home address number.\n";$("#ErrorMessageContainer").append("<li>Your coapplicant previous home address number.</li>");aj=false}if(isNullOrEmpty(M)){aG+="- Your coapplicant previous home address.\n";$("#ErrorMessageContainer").append("<li>Your coapplicant previous home address.</li>");aj=false}if(isNullOrEmpty(aT)){$("#ErrorMessageContainer").append("<li>Co-applicant previous home city.</li>");aG+="- Co-applicant previous home city.\n";aj=false}if(isNullOrEmpty(o)){aG+="- Co-applicant previous home zip.\n";$("#ErrorMessageContainer").append("<li>Co-applicant previous home zip.</li>");aj=false}}if(!isNullOrEmpty(aa)&&aa=="true"){if(isNullOrEmpty(C)){$("#ErrorMessageContainer").append("<li>Your co-applicant banks name.</li>");aG+="- Your co-applicant banks name.\n";aj=false}}if(isNullOrEmpty(a3)){$("#ErrorMessageContainer").append("<li>Co-applicant previous employers name.</li>");aG+="- Co-applicant previous employers name.\n";aj=false}if(isNullOrEmpty(n)){$("#ErrorMessageContainer").append("<li>Co-applicant previous job title.</li>");aG+="- Co-applicant previous job title.\n";aj=false}if(isNullOrEmpty(aE)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}if(isNullOrEmpty(aD)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}if(isNullOrEmpty(aB)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}var N=$("#_chkShowCoPrevEmployment").is(":checked");var be=$("#IsShowCoPrevEmploymentHiden").val();if(!isNullOrEmpty(be)){be=be.toLowerCase()}if(!isNullOrEmpty(be)&&be=="true"&&N){if(isNullOrEmpty(a)){$("#ErrorMessageContainer").append("<li>Co-applicant previous employers name.</li>");aG+="- Co-applicant previous employers name.\n";aj=false}if(isNullOrEmpty(I)){$("#ErrorMessageContainer").append("<li>Co-applicant previous job title.</li>");aG+="- Co-applicant previous job title.\n";aj=false}if(isNullOrEmpty(S)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}if(isNullOrEmpty(R)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}if(isNullOrEmpty(Q)){$("#ErrorMessageContainer").append("<li>Co-applicant previous work phone number.</li>");aG+="- Co-applicant previous work phone number.\n";aj=false}}}if(!$("#_chPermission").is(":checked")){aG+="- You must agree with terms and conditions of this application.\n";$("#ErrorMessageContainer").append("<li>You must agree with terms and conditions of this application.</li>");aj=false}if(!aj){$("#ErrorMessageContainer").append("</ul>");$("#ErrorMessageContainer").show();alert(aG)}return aj}function isNullOrEmpty(a){if(a==null||a==""){return true}return false}function IsSSNValid(e,b,d){var a;if(b=="SSN1"&&d=="true"){a=/\d{3}/}else{if(b=="SSN2"&&d=="true"){a=/\d{2}/}else{if(b=="SSN3"&&d=="true"){a=/\d{4}/}else{if(b=="SSN1"&&d=="false"){a=/\d{3}/}else{if(b=="SSN2"&&d=="false"){a=/\d{3}/}else{if(b=="SSN3"&&d=="false"){a=/\d{3}/}}}}}}return a.test(e)}jQuery.extend(jQuery.easing,{easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a}});jQuery.fn.liScroll=function(a){return this.each(function(){var b=jQuery(this);b.addClass("newsticker");var d=0;var e=0;var g=0;var m=b.wrap("<div class='mask'></div>");var h=b.parent().wrap("<div class='tickercontainer'></div>");h.width(b.parent().parent().width());$("ul#ticker01").css("display","block");$("ul.newsticker a").css("font-size",$(".newsEventContainer").css("font-size"));$("ul.newsticker a").css("text-decoration",$(".newsEventContainer").css("text-decoration"));$("ul.newsticker a").css("color",$(".newsEventContainer").css("color"));if(b.find("li").length===0){return}b.append("<li>"+b.find("li")[0].innerHTML+"</li>");g=b.parent().parent().width();b.find("li").each(function(p){jQuery(this,p).css();jQuery(this,p).width(g);e+=jQuery(this,p).width()});var l=b.find("li").length;b.width(e);var k=0;var f=0;function o(){if(f===0){if(b.position().left<=-g*(l-1)+1){b.css("left","0px");k=0}if(b.position().left<k+2){}k-=g}else{f=0}b.animate({left:k},a.scrolltime,"easeInOutCubic",function(){})}function n(){if(d===0){o();$(this).oneTime(a.pausetime+a.scrolltime,function(){n()})}else{$(this).oneTime(100,function(){n()})}}n();b.hover(function(){d=1;$(this).oneTime(100,function(){if(d===1){jQuery(this).stop(true);f=1}})},function(){d=0})})};function ValidateContactUs(f,e,b,m){var d="";var a=document.getElementById("txtFirstName");if(f&&trim(a.value).length==0){d+="- Please provide your First Name.\n"}var k=document.getElementById("txtLastName");if(e&&trim(k.value).length==0){d+="- Please provide your Last Name.\n"}var g=document.getElementById("txtPhone");if(g&&b&&trim(g.value).length==0){d+="- Please provide your Phone Number in 999-999-9999 format.  \n"}var l=document.getElementById("txtZip");if(l!=null&&!/\d{5}/.test(l.value)&&(!isNullOrEmpty(l.value)||m)){d+="- Please provide a 5 digit numeric zip code.\n"}var h=document.getElementById("txtEmail");if(trim(h.value).length==0){d+="- Please provide your Email Address, so we may respond to your inquiry.\n"}else{if(!checkEmail(h)){d+="- Please properly fill out your Email Address, so we may respond to your inquiry.\n"}}if(d!=""){alert("You must enter a value in the following fileds: \n"+d)}else{frmLeads.submit()}}function clearContactUsForm(){$("#txtFirstName").attr("value","");$("#txtLastName").attr("value","");$("#txtEmail").attr("value","");$("#txtPhone").attr("value","");$("#txtMessage").attr("value","")}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf("opera");if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7}}else{if(navigator.vendor!="KDE"&&document.all&&xUA.indexOf("msie")!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf("msie 4")!=-1;xIE5=xUA.indexOf("msie 5")!=-1}else{if(document.layers){xNN4=true}}}xMac=xUA.indexOf("mac")!=-1;function xBackground(d,f,b){if(!(d=xGetElementById(d))){return""}var a="";if(d.style){if(xStr(f)){if(!xOp6Dn){d.style.backgroundColor=f}else{d.style.background=f}}if(xStr(b)){d.style.backgroundImage=(b!="")?"url("+b+")":null}if(!xOp6Dn){a=d.style.backgroundColor}else{a=d.style.background}}return a}function xClientHeight(){var a=0;if(xOp6Dn){a=window.innerHeight}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}else{if(xDef(window.innerWidth,window.innerHeight,document.width)){a=window.innerHeight;if(document.width>window.innerWidth){a-=16}}}}}return a}function xClientWidth(){var a=0;if(xOp6Dn){a=window.innerWidth}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){a=document.body.clientWidth}else{if(xDef(window.innerWidth,window.innerHeight,document.height)){a=window.innerWidth;if(document.height>window.innerHeight){a-=16}}}}}return a}function xClip(h,f,g,a,d){if(!(h=xGetElementById(h))){return}if(h.style){if(xNum(d)){h.style.clip="rect("+f+"px "+g+"px "+a+"px "+d+"px)"}else{h.style.clip="rect(0 "+parseInt(h.style.width)+"px "+parseInt(h.style.height)+"px 0)"}}}function xColor(b,a){if(!(b=xGetElementById(b))){return""}var d="";if(b.style&&xDef(b.style.color)){if(xStr(a)){b.style.color=a}d=b.style.color}return d}function xDef(){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])=="undefined"){return false}}return true}function xDisplay(b,a){if(!(b=xGetElementById(b))){return null}if(b.style&&xDef(b.style.display)){if(xStr(a)){b.style.display=a}return b.style.display}return null}function xGetComputedStyle(b,h,e){var k,l="undefined";var g=document.defaultView;if(g&&g.getComputedStyle){k=g.getComputedStyle(b,"");if(k){l=k.getPropertyValue(h)}}else{if(b.currentStyle){var d=h.split("-");h=d[0];for(var f=1;f<d.length;++f){c=d[f].charAt(0);h+=d[f].replace(c,c.toUpperCase())}l=b.currentStyle[h]}else{return null}}return e?(parseInt(l)||0):l}function xGetElementById(a){if(typeof(a)!="string"){return a}if(document.getElementById){a=document.getElementById(a)}else{if(document.all){a=document.all[a]}else{a=null}}return a}function xHasPoint(g,m,h,n,a,k,f){if(!xNum(n)){n=a=k=f=0}else{if(!xNum(a)){a=k=f=n}else{if(!xNum(k)){f=a;k=n}}}var d=xPageX(g),o=xPageY(g);return(m>=d+f&&m<=d+xWidth(g)-a&&h>=o+n&&h<=o+xHeight(g)-k)}function xHeight(l,g){if(!(l=xGetElementById(l))){return 0}if(xNum(g)){if(g<0){g=0}else{g=Math.round(g)}}else{g=-1}var f=xDef(l.style);if(l==document||l.tagName.toLowerCase()=="html"||l.tagName.toLowerCase()=="body"){g=xClientHeight()}else{if(f&&xDef(l.offsetHeight)&&xStr(l.style.height)){if(g>=0){var k=0,d=0,b=0,m=0;if(document.compatMode=="CSS1Compat"){var a=xGetComputedStyle;k=a(l,"padding-top",1);if(k!==null){d=a(l,"padding-bottom",1);b=a(l,"border-top-width",1);m=a(l,"border-bottom-width",1)}else{if(xDef(l.offsetHeight,l.style.height)){l.style.height=g+"px";k=l.offsetHeight-g}}}g-=(k+d+b+m);if(isNaN(g)||g<0){return}else{l.style.height=g+"px"}}g=l.offsetHeight}else{if(f&&xDef(l.style.pixelHeight)){if(g>=0){l.style.pixelHeight=g}g=l.style.pixelHeight}}}return g}function xHide(a){return xVisibility(a,0)}function xLeft(d,a){if(!(d=xGetElementById(d))){return 0}var b=xDef(d.style);if(b&&xStr(d.style.left)){if(xNum(a)){d.style.left=a+"px"}else{a=parseInt(d.style.left);if(isNaN(a)){a=0}}}else{if(b&&xDef(d.style.pixelLeft)){if(xNum(a)){d.style.pixelLeft=a}else{a=d.style.pixelLeft}}}return a}function xMoveTo(b,a,d){xLeft(b,a);xTop(b,d)}function xNum(){for(var a=0;a<arguments.length;++a){if(isNaN(arguments[a])||typeof(arguments[a])!="number"){return false}}return true}function xOffsetLeft(a){if(!(a=xGetElementById(a))){return 0}if(xDef(a.offsetLeft)){return a.offsetLeft}else{return 0}}function xOffsetTop(a){if(!(a=xGetElementById(a))){return 0}if(xDef(a.offsetTop)){return a.offsetTop}else{return 0}}function xPageX(b){if(!(b=xGetElementById(b))){return 0}var a=0;while(b){if(xDef(b.offsetLeft)){a+=b.offsetLeft}b=xDef(b.offsetParent)?b.offsetParent:null}return a}function xPageY(a){if(!(a=xGetElementById(a))){return 0}var b=0;while(a){if(xDef(a.offsetTop)){b+=a.offsetTop}a=xDef(a.offsetParent)?a.offsetParent:null}return b}function xParent(d,b){if(!(d=xGetElementById(d))){return null}var a=null;if(!b&&xDef(d.offsetParent)){a=d.offsetParent}else{if(xDef(d.parentNode)){a=d.parentNode}else{if(xDef(d.parentElement)){a=d.parentElement}}}return a}function xResizeTo(d,a,b){xWidth(d,a);xHeight(d,b)}function xScrollLeft(d,b){var f=0;if(!xDef(d)||b||d==document||d.tagName.toLowerCase()=="html"||d.tagName.toLowerCase()=="body"){var a=window;if(b&&d){a=d}if(a.document.documentElement&&a.document.documentElement.scrollLeft){f=a.document.documentElement.scrollLeft}else{if(a.document.body&&xDef(a.document.body.scrollLeft)){f=a.document.body.scrollLeft}}}else{d=xGetElementById(d);if(d&&xNum(d.scrollLeft)){f=d.scrollLeft}}return f}function xScrollTop(d,b){var f=0;if(!xDef(d)||b||d==document||d.tagName.toLowerCase()=="html"||d.tagName.toLowerCase()=="body"){var a=window;if(b&&d){a=d}if(a.document.documentElement&&a.document.documentElement.scrollTop){f=a.document.documentElement.scrollTop}else{if(a.document.body&&xDef(a.document.body.scrollTop)){f=a.document.body.scrollTop}}}else{d=xGetElementById(d);if(d&&xNum(d.scrollTop)){f=d.scrollTop}}return f}function xShow(a){return xVisibility(a,1)}function xStr(b){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])!="string"){return false}}return true}function xTop(b,d){if(!(b=xGetElementById(b))){return 0}var a=xDef(b.style);if(a&&xStr(b.style.top)){if(xNum(d)){b.style.top=d+"px"}else{d=parseInt(b.style.top);if(isNaN(d)){d=0}}}else{if(a&&xDef(b.style.pixelTop)){if(xNum(d)){b.style.pixelTop=d}else{d=b.style.pixelTop}}}return d}function xVisibility(b,a){if(!(b=xGetElementById(b))){return null}if(b.style&&xDef(b.style.visibility)){if(xDef(a)){b.style.visibility=a?"visible":"hidden"}return b.style.visibility}return null}function xWidth(h,b){if(!(h=xGetElementById(h))){return 0}if(xNum(b)){if(b<0){b=0}else{b=Math.round(b)}}else{b=-1}var f=xDef(h.style);if(h==document||h.tagName.toLowerCase()=="html"||h.tagName.toLowerCase()=="body"){b=xClientWidth()}else{if(f&&xDef(h.offsetWidth)&&xStr(h.style.width)){if(b>=0){var g=0,l=0,k=0,d=0;if(document.compatMode=="CSS1Compat"){var a=xGetComputedStyle;g=a(h,"padding-left",1);if(g!==null){l=a(h,"padding-right",1);k=a(h,"border-left-width",1);d=a(h,"border-right-width",1)}else{if(xDef(h.offsetWidth,h.style.width)){h.style.width=b+"px";g=h.offsetWidth-b}}}b-=(g+l+k+d);if(isNaN(b)||b<0){return}else{h.style.width=b+"px"}}b=h.offsetWidth}else{if(f&&xDef(h.style.pixelWidth)){if(b>=0){h.style.pixelWidth=b}b=h.style.pixelWidth}}}return b}function xZIndex(b,a){if(!(b=xGetElementById(b))){return 0}if(b.style&&xDef(b.style.zIndex)){if(xNum(a)){b.style.zIndex=a}a=parseInt(b.style.zIndex)}return a}function xSlideTo(f,a,h,b){if(!(f=xGetElementById(f))){return}if(!f.timeout){f.timeout=25}f.xTarget=a;f.yTarget=h;f.slideTime=b;f.stop=false;f.yA=f.yTarget-xTop(f);f.xA=f.xTarget-xLeft(f);if(f.slideLinear){f.B=1/f.slideTime}else{f.B=Math.PI/(2*f.slideTime)}f.yD=xTop(f);f.xD=xLeft(f);var g=new Date();f.C=g.getTime();if(!f.moving){_xSlideTo(f)}}function _xSlideTo(g){if(!(g=xGetElementById(g))){return}var a,d,b,f,h;a=new Date();b=a.getTime()-g.C;if(g.stop){g.moving=false}else{if(b<g.slideTime){setTimeout("_xSlideTo('"+g.id+"')",g.timeout);if(g.slideLinear){d=g.B*b}else{d=Math.sin(g.B*b)}h=Math.round(g.xA*d+g.xD);f=Math.round(g.yA*d+g.yD);xMoveTo(g,h,f);g.moving=true}else{xMoveTo(g,g.xTarget,g.yTarget);g.moving=false}}}function xPopup(l,k,d,b,a,f,h,g){if(document.getElementById&&document.createElement&&document.body&&document.body.appendChild){var m=document.createElement("IFRAME");this.ele=m;m.id=h;m.style.position="absolute";m.className=f;m.frameBorder="0";m.src=g;document.body.appendChild(m);xShow(m);this.tmr=xTimer.set(l,this,l,k);this.open=false;this.margin=10;this.pos1=d;this.pos2=b;this.pos3=a;this.slideTime=500;this.interval()}}xPopup.prototype.show=function(){this.interval()};xPopup.prototype.hide=function(){this.timeout()};xPopup.prototype.timeout=function(){if(this.open){var a=this.ele;var b=xCardinalPosition(a,this.pos3,this.margin,true);xSlideTo(a,b.x,b.y,this.slideTime);setTimeout("xHide('"+a.id+"')",this.slideTime);this.open=false}};xPopup.prototype.interval=function(){if(!this.open){var a=this.ele;var b=xCardinalPosition(a,this.pos1,this.margin,true);xMoveTo(a,b.x,b.y);xShow(a);b=xCardinalPosition(a,this.pos2,this.margin,false);xSlideTo(a,b.x,b.y,this.slideTime);this.open=true}};function xTimerMgr(){this.timers=new Array()}xTimerMgr.prototype.set=function(d,f,b,a,e){return(this.timers[this.timers.length]=new xTimerObj(d,f,b,a,e))};xTimerMgr.prototype.run=function(){var e,b,f=new Date(),a=f.getTime();for(e=0;e<this.timers.length;++e){b=this.timers[e];if(b&&b.running){b.elapsed=a-b.time0;if(b.elapsed>=b.preset){b.obj[b.mthd](b);if(b.type.charAt(0)=="i"){b.time0=a}else{b.stop()}}}}};function xTimerObj(a,e,f,b,d){this.data=d;this.type=a;this.obj=e;this.mthd=f;this.preset=b;this.reset()}xTimerObj.prototype.stop=function(){this.running=false};xTimerObj.prototype.start=function(){this.running=true};xTimerObj.prototype.reset=function(){var a=new Date();this.time0=a.getTime();this.elapsed=0;this.running=true};var xTimer=new xTimerMgr();setInterval("xTimer.run()",250);function xCapitalize(g){var b,h,e,d="",a=true;for(b=0;b<g.length;++b){h=g.charAt(b);e=f(h);if(e){a=true}if(a&&!e){h=h.toUpperCase();a=false}d+=h}return d;function f(k){return k==" "||k=="\n"||k=="\t"}}function xCardinalPosition(z,a,l,B){if(!(z=xGetElementById(z))){return}if(typeof(a)!="string"){window.status="xCardinalPosition error: cp="+a+", id="+z.id;return}var f=xLeft(z),d=xTop(z),g=xWidth(z),u=xHeight(z);var m,C,q=xParent(z);if(q==document||q.nodeName.toLowerCase()=="html"){m=xClientWidth();C=xClientHeight()}else{m=xWidth(q);C=xHeight(q)}var n=xScrollLeft(q),k=xScrollTop(q);var A=n+m,b=k+C;var t=n+Math.floor((m-g)/2),s=k+(typeof(ConstPopupMarginTop)=="undefined")?Math.floor((C-u)/2):ConstPopupMarginTop;if(!l){l=0}else{if(B){l=-l}n+=l;k+=l;A-=l;b-=l}switch(a.toLowerCase()){case"n":f=t;if(B){d=k-u}else{d=k}break;case"ne":if(B){f=A;d=k-u}else{f=A-g;d=k}break;case"e":d=s;if(B){f=A}else{f=A-g}break;case"se":if(B){f=A;d=b}else{f=A-g;d=b-u}break;case"s":f=t;if(B){d=k-u}else{d=b-u}break;case"sw":if(B){f=n-g;d=b}else{f=n;d=b-u}break;case"w":d=s;if(B){f=n-g}else{f=n}break;case"nw":if(B){f=n-g;d=k-u}else{f=n;d=k}break;case"cen":f=t;d=s;break;case"cenh":f=t;break;case"cenv":d=s;break}var r=new Object();r.x=f;r.y=d;return r}function xDeg(a){return a*(180/Math.PI)}function xGetURLArguments(){var a=location.href.indexOf("?");var e=new Array();if(a!=-1){var d=location.href.substring(a+1,location.href.length).split("&");for(var b=0;b<d.length;b++){nameVal=d[b].split("=");e[b]=nameVal[1];e[nameVal[0]]=nameVal[1]}}return e}function xHex(f,d,b){var e="",f=Math.ceil(f);if(b){e=b}f=f.toString(16);for(var a=0;a<d-f.length;++a){e+="0"}return e+f}function xIntersection(r,q,d){var t,m,h,s,e=true;var l=xPageX(r);var k=l+xWidth(r);var b=xPageY(r);var a=b+xHeight(r);var p=xPageX(q);var n=p+xWidth(q);var g=xPageY(q);var f=g+xHeight(q);if(l<=p){t=p;if(k<p){e=false}else{h=Math.min(k,n)-p}}else{t=l;if(n<l){e=false}else{h=Math.min(k,n)-l}}if(a>=f){m=f;if(b>f){e=false}else{s=f-Math.max(b,g)}}else{m=a;if(g>a){e=false}else{s=a-Math.max(b,g)}}if(e&&typeof(d)=="object"){d.x=t;d.y=m-s;d.w=h;d.h=s}return e}function xLinearScale(k,e,g,f,h){var d=(h-f)/(g-e);var a=f-(e*d);return d*k+a}function xPad(d,a,f,e){if(typeof d!="string"){d=d+""}if(e){for(var b=d.length;b<a;++b){d=f+d}}else{for(var b=d.length;b<a;++b){d+=f}}return d}function xRad(a){return a*(Math.PI/180)}var xVersion="4.0",xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf("opera");if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7}}else{if(navigator.vendor!="KDE"&&document.all&&xUA.indexOf("msie")!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf("msie 4")!=-1;xIE5=xUA.indexOf("msie 5")!=-1}else{if(document.layers){xNN4=true}}}xMac=xUA.indexOf("mac")!=-1;function xAddEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e))){return}eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=="resize"){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=eL;xResizeEvent();return}if(eT=="scroll"){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=eL;xScrollEvent();return}}var eh="e.on"+eT+"=eL";if(e.addEventListener){e.addEventListener(eT,eL,cap)}else{if(e.attachEvent){e.attachEvent("on"+eT,eL)}else{eval(eh)}}}function xResizeEvent(){if(window.xREL){setTimeout("xResizeEvent()",250)}var a=xClientWidth(),b=xClientHeight();if(window.xPCW!=a||window.xPCH!=b){window.xPCW=a;window.xPCH=b;if(window.xREL){window.xREL()}}}function xScrollEvent(){if(window.xSEL){setTimeout("xScrollEvent()",250)}var a=xScrollLeft(),b=xScrollTop();if(window.xPSL!=a||window.xPST!=b){window.xPSL=a;window.xPST=b;if(window.xSEL){window.xSEL()}}}function xClientHeight(){var a=0;if(xOp6Dn){a=window.innerHeight}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}else{if(xDef(window.innerWidth,window.innerHeight,document.width)){a=window.innerHeight;if(document.width>window.innerWidth){a-=16}}}}}return a}function xClientWidth(){var a=0;if(xOp6Dn){a=window.innerWidth}else{if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){a=document.body.clientWidth}else{if(xDef(window.innerWidth,window.innerHeight,document.height)){a=window.innerWidth;if(document.height>window.innerHeight){a-=16}}}}}return a}function xDef(){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])=="undefined"){return false}}return true}function xGetComputedStyle(b,h,e){var k,l="undefined";var g=document.defaultView;if(g&&g.getComputedStyle){k=g.getComputedStyle(b,"");if(k){l=k.getPropertyValue(h)}}else{if(b.currentStyle){var d=h.split("-");h=d[0];for(var f=1;f<d.length;++f){c=d[f].charAt(0);h+=d[f].replace(c,c.toUpperCase())}l=b.currentStyle[h]}else{return null}}return e?(parseInt(l)||0):l}function xGetElementById(a){if(typeof(a)!="string"){return a}if(document.getElementById){a=document.getElementById(a)}else{if(document.all){a=document.all[a]}else{a=null}}return a}function xHeight(l,g){if(!(l=xGetElementById(l))){return 0}if(xNum(g)){if(g<0){g=0}else{g=Math.round(g)}}else{g=-1}var f=xDef(l.style);if(l==document||l.tagName.toLowerCase()=="html"||l.tagName.toLowerCase()=="body"){g=xClientHeight()}else{if(f&&xDef(l.offsetHeight)&&xStr(l.style.height)){if(g>=0){var k=0,d=0,b=0,m=0;if(document.compatMode=="CSS1Compat"){var a=xGetComputedStyle;k=a(l,"padding-top",1);if(k!==null){d=a(l,"padding-bottom",1);b=a(l,"border-top-width",1);m=a(l,"border-bottom-width",1)}else{if(xDef(l.offsetHeight,l.style.height)){l.style.height=g+"px";k=l.offsetHeight-g}}}g-=(k+d+b+m);if(isNaN(g)||g<0){return}else{l.style.height=g+"px"}}g=l.offsetHeight}else{if(f&&xDef(l.style.pixelHeight)){if(g>=0){l.style.pixelHeight=g}g=l.style.pixelHeight}}}return g}function xLeft(d,a){if(!(d=xGetElementById(d))){return 0}var b=xDef(d.style);if(b&&xStr(d.style.left)){if(xNum(a)){d.style.left=a+"px"}else{a=parseInt(d.style.left);if(isNaN(a)){a=0}}}else{if(b&&xDef(d.style.pixelLeft)){if(xNum(a)){d.style.pixelLeft=a}else{a=d.style.pixelLeft}}}return a}function xMoveTo(b,a,d){xLeft(b,a);xTop(b,d)}function xNum(){for(var a=0;a<arguments.length;++a){if(isNaN(arguments[a])||typeof(arguments[a])!="number"){return false}}return true}function xPageX(b){if(!(b=xGetElementById(b))){return 0}var a=0;while(b){if(xDef(b.offsetLeft)){a+=b.offsetLeft}b=xDef(b.offsetParent)?b.offsetParent:null}return a}function xPageY(a){if(!(a=xGetElementById(a))){return 0}var b=0;while(a){if(xDef(a.offsetTop)){b+=a.offsetTop}a=xDef(a.offsetParent)?a.offsetParent:null}return b}function xScrollLeft(d,b){var f=0;if(!xDef(d)||b||d==document||d.tagName.toLowerCase()=="html"||d.tagName.toLowerCase()=="body"){var a=window;if(b&&d){a=d}if(a.document.documentElement&&a.document.documentElement.scrollLeft){f=a.document.documentElement.scrollLeft}else{if(a.document.body&&xDef(a.document.body.scrollLeft)){f=a.document.body.scrollLeft}}}else{d=xGetElementById(d);if(d&&xNum(d.scrollLeft)){f=d.scrollLeft}}return f}function xScrollTop(d,b){var f=0;if(!xDef(d)||b||d==document||d.tagName.toLowerCase()=="html"||d.tagName.toLowerCase()=="body"){var a=window;if(b&&d){a=d}if(a.document.documentElement&&a.document.documentElement.scrollTop){f=a.document.documentElement.scrollTop}else{if(a.document.body&&xDef(a.document.body.scrollTop)){f=a.document.body.scrollTop}}}else{d=xGetElementById(d);if(d&&xNum(d.scrollTop)){f=d.scrollTop}}return f}function xShow(a){return xVisibility(a,1)}function xSlideTo(f,a,h,b){if(!(f=xGetElementById(f))){return}if(!f.timeout){f.timeout=25}f.xTarget=a;f.yTarget=h;f.slideTime=b;f.stop=false;f.yA=f.yTarget-xTop(f);f.xA=f.xTarget-xLeft(f);if(f.slideLinear){f.B=1/f.slideTime}else{f.B=Math.PI/(2*f.slideTime)}f.yD=xTop(f);f.xD=xLeft(f);var g=new Date();f.C=g.getTime();if(!f.moving){_xSlideTo(f)}}function _xSlideTo(g){if(!(g=xGetElementById(g))){return}var a,d,b,f,h;a=new Date();b=a.getTime()-g.C;if(g.stop){g.moving=false}else{if(b<g.slideTime){setTimeout("_xSlideTo('"+g.id+"')",g.timeout);if(g.slideLinear){d=g.B*b}else{d=Math.sin(g.B*b)}h=Math.round(g.xA*d+g.xD);f=Math.round(g.yA*d+g.yD);xMoveTo(g,h,f);g.moving=true}else{xMoveTo(g,g.xTarget,g.yTarget);g.moving=false}}}function xStr(b){for(var a=0;a<arguments.length;++a){if(typeof(arguments[a])!="string"){return false}}return true}function xTop(b,d){if(!(b=xGetElementById(b))){return 0}var a=xDef(b.style);if(a&&xStr(b.style.top)){if(xNum(d)){b.style.top=d+"px"}else{d=parseInt(b.style.top);if(isNaN(d)){d=0}}}else{if(a&&xDef(b.style.pixelTop)){if(xNum(d)){b.style.pixelTop=d}else{d=b.style.pixelTop}}}return d}function xVisibility(b,a){if(!(b=xGetElementById(b))){return null}if(b.style&&xDef(b.style.visibility)){if(xDef(a)){b.style.visibility=a?"visible":"hidden"}return b.style.visibility}return null}function xWidth(h,b){if(!(h=xGetElementById(h))){return 0}if(xNum(b)){if(b<0){b=0}else{b=Math.round(b)}}else{b=-1}var f=xDef(h.style);if(h==document||h.tagName.toLowerCase()=="html"||h.tagName.toLowerCase()=="body"){b=xClientWidth()}else{if(f&&xDef(h.offsetWidth)&&xStr(h.style.width)){if(b>=0){var g=0,l=0,k=0,d=0;if(document.compatMode=="CSS1Compat"){var a=xGetComputedStyle;g=a(h,"padding-left",1);if(g!==null){l=a(h,"padding-right",1);k=a(h,"border-left-width",1);d=a(h,"border-right-width",1)}else{if(xDef(h.offsetWidth,h.style.width)){h.style.width=b+"px";g=h.offsetWidth-b}}}b-=(g+l+k+d);if(isNaN(b)||b<0){return}else{h.style.width=b+"px"}}b=h.offsetWidth}else{if(f&&xDef(h.style.pixelWidth)){if(b>=0){h.style.pixelWidth=b}b=h.style.pixelWidth}}}return b}function SelectNewTab(d,q,g,p,h){var b=document.getElementById("hdnActiveTab");var n=document.getElementById("tab"+b.value);if(n!=d){d.className="RequestRightTabsTabSelected";if(n.id=="tabRequestMoreInfo"){n.className="RequestRightTabsTabUnSelectedFirstTab"}else{n.className="RequestRightTabsTabUnselected"}var a=document.getElementById("ctrContactInformationContentDiv");var m=document.getElementById("ctrRequestLeftMainContentSubmit");var e=document.getElementById("ctrHeader"+b.value);e.style.display="none";var k=document.getElementById("ctrHeader"+q);k.style.display="block";if(!g){a.style.display="none";m.style.display="none"}else{a.style.display="block";m.style.display="block"}var l=document.getElementById("ctrRequestInfoHeader");l.innerHTML=h;document.title=h+p;b.value=q}var f=document.getElementById("divLeftMainDivBlockSubmited");f.style.display="none";var o=document.getElementById("divLeftMainDivBlock");o.style.display="block"}function SelectNewTabNids(e,q,h,p,k){var b=document.getElementById("hdnActiveTab");if(q!=b.value){var d=$("#tab"+q);var o=$("#tab"+b.value);d.addClass("RequestTabSelected");o.removeClass("RequestTabSelected");if(d.hasClass("RequestTabFirst")){$("#topLeftCorner").addClass("RequestContentTLSelected")}if(o.hasClass("RequestTabFirst")){$("#topLeftCorner").removeClass("RequestContentTLSelected")}var a=document.getElementById("ctrContactInformationContentDiv");var m=document.getElementById("ctrRequestLeftMainContentSubmit");var f=document.getElementById("ctrHeader"+b.value);f.style.display="none";var l=document.getElementById("ctrHeader"+q);l.style.display="block";if(!h){a.style.display="none";m.style.display="none"}else{a.style.display="block";m.style.display="block"}b.value=q}var g=document.getElementById("divLeftMainDivBlockSubmited");g.style.display="none";var n=document.getElementById("divLeftMainDivBlock");n.style.display="block"}function RequestMoreInfoValidate(e,l,h,f,r){var g="";var b=document.getElementById("txtFirstName");if(l&&trim(b.value).length==0){g+="- Please provide your First Name.  \n"}var o=document.getElementById("txtLastName");if(h&&trim(o.value).length==0){g+="- Please provide your Last Name.  \n"}var m=document.getElementById("txtPhone");if(m!=null&&f&&trim(m.value).length==0){g+="- Please provide your Phone Number in 999-999-9999 format.  \n"}var q=document.getElementById("txtZip");if(q!=null&&!(/\d{5}/.test(q.value))&&(!isNullOrEmpty(q.value)||r)){g+="- Please provide a 5 digit numeric zip code.\n"}var n=document.getElementById("txtEmail");if(trim(n.value).length==0){g+="- Please provide your Email address, so we may respond to your inquire. \n"}else{if(!checkEmail(n)){g+="- Please fill out properly Your Email address, so we may respond to your inquire. \n"}}if(!checkAllowedChars(n)){g+="- Email control can not have '<' or '>' chars \n"}var a=document.getElementById("hdnActiveTab");if(a.value=="RequestTestDrive"){var s=document.getElementById("ctrFirstTimePreferenceDate");if(trim(s.value).length==0){g+="- Please provide your 1st Time Preference. \n"}else{if(!checkDate(s)){g+="- Please fill out properly 1st Time Preference field. I.E. 06/05/2008\n"}}var p=document.getElementById("ctrSecondTimePreferenceDate");if(trim(p.value).length>0){if(!checkDate(p)){g+="- Please fill out properly 2nd Time Preference field. I.E. 06/05/2008 \n"}}var k=document.getElementById("ctrTimePreferenceComment");if(!checkAllowedChars(k)){g+="- Note control can not have '<' or '>' chars \n"}}if(a.value=="MakeAnOffer"){var d=document.getElementById("ctrOfferPrice");if(trim(d.value).length==0){g+="- Please provide your Offer Price . \n"}else{if(e=="$"&&!checkOfferPrice(d)){g+="- Please fill out properly Offer Price field. I.E. "+e+"99999 \n"}}var k=document.getElementById("ctrMakeAnOfferComment");if(!checkAllowedChars(k)){g+="- Note control can not have '<' or '>' chars \n"}}if(a.value=="RequestMoreInfo"){var k=document.getElementById("txtRequestMoreInfoComment");if(!checkAllowedChars(k)){g+="- Note control can not have '<' or '>' chars \n"}}if(a.value=="GetAQuote"){var k=document.getElementById("txtGetAQuoteComment");if(!checkAllowedChars(k)){g+="- Note control can not have '<' or '>' chars \n"}}if(g!=""){alert("You must enter a value in the following fileds: \n"+g);return false}return true}function PageTracking(b,d,g,f,e,a){if(f){var k="";switch(b){case 0:k="leadview=RequestMoreInfo";break;case 1:k="leadview=MakeAnOffer";break;case 2:k="leadview=RequestTestDrive";break;case 3:k="leadview=GetAQuote";break;case 4:k="leadview=CallToday";break;case 5:k="leadview=PaymentCalculator";break;case 6:k="leadview=ContactUs";break;case 7:k="leadview=TradeInAppraisal";break;case 8:k="leadview=VehicleRequest";break;case 9:k="leadview=Coupons";break;case 10:k="leadview=CreditApp";break;case 11:k="leadview=ServiceRequest";break;case 12:k="leadview=PartsRequest";break;case 13:k="leadview=TellAFriendDetails";break;case 14:k="leadview=TellAFriendInventory";break;case 15:k="leadview=PrintDetail";break;case 16:k="leadview=PrintInventory";break;case 17:k="leadview=AutoCheck";break;case 18:k="leadview=Carfax";break;case 19:k="leadview=ViewGoogleMaps";break;case 20:k="leadview=ViewDrivingDirection";break;case 21:k="leadview=VehicleBrochureFull";break;case 22:k="leadview=VehicleBrochureSummary";break;case 23:k="leadview=VehicleMediaViewer";break;case 24:k="leadview=VehicleCompare";break;case 25:k="leadview=VehicleBrochureChoose";break;case 26:k="leadview=QuickQuote";break;case 27:k="leadview=OEMWindowSticker";break}if(d){k=k+"&completed=true"}if(k.length>0){ntptEventTag(k)}}if(g){var h="";if(d){h="/submitleads.html";pageTracker._trackPageview(h)}else{switch(b){case 0:h="/leadspopuprequestmoreinfo.html";break;case 1:h="/leadspopupmakeanoffer.html";break;case 2:h="/leadspopuprequesttestdrive.html";break;case 3:h="/leadspopupgetquote.html";break;case 4:h="/leadspopupcalltoday.html";break;case 5:h="/leadspopuppaymentcalculator.html";break;case 6:h="/contactus.html";break;case 7:h="/tradeappraisal.html";break;case 8:h="/carfinder.html";break;case 9:h="/coupon.html";break;case 10:h="/creditapp.html";break;case 11:h="/servicerequest.html";break;case 12:h="/parts.html";break;case 13:h="/emailafrineddetail.html";break;case 14:h="/emailafrinedinventory.html";break}if(h.length>0){pageTracker._trackPageview(h)}}}if(a){ExecuteCampaignConversionTrackingCode(e)}}function ValidateTellaFriend(){var f="";var b=document.getElementById("_txtName");if(trim(b.value).length==0){f+="- Please provide Your Name.  \n"}var d=document.getElementById("_txtSendersEmail");if(trim(d.value).length==0||!checkEmail(d)){f+="- Please provide Your Email Address.  \n"}var a=document.getElementById("_txtEmail");if(trim(a.value).length==0||!checkEmail(a)){f+="- Please provide Recipient's Email Address.  \n"}var e=document.getElementById("_txtCustomMessage");if(trim(e.value).length==0){f+="- Please provide Personal Message. \n"}if(/<|>|\\/.test(b.value)){f+='You have entered an invalid character in the field "Your Name" \nThese characters are not allowed: \\ > and < \n'}if(/<|>|\\/.test(e.value)){f+='You have entered an invalid character in the field "Personal Message" \nThese characters are not allowed: \\ > and < \n'}if(f!=""){alert("You must enter a value in the following fileds: \n"+f)}else{frmTellAFriend.submit()}}function clearForm(){document.getElementById("_txtName").value="";document.getElementById("_txtSendersEmail").value="";document.getElementById("_txtEmail").value="";document.getElementById("_chkSendCopy").checked=false}function submitSurveyForm(D,A,p,y,s,x,k,m,d,r,n){var e=$("#surveyForm")[0];var g=null;var f=[];var b=[];var z=false;var o="";var w="";var a=e.elements.survFirstName;var q=e.elements.survLastName;var u=e.elements.survEmail;var h=e.elements.survPhone;var B=e.elements.survZip;if(k&&isNullOrEmpty(a.value)){o+="Please fill out first name.\n"}if(m&&isNullOrEmpty(q.value)){o+="Please fill out last name.\n"}if(!checkEmail(u)){o+="Email address has wrong format.\n"}if(d&&isNullOrEmpty(h.value)){o+="Please enter phone number.\n"}if(B!=null&&!/\d{5}/.test(B.value)&&(!isNullOrEmpty(B.value)||r)){o+="Please provide a 5 digit numeric zip code.\n"}for(i=0;i<s.length;i++){g=e.elements["survAnswer"+s[i]];b=[];if(!g.tagName){z=!x[i];for(j=0;j<g.length;j++){if(g[j].checked){z=true;b[b.length]="'"+g[j].value.replace(/'/g,"&rsquo;")+"'"}}if(!z){w+="- Question "+(i+1)+" needs a response.\n"}}else{if(x[i]&&isNullOrEmpty(g.value)){w+="- Question "+(i+1)+" needs a response.\n"}else{if(g.type=="text"&&g.value.length>300){w+="- You have exceeded the 300 character limit for question "+(i+1)+".\n"}else{b=["'"+g.value.replace(/'/g,"&rsquo;")+"'"]}if(g.tagName=="TEXTAREA"&&g.value.length>2500){w+="- You have exceeded the 2500 character limit for question "+(i+1)+".\n"}else{b=["'"+g.value.replace(/'/g,"&rsquo;")+"'"]}if(g.type=="checkbox"&&g.checked){b=["'"+g.value.replace(/'/g,"&rsquo;")+"'"]}}}f[i]="["+b+"]"}if(w.length!=0){o+="Please Complete the following:\n"+w}if(o.length==0){var C=$("#ExportIDHidden").val();var t=$("#OriginalUrlEncodedHidden").val();var l=$("#InitialTargetEncodedHidden").val();$.ajax({type:"POST",url:D+"masterpagewebservice.asmx/SubmitSurvey",data:"{ siteId: "+A+", pageId: "+p+", contactId: "+y+", firstName: '"+a.value+"', lastName: '"+q.value+"', email: '"+u.value+"', phone: '"+(h==null?"":h.value)+"', zip: '"+(B==null?"":B.value)+"', questions: ["+s+"], answers: ["+f+"], sourcePage: '"+n+"', exportID: "+C+", originalUrlEncoded: '"+t+"', initialTargetEncoded: '"+l+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(E){if(E==true){e.style.display="none";$("#surveyThankYouContent")[0].style.display="block"}},failure:function(E){}})}else{alert(o)}}function OpenCompareWindow(d,a){params="";var b=0;$("input[type='checkbox']:checked").each(function(){if(this.id.substr(0,2)=="cb"){params=params+this.id.substr(2)+",";b=b+1}});if(b>3){alert("A maximum of 3 vehicles can be selected for Vehicle Comparison.");return}if(b==0){alert("You should select at least one vehicle.");return}PageTracking(a,false,false,true,"",false);_popupObject=$('<div id="CompareVehiclesContainer"><div class="ClosePopupBtn" onmouseover="this.className=\'ClosePopupBtn_hover\'" onmouseout="this.className=\'ClosePopupBtn\'"><b></b></div><div class="CompareVehiclesInner"><div class="CompareVehiclesInner2"><div style="height: 200px;">loading...</div></div></div></div>').modal({zIndex:20000,close:true,positionStyle:"absolute",containerCss:{width:950},containerId:"PopupLoaderContainer",position:[40,]});$("body").animate({scrollTop:0},"slow");$("#CompareVehiclesContainer .ClosePopupBtn").bind("click.simplemodal",function(f){f.preventDefault();_popupObject.close()});$.ajax({type:"POST",url:d,data:"iids="+params,success:function(e){$("#CompareVehiclesContainer .CompareVehiclesInner2").html(e)},error:function(e,f){$("#CompareVehiclesContainer .CompareVehiclesInner2 div").html("Error occured while loading content.")}})}function ExpandCompareOptions(){$("#CompareVehiclesContainer .OptionsLink").css("display","none");$("#CompareVehiclesContainer .OptionsData").css("display","block")}function contentBlockRedirect(d,a,g){var b=false;var f=false;var e=(a.target?a.target:a.srcElement);b=(e.tagName=="A"||e.parentNode.tagName=="A"||e.tagName=="INPUT");f=(e.onclick!=null&&e!=d);if(!b&&!f){document.location=g}}function checkCompareInput(b){var a=$(".itemCb0 input:checkbox:checked, .itemCb1 input:checkbox:checked, .itemCb2 input:checkbox:checked").length;if(a>3){b.checked=false;alert("A maximum of 3 vehicles can be selected for Vehicle Comparison.")}}function PaymentCalcNew(){CalculateLoanControl();CalculateLeaseControl()}function PaymentCalcUsed(){CalculateLoanControl()}function mapAndHoursTabClick(d){var m=$("#generalTab");var k=$("#partsTab");var a=$("#serviceTab");var e=$("#generalTab1");var h=$("#partsTab1");var b=$("#serviceTab1");var f=$("#generalContent");var g=$("#partsContent");var l=$("#serviceContent");if(m!=null){m.hide();e.show();f.hide()}if(k!=null){k.hide();h.show();g.hide()}if(a!=null){a.hide();b.show();l.hide()}if(d=="generalTab1"){m.show();e.hide();f.show()}else{if(d=="partsTab1"){k.show();h.hide();g.show()}else{if(d=="serviceTab1"){a.show();b.hide();l.show()}}}}function showVideo(b){var a=document.getElementById("UnityWorksVideo"+b);if(showVideoId!=0){hideVideos(showVideoId)}if(a!=null){a.style.display="block";showVideoId=b}}function hideVideo(b){var a=document.getElementById("UnityWorksVideo"+b);if(a!=null){a.style.display="none";showVideoId=0}}function hideVideos(){hideVideo(showVideoId)}function onChangeLengthInput(b,a){if(b.value.length>a){b.value=b.value.substring(0,a)}};