var _isCreditAppSubmitAllowed=false;var metaCharacters=/<|>|"/;var metaCharacterValidateMessage="'<', '>', and quotation marks chars are not allowed. \n";$(document).ready(function(){var b=(navigator.cookieEnabled)?true:false;if(typeof navigator.cookieEnabled=="undefined"&&!b){document.cookie="testcookie";b=(document.cookie.indexOf("testcookie")!=-1)?true:false}if(!b){var a="http://"+window.location.hostname+"/gallery/invalidcookiespage.aspx?cookiesdisabled=true";window.location.href=a}});function flashLoader(m,l,f,e,o,b,h,a,k){var g="";var d="";if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){if(a=="Footer"&&m.indexOf("ebiz_footer_logo")!=-1){document.write('<div style="font: italic bold 10px Arial; margin-top: 2px;">eBizAutos</div>')}}else{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,n,m,l,h){if(_popupObject!=null){_popupObject.close()}if(b.indexOf("embedded=true")==-1){var g="";if(m){g+="scrollbars=yes, ";e=e+16}var a=(document.all)?window.screenLeft:window.screen.left;var f=a+(window.screen.width-e)/2;var k=(window.screen.height-n)/2;g+="width="+e+", height="+n;g+=", top="+k+", 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=n;_openedUrl=b;if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){var f=(window.innerWidth-e)/2;_popupObject=$('<div id="PopupLoaderPopupContent"'+(h?' class="bmwCompliance"':"")+">"+globalPopupHeader.replace("{PopupHeader}",l)+'<iframe src="'+b+'" frameborder="0" scrolling="no" width="'+e+'" height="'+n+'"></iframe></div>').modal({zIndex:20000,close:true,positionStyle:"absolute",containerCss:{width:_width,height:_height},containerId:"PopupLoaderContainer",position:[73,f]})}else{_popupObject=$('<div id="PopupLoaderPopupContent"'+(h?' class="bmwCompliance"':"")+">"+globalPopupHeader.replace("{PopupHeader}",l)+'<iframe src="'+b+'" frameborder="0" scrolling="no" width="'+e+'" height="'+n+'"></iframe></div>').modal({zIndex:20000,close:true,positionStyle:"absolute",containerCss:{width:_width,height:_height},containerId:"PopupLoaderContainer",position:[73,]})}$("body").animate({scrollTop:0},"slow");$("#simplemodal-overlay, .ClosePopup").bind("click.simplemodal",function(o){o.preventDefault();if(document.getElementById("_extIntViewContainer")!=null){document.getElementById("_extIntViewContainer").style.visibility="visible"}_popupObject.close()})}}function OpenWindowCenterFrameOnly(b,d,e,m,k){var l=(window.scrollY?window.scrollY:document.body.scrollTop)+10;if(_popupObject!=null){_popupObject.close()}if(b.indexOf("embedded=true")==-1){var g="";if(k){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;if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){var f=(window.innerWidth-e)/2;_popupObject=$('<div><div class="ClosePopupBtn" onmouseover="this.className=\'ClosePopupBtn_hover\'" onmouseout="this.className=\'ClosePopupBtn\'"><b></b></div><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:[l,f]})}else{_popupObject=$('<div><div class="ClosePopupBtn" onmouseover="this.className=\'ClosePopupBtn_hover\'" onmouseout="this.className=\'ClosePopupBtn\'"><b></b></div><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:[l,]})}$("#simplemodal-overlay, .ClosePopupBtn").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(a){if(a!=null){return !metaCharacters.test(a.value)}return false}function IsValidDate(e){var b=/(\d+)[- /.](\d+)[- /.](\d+)/;var a=b.exec(e);if(a.length!=4){return false}var d=new Date(a[3],a[1],a[2]);if(d.getDate()!=a[2]){return false}if(d.getMonth()!=a[1]-1){return false}if(d.getFullYear()!=a[3]){return false}return true}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(){var a=0;if(navigator.appVersion.indexOf("MSIE")!=-1){var b=navigator.appVersion.split("MSIE");a=parseFloat(b[1])}return(a==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 ExecConversionTrackingCode(a){var b=document.createElement("div");window.onload=function(){document.body.appendChild(b)};b.style.visibility="hidden";try{var e=document.createElement("object");e.data=a;if(!isIE6()){e.type="text/html"}b.appendChild(e);if(isIE6()){e.classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"}}catch(d){}}function ExecuteConversionTrackingCode(a){ExecConversionTrackingCode(a+"shared/conversiontrackingcode/conversiontrackingcode.aspx")}function ExecuteCampaignConversionTrackingCode(a){ExecConversionTrackingCode(a+"shared/campaignconversiontrackingcode/campaignconversiontrackingcode.aspx")}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 getModelHomePageMakeModelSearch(hostURL,siteId,firstTabType,hasToIncludeSiblings){var make=$("#SearchByMakeSelectBox").val();if(make==""){$("#SearchByModelSelectBox").empty().append('<option value="">Show me all</option>');return}else{$("#SearchByModelSelectBox").empty().append('<option value="">Loading...</option>')}$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelSearchByOptions",data:"{make:'"+make+"', siteId:'"+siteId+"', firstTabType:'"+firstTabType+"', hasToIncludeSiblings:'"+hasToIncludeSiblings+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var models=(typeof response)=="string"?eval("("+response+")"):response;var modelsList=$("#SearchByModelSelectBox").empty().append('<option value="">Show me all</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 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:JSON.stringify({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();if(!make){make=""}$("#"+modelControlID).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelHomePageAdvancedSearchContent",data:JSON.stringify({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();if(!make){make=""}if(!model){model=""}$("#"+yearFromControlID).empty().append('<option value="">Loading...</option>');$("#"+yearToControlID).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearsHomePageAdvancedSearchContent",data:JSON.stringify({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();if(!make||0==make.length){return}if(!model||0==make.length){return}$("#"+bodyStyleControlID).empty().append('<option value="">Loading...</option>');var bodyStylesTemp=[];$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetBodyStylesHomePageAdvancedSearchContent",data:JSON.stringify({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="";var _mediaViewerTabUrl="";var _dealershipMapUrl="";function OpenMediaViewer(b){var a=(window.scrollY?window.scrollY:document.body.scrollTop)+10;PageTracking(23,false,false,true,"",false);if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){_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:[a,50]})}else{_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:[a,]})}$("#simplemodal-overlay, #MVContainer .ClosePopupBtn").bind("click.simplemodal",function(d){d.preventDefault();_popupObject.close()});if($("#media-id").length>0){_mediaViewerUrl=$("#media-id").attr("title")}$.ajax({type:"POST",url:_mediaViewerUrl+(_mediaViewerUrl.indexOf("?")!=-1?"&":"?")+"tab="+b,success:function(d){if(d.indexOf("<body>")>0){window.location.reload(true)}else{$("#MVContainer .MVContainerInner").html(d)}},error:function(d,e){$("#MVContainer .MVContainerInner").html('<div style="height:200px">Error occured while loading content.</div>')}})}function SwitchMediaViewerTab(g,b,f){var e,a;var d=_mediaViewerTabUrl+"&tab="+(g-1);if((g==1&&document.getElementById(f+g+"Frame").src!=d)||g==2){document.getElementById(f+g+"Frame").src=d}for(e=1;e<=b;e++){if(e!=g){a=document.getElementById(f+e);if(a!=null&&a.className!="mvtab"){break}}}if(a&&e<=b){a.className="mvtab";document.getElementById(f+e+"Content").style.display="none";document.getElementById(f+g+"Content").style.display="block";document.getElementById(f+g).className="mvtab_s"}if(g==4&&_dealershipMapUrl!=""){document.getElementById(f+g+"Frame").src=_dealershipMapUrl}}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");$("#simplemodal-overlay, .ClosePopup").bind("click.simplemodal",function(b){b.preventDefault();a.close()})}var isActive=false;var isActiveLinks=false;var timeId=0;var hasSocialRoundedButtons=false;function hideLinksPopup(){if(!isActive&&!isActiveLinks){$(".SocialLinksPopup").hide();if(hasSocialRoundedButtons){$(".SocialLinksIcons").css("background","url(http://images.ebizautos.com/gallery/bookmarking_new/plus.png)")}else{$(".SocialLinksIcons").css("background","url(http://images.ebizautos.com/gallery/bookmarking_square/plus.png)")}}else{timeId=setTimeout(hideLinksPopup,200)}}function showLinksPopup(){$(".SocialLinksPopup").show();if(hasSocialRoundedButtons){$(".SocialLinksIcons").css("background","url(http://images.ebizautos.com/gallery/bookmarking_new/minus.png)")}else{$(".SocialLinksIcons").css("background","url(http://images.ebizautos.com/gallery/bookmarking_square/minus.png)")}}function on_mouseoverSocialBookmarking(a){if(!isActive){isActive=true;if(a=="True"){hasSocialRoundedButtons=true}showLinksPopup()}clearTimeout(timeId);timeId=setTimeout(hideLinksPopup,200)}function on_mouseoverLinks(a){if(!isActiveLinks){isActiveLinks=true;if(a=="True"){hasSocialRoundedButtons=true}showLinksPopup(a)}clearTimeout(timeId);timeId=setTimeout(hideLinksPopup,200)}function on_mouseoutLinks(){isActiveLinks=false;isActive=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.hideSpan");var d=$("#DescriptionText a.moreLink");var b=$("#DescriptionText a.lessLink");if(a.css("display")=="none"){a.css("display","inline");b.css("display","inline");d.css("display","none")}else{a.css("display","none");b.css("display","none");d.css("display","inline")}}function TruncateChromeDescription(f,a){var k=document.getElementById("DescriptionText");if(k){if(k.offsetHeight>a){var n='<span class="hideSpan">';var e="</span>";var g='<a class="moreLink" style="display: inline; text-decoration: none;" href="'+f+'"> ...<u>more</u></a>';var d='<a class="lessLink" style="display: none; text-decoration: none;" href="'+f+'"> ...<u>less</u></a>';var b=e+d;var l=k.innerHTML+b;var h=l.length-b.length;for(i=h-1;i>=0;i--){if(l.charAt(i)==">"){endTagIndex=i;l=l.substr(0,i+1)+n+l.substr(i+1,l.length-i-1);for(;l.charAt(i)!="<"&&i>=0;i--){}tag=l.substr(i+1,endTagIndex-i-1);if(tag.toLowerCase()=="br"){l=l.substr(0,endTagIndex+1)+e+l.substr(endTagIndex+1,l.length-endTagIndex-1);l=l.substr(0,i)+" "+n+l.substr(i,l.length-i)}l=l.substr(0,i)+" "+e+l.substr(i,l.length-i);i++}else{if(l.charAt(i)==" "){var m=l.substr(0,i)+g+n+l.substr(i,l.length-i);k.innerHTML=m;$("#DescriptionText span.hideSpan").css("display","none");if(k.offsetHeight<a){break}}}}}k.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(f,d,h){salesPriceLoan=0;salesTaxLoan=0;loanTermLoan=0;interestRateLoan=0;downPaymentLoan=0;tradeInValueLoan=0;rebatesLoan=0;var b=document.getElementById("Loan");var e=document.getElementById("LoanWarning");if(doLoanValidationControl()){if((Number(salesPriceLoan)!=0)&&(Number(loanTermLoan)!=0)){interestRateLoan=interestRateLoan/100;interestRateLoan=interestRateLoan/12;salesTaxLoan=salesTaxLoan/100;var a=(salesPriceLoan*(1+salesTaxLoan))-downPaymentLoan-tradeInValueLoan-rebatesLoan;var g=0;if(Number(interestRateLoan)==0){g=a/loanTermLoan}else{g=a*(interestRateLoan*Math.pow(1+interestRateLoan,loanTermLoan))/(Math.pow(1+interestRateLoan,loanTermLoan)-1)}if(g<0||isNaN(g)){g=0}b.innerHTML=f+NumberFormat(g,2,d,h);e.style.display="none"}else{e.style.display="block";b.innerHTML=f+NumberFormat(0,2,d,h)}}else{e.style.display="block";b.innerHTML=f+NumberFormat(0,2,d,h)}}function CalculateLeaseControl(l,h,g){salesPriceLease=0;salesTaxLease=0;loanTermLease=0;interestRateLease=0;residualValueLease=0;downPaymentLease=0;tradeInValueLease=0;rebatesLease=0;var m=document.getElementById("Lease");var a=document.getElementById("LeaseWarning");if(doLeaseValidationControl()){if((Number(residualValueLease)!=0)&&(Number(salesPriceLease)!=0)&&(Number(loanTermLease)!=0)){if(salesTaxLease>=1){salesTaxLease=salesTaxLease/100}var d=salesPriceLease-downPaymentLease-tradeInValueLease-rebatesLease;var e=d-residualValueLease;var k=0;if(loanTermLease>=1){k=e/loanTermLease}k=Math.round(k*100)/100;var b=interestRateLease/2400;b=Math.round(b*100000)/100000;var f=(d+residualValueLease)*b+k;f=Math.round(f*100)/100;f=f+f*salesTaxLease;if(f<0||isNaN(f)){f=0}m.innerHTML=l+NumberFormat(f,2,h,g);a.style.display="none"}else{m.innerHTML=l+NumberFormat(0,2,h,g);a.style.display="block"}}else{a.style.display="block";m.innerHTML=l+NumberFormat(0,2,h,g)}}function NumberFormat(g,d,f,k){g=(g+"").replace(",","").replace(" ","");var b=!isFinite(+g)?0:+g,a=!isFinite(+d)?0:Math.abs(d),m=(typeof f==="undefined")?",":f,e=(typeof k==="undefined")?".":k,l="",h=function(q,p){var o=Math.pow(10,p);return""+Math.round(q*o)/o};l=(a?h(b,a):""+Math.round(b)).split(".");if(l[0].length>3){l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,m)}if((l[1]||"").length<a){l[1]=l[1]||"";l[1]+=new Array(a-l[1].length+1).join("0")}return l.join(e)}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,""))}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=0;if(Number(interestRateLoan)==0){f=b/loanTermLoan}else{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 ConstErrorString="Please enter the required information";var ConstRequiredString="Required";var ConstZipCodeErrorString="Please provide a 5 digit numeric zip code";function onQQinput_focus(b,a){if(b.value==ConstErrorString||b.value==ConstRequiredString||b.value==ConstZipCodeErrorString||(a!=undefined&&b.value==a)){b.value=""}b.style.color=""}$(document).ready(function(){setInterval("VehicleRowCycle()",100);$("#udm").mousemove(function(a){removeSelect()});$("#VehicleFinderButton input.basic, #VehicleFinderButtonHover input.basic, #VehicleFinderButton a.basic, #VehicleFinderButton div.basic, span.specialItemClickHere, div.specialItemRightSideBoxClickHere").click(function(a){a.preventDefault();InitializationVehicleFinder()});syncPopup();syncFreeFormPopup()});function removeSelect(){$("#VehicleFinderMake").blur();$("#VehicleFinderModel").blur();$("#YearFrom").blur();$("#YearTo").blur()}function syncPopup(){if($("#MakeIDHidden").val()!=null){$("#VehicleFinderMakeModal").val($("#MakeIDHidden").val())}}function InitializationVehicleFinder(){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"}$("#VehicleFinderPopup").modal({zIndex:20000,close:true,containerId:"VehicleFinderContainer",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(){if($("#MakeNameHidden").val()!=""){$("#VehicleFinderMakeModalInput").val($("#MakeNameHidden").val())}if($("#ModelNameHidden").val()!=""){$("#VehicleFinderModelModalInput").val($("#ModelNameHidden").val())}if($("#YearFromHidden").val()!=""){$("#VehicleFinderYearFromModalInput").val($("#YearFromHidden").val())}if($("#YearToHidden").val()!=""){$("#VehicleFinderYearToModalInput").val($("#YearToHidden").val())}}function getModels(hostURL,accountId,isCrossPromotionOn,isModelsFranchisedOnly){$("#VehicleFinderModel").append('<option value="0">Select Model</option>').empty();$("#VehicleFinderModel").append('<option value="0">Loading...</option>');var make=$("#VehicleFinderMake").val();if(!make){return}$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelList",data:JSON.stringify({accountId:accountId,makeId:make,makeName:$("#VehicleFinderMake :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;$("#VehicleFinderModel").append('<option value="0">Select Model</option>').empty();$("#VehicleFinderModel").append('<option value="0">Select Model</option>');$("#VehicleFinderModelModal").append('<option value="0">Select Model</option>').empty();$("#VehicleFinderModelModal").append('<option value="0">Select Model</option>');var vehicleFinderMake_selected=$("#VehicleFinderMake").val();$("#VehicleFinderMakeModal").val(vehicleFinderMake_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++){$("#VehicleFinderModel").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:JSON.stringify({accountId:accountId,modelName:$("#VehicleFinderModel :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();$("#VehicleFinderYearFrom").append('<option value="0">Year</option>').empty();$("#VehicleFinderYearTo").append('<option value="0">Year</option>').empty();var vehicleFinderModel_selected=$("#VehicleFinderModel").val();$("#VehicleFinderModelModal").val(vehicleFinderModel_selected);$("#YearFrom").append('<option value="0">Year</option>');$("#YearTo").append('<option value="0">Year</option>');$("#VehicleFinderYearFrom").append('<option value="0">Year</option>');$("#VehicleFinderYearTo").append('<option value="0">Year</option>');for(var i=0;i<years.length;i++){$("#VehicleFinderYearFrom").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--){$("#VehicleFinderYearTo").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=$("#VehicleFinderModelModal :selected").text()}$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearList",data:JSON.stringify({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;$("#VehicleFinderYearFrom").append('<option value="0">Year</option>').empty();$("#VehicleFinderYearTo").append('<option value="0">Year</option>').empty();$("#VehicleFinderYearFrom").append('<option value="0">Year</option>');$("#VehicleFinderYearTo").append('<option value="0">Year</option>');for(var i=0;i<years.length;i++){$("#VehicleFinderYearFrom").append('<option value="'+years[i]+'">'+years[i]+"</option>")}for(var i=years.length-1;i>=0;i--){$("#VehicleFinderYearTo").append('<option value="'+years[i]+'">'+years[i]+"</option>")}if($("#YearFromHidden").val()!=null){$("#VehicleFinderYearFrom").val($("#YearFromHidden").val())}if($("#YearToHidden").val()!=null){$("#VehicleFinderYearTo").val($("#YearToHidden").val())}$("#ModelNameHidden").val("")},failure:function(msg){$("#output").text(msg)}})}function getModelsModal(hostURL,accountId,isCrossPromotionOn,isModelsFranchisedOnly){$("#VehicleFinderModelModal").append('<option value="0">Select Model</option>').empty();$("#VehicleFinderModelModal").append('<option value="0">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelList",data:JSON.stringify({accountId:accountId,makeId:$("#VehicleFinderMakeModal").val(),makeName:$("#VehicleFinderMakeModal :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;$("#VehicleFinderModelModal").append('<option value="0">Select Model</option>').empty();$("#VehicleFinderModelModal").append('<option value="0">Select Model</option>');$("#VehicleFinderYearFrom").append('<option value="0">Year</option>').empty();$("#VehicleFinderYearTo").append('<option value="0">Year</option>').empty();$("#VehicleFinderYearFrom").append('<option value="0">Year</option>');$("#VehicleFinderYearTo").append('<option value="0">Year</option>');for(var i=0;i<cars.length;i++){$("#VehicleFinderModelModal").append('<option value="'+cars[i].toLowerCase().replace(" ","_")+'">'+cars[i]+"</option>")}if($("#ModelNameHidden").val()!=null){$("#VehicleFinderModelModal").val($("#ModelNameHidden").val().toLowerCase())}},failure:function(msg){$("#output").text(msg)}})}function saveVehicleFinderLead(y,z,g,O,D,L,e,m,B,h,I){clearDefaultText(["VehicleFinderMakeModalInput","VehicleFinderModelModalInput","VehicleFinderYearFromModalInput","VehicleFinderYearToModalInput","VehicleFinderFirstName","VehicleFinderLastName","VehicleFinderEmail","VehicleFinderDayPhone","VehicleFinderDayZip"]);if(I?!isValidQQForm():!validateQQForm()){return}var l=$("#HasToDisplayFreeFormHidden").val();var a=$("#HasToHideYearHidden").val();var q=$("#ExportIDHidden").val();var N=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var s=ReplaceLiterals($("#InitialTargetEncodedHidden").val());var J=0;var H=0;var x=0;var w;var b;if(l=="False"){w=getSelectedText("VehicleFinderMakeModal");b=getSelectedText("VehicleFinderModelModal");if(a=="False"){H=getSelectedText("VehicleFinderYearFrom");J=getSelectedText("VehicleFinderYearTo")}}else{w=$("#VehicleFinderMakeModalInput").attr("value");b=$("#VehicleFinderModelModalInput").attr("value");if(a=="False"){H=$("#VehicleFinderYearFromModalInput").attr("value");J=$("#VehicleFinderYearToModalInput").attr("value")}}var C=getSelectedText("VehicleFinderBodyStyle");var k=getSelectedText("VehicleFinderExtColor");var G=getSelectedText("VehicleFinderMilesFrom");var r=getSelectedText("VehicleFinderMilesTo");var d=getSelectedText("VehicleFinderWeek");var K=getSelectedText("VehicleFinderTransmission");var A=getSelectedText("VehicleFinderIntColor");var u=getSelectedText("VehicleFinderPriceFrom");var E=getSelectedText("VehicleFinderPriceTo");var F=ReplaceLiterals($("#VehicleFinderFirstName").attr("value"));var o=ReplaceLiterals($("#VehicleFinderLastName").attr("value"));var t=ReplaceLiterals($("#VehicleFinderDayPhone").attr("value"));var n=ReplaceLiterals($("#VehicleFinderDayZip").attr("value"));var f=encodeURI($("#VehicleFinderMessage").attr("value").replace("'","\\'").replace('"','\\"'));var p=ReplaceLiterals($("#VehicleFinderEmail").attr("value"));var M=p+((t!=undefined&&t.length>0)?(" or "+t+" "):" ");if(H==J){x=H}else{x=H+((J.length>0)?(" to "+J+""):" ")}if(F!=null&&F!=""){$("#spnFirstName").html(F+",")}$("#spnYearStartYearEnd").html(x);if(H==0&&J==0){document.getElementById("spnYearStartYearEnd").style.display="none";$("#spnMake").html("<br />"+w)}else{$("#spnMake").html(w)}$("#spnModel").html(b);$("#spnEmailPhone").html(M);if(metaCharacters.test(w)||metaCharacters.test(b)||metaCharacters.test(H)||metaCharacters.test(J)||metaCharacters.test(F)||metaCharacters.test(o)||metaCharacters.test(t)||metaCharacters.test(n)||metaCharacters.test(f)||metaCharacters.test(n)||metaCharacters.test(p)||metaCharacters.test(n)){alert("- "+metaCharacterValidateMessage);return}if(isDisableBtn(h)){return}setDisableBtn(h);$.ajax({type:"POST",url:g+"masterpagewebservice.asmx/SaveVehicleFinderLead",data:JSON.stringify({title:y,make:w,model:b,yearFrom:H,yearTo:J,bodyStyle:C,extColor:k,milesFrom:G,milesTo:r,week:d,transmission:K,intColor:A,priceFrom:u,priceTo:E,firstName:F,lastName:o,dayPhone:(t!=undefined?t:""),zip:(n!=undefined?n:""),message:f,email:p,siteId:z,sourcePage:O,exportID:q,originalUrlEncoded:N,initialTargetEncoded:s}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(P){PageTracking(e,m,false,B,D,L);ExecuteConversionTrackingCode(D);$("#VehicleFinderModalContentResponse2").hide();$("#VehicleFinderModalContentResponse").show();$("body").animate({scrollTop:0},"slow")},failure:function(P){$("#output").text(P)}})}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("VehicleFinderDayZip");if(e!=null&&!/\d{5}/.test(e.value)&&(!isNullOrEmpty(e.value)||k=="True")){e.value=ConstZipCodeErrorString;e.style.color="red";f=false}if(h=="False"){obj=document.getElementById("VehicleFinderMakeModal")}else{obj=document.getElementById("VehicleFinderMakeModalInput")}if(obj.value=="0"){document.getElementById("VehicleFinderMakeMessage").style.visibility="visible";f=false}else{document.getElementById("VehicleFinderMakeMessage").style.visibility="hidden"}document.getElementById("spnMake").innerText=obj.value;if(h=="False"){obj=document.getElementById("VehicleFinderModelModal")}else{obj=document.getElementById("VehicleFinderModelModalInput")}if(obj.value=="0"){document.getElementById("VehicleFinderModelMessage").style.visibility="visible";f=false}else{document.getElementById("VehicleFinderModelMessage").style.visibility="hidden"}document.getElementById("spnModel").innerText=obj.value;if(h=="False"&&g=="False"){if(document.getElementById("VehicleFinderYearFrom").value=="0"||document.getElementById("VehicleFinderYearTo").value=="0"){document.getElementById("VehicleFinderYearsMessage").style.visibility="visible";f=false}else{document.getElementById("VehicleFinderYearsMessage").style.visibility="hidden"}document.getElementById("spnYearStartYearEnd").innerText=document.getElementById("VehicleFinderYearFrom").value+" to "+document.getElementById("VehicleFinderYearTo").value}if(h=="True"){obj=document.getElementById("VehicleFinderMakeModalInput");if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}obj=document.getElementById("VehicleFinderModelModalInput");if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}if(g=="False"){obj=document.getElementById("VehicleFinderYearFromModalInput");if(obj.value.length==0||obj.value==ConstRequiredString){obj.value=ConstRequiredString;obj.style.color="red";f=false}obj=document.getElementById("VehicleFinderYearToModalInput");if(obj.value.length==0||obj.value==ConstRequiredString){obj.value=ConstRequiredString;obj.style.color="red";f=false}}}if(d.toLowerCase()=="true"){obj=document.getElementById("VehicleFinderFirstName");if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}}obj=document.getElementById("VehicleFinderEmail");if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}else{if(!checkEmailStr(obj.value)){obj.style.color="red";f=false}}if(b.toLowerCase()=="true"){obj=document.getElementById("VehicleFinderLastName");if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}}obj=document.getElementById("VehicleFinderDayPhone");if(obj){if(a.toLowerCase()=="true"){if(obj.value.length==0||obj.value==ConstErrorString){obj.value=ConstErrorString;obj.style.color="red";f=false}}}return f}function isValidQQForm(){var k=$("#HasToDisplayFreeFormHidden").val().toLowerCase()=="true";var g=$("#HasToHideYearHidden").val().toLowerCase()=="true";var d=$("#FirstNameRequiredHiden").val().toLowerCase()=="true";var h=$("#LastNameRequiredHidden").val().toLowerCase()=="true";var f=$("#PhoneNumberRequiredHiden").val().toLowerCase()=="true";var a=$("#ZipCodeRequiredHiden").val().toLowerCase()=="true";var b=document.getElementById("VehicleFinderDayZip");var l=true;var e="You must enter a value in the following fields: \n";if(!k){obj=document.getElementById("VehicleFinderMakeModal")}else{obj=document.getElementById("VehicleFinderMakeModalInput")}if(obj.value=="0"){document.getElementById("VehicleFinderMakeMessage").style.visibility="visible";l=false}else{document.getElementById("VehicleFinderMakeMessage").style.visibility="hidden"}document.getElementById("spnMake").innerText=obj.value;if(!k){obj=document.getElementById("VehicleFinderModelModal")}else{obj=document.getElementById("VehicleFinderModelModalInput")}if(obj.value=="0"){document.getElementById("VehicleFinderModelMessage").style.visibility="visible";l=false}else{document.getElementById("VehicleFinderModelMessage").style.visibility="hidden"}document.getElementById("spnModel").innerText=obj.value;if(!k&&!g){if(document.getElementById("VehicleFinderYearFrom").value=="0"||document.getElementById("VehicleFinderYearTo").value=="0"){document.getElementById("VehicleFinderYearsMessage").style.visibility="visible";l=false}else{document.getElementById("VehicleFinderYearsMessage").style.visibility="hidden"}document.getElementById("spnYearStartYearEnd").innerText=document.getElementById("VehicleFinderYearFrom").value+" to "+document.getElementById("VehicleFinderYearTo").value}if(k){if($("#VehicleFinderMakeModalInput").val().length==0){e+="- Vehicle Make.\n";l=false}if($("#VehicleFinderModelModalInput").val().length==0){e+="- Vehicle Model.\n";l=false}if(!g){if($("#VehicleFinderYearFromModalInput").val().length==0){e+="- Year From.\n";l=false}if($("#VehicleFinderYearToModalInput").val().length==0){e+="- Year To.\n";l=false}}}if(d){if($("#VehicleFinderFirstName").val().length==0){e+="- First Name.\n";l=false}}if(h){if($("#VehicleFinderLastName").val().length==0){e+="- Last Name.\n";l=false}}obj=$("#VehicleFinderEmail");if(obj.val().length==0){e+="- Email Address.\n";l=false}else{if(!checkEmailStr(obj.val())){e+="- Email Address.\n";l=false}}obj=document.getElementById("VehicleFinderDayPhone");if(obj){if(f){if(obj.value.length==0){e+="- Phone Number.\n";l=false}}}if(b!=null&&!/\d{5}/.test(b.value)&&(!isNullOrEmpty(b.value)||a)){e+="- Please provide a 5 digit numeric zip code.\n";l=false}if(!l){repopulateDefaultText(["VehicleFinderMakeModalInput","VehicleFinderModelModalInput","VehicleFinderYearFromModalInput","VehicleFinderYearToModalInput","VehicleFinderFirstName","VehicleFinderLastName","VehicleFinderEmail","VehicleFinderDayPhone","VehicleFinderDayZip"]);alert(e)}return l}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"}}function LoadSpecialsData(obj){hostURL=obj.data("SiteDefaultUrl");accountId=obj.data("SiteId");obj.data("IsReadSpecialsWebService",false);$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetSpecialsList",data:JSON.stringify({accountId:accountId}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(response){var tmpSpecialsDataList=(typeof response)=="string"?eval("("+response+")"):response;var resSpecialsDataList=[];for(var i=0;i<tmpSpecialsDataList.length;i++){resSpecialsDataList[i]=eval("("+tmpSpecialsDataList[i]+")")}obj.data("IsReadSpecialsWebService",true);obj.data("SpecialsDataList",resSpecialsDataList);GetData(obj,"");PrepareSpecialsContent(obj)},failure:function(msg){$("#output").text(msg)}})}function GetIndex(a,d){for(var b=0;b<a.length;b++){if(a[b].SpecialId==d){return b}}return 0}function GetData(f,e){var d=f.data("SpecialId1");var b=f.data("SpecialsDataList");if(d==null){e=""}var a=[];f.data("SpecialsData",a);if(b==null||b.length==0){return}switch(e){case"next":currentIndex=GetIndex(b,d);if(currentIndex+3<b.length){a=[b[currentIndex+2],b[currentIndex+3]]}else{if(currentIndex+3==b.length){a=[b[currentIndex+2]]}else{GetData(f,"");return}}break;case"previous":currentIndex=GetIndex(b,d);if(currentIndex>1){a=[b[currentIndex-2],b[currentIndex-1]]}else{if(currentIndex==0){if(b.length%2==1){a=[b[b.length-1]]}else{a=[b[b.length-2],b[b.length-1]]}}else{GetData(f,"");return}}break;default:if(b.length==0){a=[]}else{if(b.length==1){a=[b[0]]}else{a=[b[0],b[1]]}}break}f.data("SpecialsData",a)}function getSpecials(b,a){b.data("IsSpecialsAnimating",true);if(b.data("SpecialsDataList")==null){LoadSpecialsData(b)}if(b.data("SpecialsDataList")==null||b.data("SpecialsDataList").length<3){return}b.data("IsSpecialsAnimating",false);$(".homeSpecialItems, .homeSpecialItemsEmpty",b).fadeTo(500,0,function(){b.data("IsSpecialsAnimating",true);GetData(b,a);PrepareSpecialsContent(b)})}function PrepareSpecialsContent(b){if(b.data("IsSpecialsAnimating")&&b.data("IsReadSpecialsWebService")){b.data("IsSpecialsAnimating",false);FillOutSpecialsContent(b);var a=b.data("SpecialsData");if(a!=null&&a.length>0){$(this).oneTime(200,function(){$(".homeSpecialItems, .homeSpecialItemsEmpty",b).fadeTo(500,1,function(){$(".homeSpecial",b).css("background",$(".homeSpecial",b).css("background"));$(".itemsFoundDiv",b).css("background",$(".itemsFoundDiv",b).css("background"))})})}}}function FillOutSpecialsContent(f){var a=f.data("SpecialsData");if(a==null||a.length<1){$(".homeSpecialItems",f).addClass("hidden");$(".homeSpecialItemsEmpty",f).removeClass("hidden");f.data("SpecialId1",-1);f.data("SpecialId2",-1)}else{$(".homeSpecialItems",f).removeClass("hidden");$(".homeSpecialItemsEmpty",f).addClass("hidden");for(var e=1;e<=2;e++){var b=$(".homeSpecial"+e,f);if(e>a.length){$(".specialSwapDiv",b).addClass("hidden");$(".specialItemsNotFound",b).removeClass("hidden");f.data("SpecialId"+e,-1)}else{$(".specialSwapDiv",b).removeClass("hidden");$(".specialItemsNotFound",b).addClass("hidden");var d=a[e-1];f.data("SpecialId"+e,d.SpecialId);$(".specialLink",b).attr("href",d.SpecialDetailLink);$(".specialImage",b).attr("src",d.PhotoPath);if(d.IsOfferDetails){$(".itemsFoundNumberDiv",b).removeClass("itemsFoundText").addClass("itemsFoundNumber").html("VIEW");$(".itemsFoundTextDiv",b).html("<a rel='nofollow' href=\""+d.SpecialDetailLink+'">Offer Details</a>')}else{if(d.VehicleNum=="0"){$(".itemsFoundNumberDiv",b).removeClass("itemsFoundNumber").addClass("itemsFoundText").html("Currently no inventory for this special. Need a Quote?");$(".itemsFoundTextDiv",b).html("<a rel='nofollow' href=\""+vehicleFinderUrl+'">Click Here</a>')}else{$(".itemsFoundNumberDiv",b).removeClass("itemsFoundText").addClass("itemsFoundNumber").html(d.VehicleNum);$(".itemsFoundTextDiv",b).html("<a href="+d.InventoryLink+">Vehicles Found<br />With This Special</a>")}}$(".titleDiv",b).html("<a href="+d.SpecialDetailLink+">"+d.HeaderText+"</a>");$(".simpleTitleDiv",b).html(d.HeaderText);$(".line1",b).html(d.Line1Text);$(".line2",b).html(d.Line2Text);$(".learnMore a",b).attr("href",d.SpecialDetailLink)}}}if($(".homeSpecialItemsEmpty",f).hasClass("hidden")){$(".homeSpecialItemsEmpty",f).remove()}}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 d=document.getElementById("vehicleInfoPopupArea").offsetHeight;var a=document.getElementById("vehicleInfoArrow").offsetHeight;var f=10;if($.browser.msie){f=16}b=_specPopupMouseY-d-a-f;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,r,o,l,k,m,u,h,A){var z="._leadSubmitBtn";if(isDisableBtn(z)){return}var a=ReplaceLiterals($("#TxtAQuoteFirstName").val());var n=ReplaceLiterals($("#TxtAQuoteLastName").val());var d=ReplaceLiterals($("#TxtAQuotePhone").val());var w=ReplaceLiterals($("#TxtAQuoteZip").val());var q=ReplaceLiterals($("#TxtAQuoteEmail").val());var e=ReplaceLiterals($("#TxtAQuoteComments").val());var x=$("#ExportIDHidden").val();var p=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var g=ReplaceLiterals($("#InitialTargetEncodedHidden").val());var b=$("#LeadFormType").val();var s=0;var f=$("#TxtAQuoteOfferPrice");if(f.val()){s=Number(f.val().replace("$",""))}if(isValidAQuoteLead()){setDisableBtn(z);$.ajax({type:"POST",url:y+"masterpagewebservice.asmx/SubmitAQuoteLead",data:JSON.stringify({siteId:t,iid:r,spItemId:o,pageType:l,firstName:a,lastName:n,phone:(d==undefined?"":d),zip:(w==undefined?"":w),email:q,comments:e,priceOffered:s,leadFormType:b,sourcePage:k,exportID:x,originalUrlEncoded:p,initialTargetEncoded:g,contactID:h,newCarsResearchMake:A}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(B){PageTracking(0,false,false,false,m,u);ExecuteConversionTrackingCode(m);$("#_GetAQuoteLeadForm").hide();$("#_GetAQuoteConfirmation").show();$("#_txtGetAQuoteClientEmail").html(q);if(window.CustomTrackerOnSuccses){CustomTrackerOnSuccses()}},failure:function(B){$("#output").text(B)}})}else{if(window.CustomTrackerOnError){CustomTrackerOnError()}}}function setDisableBtn(a){$(a).css({opacity:0.5})}function isDisableBtn(a){if($(a).css("opacity")==0.5){return true}return false}function isValidAQuoteLead(){var o=$("#TxtAQuoteFirstName").val();var p=$("#TxtAQuoteLastName").val();var l=$("#TxtAQuotePhone").val();var m=$("#TxtAQuoteEmail").val();var a=$("#TxtAQuoteZip").val();var k=$("#TxtAQuoteComments").val();var g="";var f=$("#TxtAQuoteOfferPrice");if(f){g=f.val()}var b=$("#IsAQuoteFirstNameRequiredHidden").val().toLowerCase();var e=$("#IsAQuoteLastNameRequiredHidden").val().toLowerCase();var n=(l==undefined?"false":$("#IsAQuotePhoneNumberRequiredHidden").val().toLowerCase());var d=(a==undefined?"false":$("#IsAQuoteZipCodeRequiredHidden").val().toLowerCase());var q=true;var h="You must enter a value in the following fields: \n";if(f.val()&&(isNullOrEmpty(g)||!Number(g.replace("$",""))||g.indexOf(".")>0)){h+="- Please enter a price.\n";q=false}if(b=="true"){if(isNullOrEmpty(o)||o=="First Name"){h+="- Please enter first name.\n";q=false}}if(e=="true"){if(isNullOrEmpty(p)||p=="Last Name"){h+="- Please enter last name.\n";q=false}}if(n=="true"){if(isNullOrEmpty(l)||l=="Phone"){h+="- Please enter phone number. \n";q=false}}if(a!=null&&!/\d{5}/.test(a)&&((!isNullOrEmpty(a)&&a!="Zip Code")||d=="true")){h+="- Please provide a 5 digit numeric zip code. \n";q=false}if(checkEmailStr(m)&&!isNullOrEmpty(m)&&q){q=true}else{if(isNullOrEmpty(m)){h+="- Please enter email address. \n";q=false}else{if(!checkEmailStr(m)){h+="- Email address has wrong format. \n";q=false}}}if(metaCharacters.test(o)||metaCharacters.test(p)||metaCharacters.test(l)||metaCharacters.test(m)||metaCharacters.test(a)||metaCharacters.test(g)||metaCharacters.test(k)){h+="- "+metaCharacterValidateMessage;q=false}if(!q){alert(h)}return q}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=ReplaceLiterals($("#RequestATestDriveFirstName").val());var n=ReplaceLiterals($("#RequestATestDriveLastName").val());var f=ReplaceLiterals($("#RequestATestDrivePhone").val());var g=ReplaceLiterals($("#RequestATestDriveEmailAddress").val());var d=ReplaceLiterals($("#RequestATestDriveComments").val());var m=$("#ExportIDHidden").val();var e=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var b=ReplaceLiterals($("#InitialTargetEncodedHidden").val());if(isValidATestDrive()){$.ajax({type:"POST",url:k+"masterpagewebservice.asmx/SubmitATestDrive",data:JSON.stringify({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(metaCharacters.test(k)||metaCharacters.test(l)||metaCharacters.test(g)||metaCharacters.test(h)||metaCharacters.test(f)){e+="- "+metaCharacterValidateMessage;m=false}if(!m){alert(e)}return m}function submitContact(n,g,b,a,f,m,d){if(isDisableBtn(d)){return}var o=ReplaceLiterals($("#TxtFirstName").val());var p=ReplaceLiterals($("#TxtLastName").val());var l=ReplaceLiterals($("#TxtEmail").val());var k=ReplaceLiterals($("#TxtPhone").val());var e=ReplaceLiterals($("#TxtZip").val());var h=ReplaceLiterals($("#TxtEmailMessage").val());if(isValidContactInputs(o,p,l,k,e)){setDisableBtn(d);$.ajax({type:"POST",url:n+"masterpagewebservice.asmx/SubmitContact",data:JSON.stringify({firstName:o,lastName:p,email:l,phone:(k==null?"":k),zip:(e==null?"":e),emailMessage:h,pageId:g,siteId:b}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(q){PageTracking(m,true,false,false,a,f);$("#InputFieldBox").hide();$("#ContactFormThankYou").show();$("#ErrorMessageBox").hide()},failure:function(q){$("#output").text(q)}})}}function isValidContactInputs(p,q,l,k,e){var b=$("#IsFirstNameRequiredHidden").val();var m=$("#IsLastNameRequiredHidden").val();var o=$("#IsPhoneRequiredHidden").val();var a=$("#IsZipRequiredHidden").val();var f=$("#TxtEmailMessage").val();var h=b==null?"false":b;var g=m==null?"false":m;var n=a==null?"false":a;var d=o==null?"false":o;var r=true;$("#FirstNameMassegeContainer").empty();$("#LastNameMassegeContainer").empty();$("#PhoneMessageContainer").empty();$("#ZipMessageContainer").empty();$("#MetaCharactersContainer").empty();if(isNullOrEmpty(p)&&h=="true"){$("#FirstNameMassegeContainer").append("<br />* Please provide your First Name.");r=false}if(isNullOrEmpty(q)&&g=="true"){$("#LastNameMassegeContainer").append("<br />* Please provide your Last Name.");r=false}if(isNullOrEmpty(k)&&d=="true"){$("#PhoneMessageContainer").append("<br />* Please provide your Phone Number in 999-999-9999 format.");r=false}if(e!=null&&!/\d{5}/.test(e)&&(!isNullOrEmpty(e.value)||n=="true")){$("#ZipMessageContainer").append("<br />* Please provide a 5 digit numeric zip code.");r=false}if(metaCharacters.test(p)||metaCharacters.test(q)||metaCharacters.test(l)||metaCharacters.test(k)||metaCharacters.test(e)||metaCharacters.test(f)){$("#MetaCharactersContainer").append("<br />* "+metaCharacterValidateMessage);r=false}$("#ErrorMessageBox").show();return(isValidEmail(l)&&r)}function isValidEmail(a){$("#EmailMessageContainer").empty();if(checkEmailStr(a)&&a.length!=0){return true}else{if(a.length==0){$("#EmailMessageContainer").append("<br />* Please fill out Email Address.")}else{if(!checkEmailStr(a)){$("#EmailMessageContainer").append("<br />* Email address has wrong format.")}}}$("#ErrorMessageBox").show();return false}function submitTradeAppraisal(F,C,m,p,x,q,t,h){if(isDisableBtn(t)){return}clearDefaultText(["_txtYear","_txtMake","_txtModel","_txtMileage","_txtVin","_txtIntColor","_txtExtColor","_txtPayOffBalance","_txtFirstName","_txtLastName","_txtEmail","_txtPhone","_txtZip","_txtMessage"]);var d=ReplaceLiterals($("#_txtVin").val());var s=ReplaceLiterals($("#_txtYear").val());var e=ReplaceLiterals($("#_txtMake").val());var l=ReplaceLiterals($("#_txtComments").val());var w=ReplaceLiterals($("#_txtMileage").val());var g=ReplaceLiterals($("#_txtModel").val());var u=ReplaceLiterals($("#_txtIntColor").val());var o=ReplaceLiterals($("#_txtExtColor").val());var b=ReplaceLiterals($("#_txtPayOffBalance").val());var a=ReplaceLiterals($("#_txtFirstName").val());var A=ReplaceLiterals($("#_txtEmail").val());var y=ReplaceLiterals($("#_txtLastName").val());var k=ReplaceLiterals($("#_txtPhone").val());var D=ReplaceLiterals($("#_txtZip").val());var r=ReplaceLiterals($("#_txtMessage").val());var B=ReplaceLiterals($("#_ddlCondition").val());var f=ReplaceLiterals($("#_ddlBestTime").val());var G=ReplaceLiterals($("#_ddlPurchaseTime").val());var E=$("#ExportIDHidden").val();var z=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var n=ReplaceLiterals($("#InitialTargetEncodedHidden").val());if(isValidForm()){setDisableBtn(t);$.ajax({type:"POST",url:F+"masterpagewebservice.asmx/SubmitTradeAppraisal",data:JSON.stringify({vinNumber:d,year:s,make:e,comments:l,mileage:w,model:g,intColor:u,extColor:o,payOffBalance:b,firstName:a,email:A,lastName:y,phone:k,zip:D,message:r,condition:B,bestTime:f,purchaseTime:G,siteId:C,contactEmail:m,sourcePage:p,exportID:E,originalUrlEncoded:z,initialTargetEncoded:n}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(H){PageTracking(q,true,false,h,"",false);ExecuteConversionTrackingCode(x);$("#TradeAppraisalFormContainer").hide();$(".TradeAppraisalHeader").hide();$("#ThankYouContainer").show()},failure:function(H){$("#output").text(H)}});if(window.CustomTrackerSubmitTradeAppraisal){CustomTrackerSubmitTradeAppraisal()}return true}else{if(window.CustomTrackerTradeAppraisalOnError){CustomTrackerTradeAppraisalOnError()}return false}}function isValidForm(){var e=$("#_txtVin");var n=$("#_txtYear");var d=$("#_txtPayOffBalance");var r=$("#_txtEmail");var h=$("#_txtPhone");var x=$("#_txtZip");var p=$("#_txtMileage");var f=$("#_txtMake");var b=$("#_txtComments").val();var g=$("#_txtModel");var o=$("#_txtIntColor");var k=$("#_txtExtColor");var a=$("#_txtFirstName");var q=$("#_txtLastName");var l=$("#_txtMessage").val();var w=$("#_ddlCondition").val();var u=true;var m="ValidateTradeInField";var t="";var s="";var y=/\w{17}/;if((e.hasClass(m)||e.val().length!=0)&&(!y.test(e.val()))){t+="-VIN is invalid. Must Be:\n      -17 characters.\n      -Letters and Numbers\n      -No Special characters\n";u=false}if((n.hasClass(m)||n.val().length>0)&&(n.val().length!=4||isNaN(n.val()))){t+="-Year is invalid. Must Be:\n      -4 characters\n      -Numeric Only\n      -No Special Characters\n";u=false}if((d.hasClass(m)||d.val().length!=0)&&(isNaN(d.val())||d.val().length==0)){t+="-Payoff Balance is Invalid. Must Be:\n      -Numeric Only\n      -No Special Characters\n";u=false}if((r.hasClass(m)||r.val().length!=0)&&(r.val().length==0||!checkEmailStr(r.val()))){t+="-Email is Invalid. Must Be a Valid Email Format:\n      Ex. email@example.com\n";u=false}if((h.hasClass(m)||(h.val()!=null&&h.val().length!=0))&&(h.val().length<7||isNaN(h.val()))){t+="-Phone is Invalid. Must Be:\n      -At least 7 characters\n      -Numeric Only\n      -No Special Characters\n";u=false}if((x.hasClass(m)||(x.val()!=null&&x.val().length!=0))&&(!/\d{5}/.test(x.val())||isNaN(x.val()))){t+="-Zip Code is Invalid. Must Be:\n      -At least 5 characters\n      -Numeric Only\n      -No Special Characters\n";u=false}if((p.hasClass(m)||p.val().length!=0)&&(p.val().length==0||isNaN(p.val()))){t+="-Milage is Invalid. Must Be:\n      -Numeric Only\n      -No Special Characters\n";u=false}if((f.hasClass(m)||f.val().length!=0)&&(f.val().length==0||metaCharacters.test(f.val()))){t+="-Make is Invalid. Must Be:\n      -No Special Characters\n";u=false}if((g.hasClass(m)||g.val().length!=0)&&(g.val().length==0||metaCharacters.test(g.val()))){t+="-Model is Invalid. Must Be:\n      -No Special Characters\n";u=false}if((o.hasClass(m)||o.val().length!=0)&&(o.val().length==0||metaCharacters.test(o.val()))){t+="-Interior Color is Invalid. Must Be:\n      -No Special Characters\n";u=false}if((k.hasClass(m)||k.val().length!=0)&&(k.val().length==0||metaCharacters.test(k.val()))){t+="-Exterior Color is Invalid. Must Be:\n      -No Special Characters\n";u=false}if((a.hasClass(m)||a.val().length!=0)&&(a.val().length==0||metaCharacters.test(a.val()))){t+="-First Name is Invalid. Must Be:\n      -No Special Characters\n";u=false}if((q.hasClass(m)||q.val().length!=0)&&(q.val().length==0||metaCharacters.test(q.val()))){t+="-Last Name is Invalid. Must Be:\n      -No Special Characters\n";u=false}if(!IsValueValid(b)){t+="-Comments is Invalid. Must Be:\n      -No HTML allowed\n      -No Special Characters\n";u=false}if(!IsValueValid(l)){t+="-Message is Invalid. Must Be:\n      -No HTML allowed\n      -No Special Characters\n";u=false}if(!u){s="-Following Fields are Required:\n";if(e.hasClass(m)&&e.val().length<1){s+="      -VIN\n"}if(n.hasClass(m)&&n.val().length<1){s+="      -Year\n"}if(f.hasClass(m)&&f.val().length<1){s+="      -Make\n"}if(g.hasClass(m)&&g.val().length<1){s+="      -Model\n"}if(p.hasClass(m)&&p.val().length<1){s+="      -Milage\n"}if(d.hasClass(m)&&d.val().length<1){s+="      -Payoff Balance\n"}if(o.hasClass(m)&&o.val().length<1){s+="      -Interior Color\n"}if(k.hasClass(m)&&k.val().length<1){s+="      -Exterior Color\n"}if(a.hasClass(m)&&a.val().length<1){s+="      -First Name\n"}if(q.hasClass(m)&&q.val().length<1){s+="      -Last Name\n"}if(r.hasClass(m)&&r.val().length<1){s+="      -Email\n"}if(h.hasClass(m)&&h.val().length<1){s+="      -Phone\n"}if(x.hasClass(m)&&x.val().length<1){s+="      -Zip Code\n"}}if(!u){repopulateDefaultText(["_txtYear","_txtMake","_txtModel","_txtMileage","_txtVin","_txtIntColor","_txtExtColor","_txtPayOffBalance","_txtFirstName","_txtLastName","_txtEmail","_txtPhone","_txtZip","_txtMessage"]);alert(s+t)}return u}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,C,q,E,n,t,F,o,L,k,r){if(isDisableBtn(r)){return}var a=ReplaceLiterals($("#_txtFirstName").val());var u=ReplaceLiterals($("#_txtLastName").val());var w=ReplaceLiterals($("#_txtDayPhone").val());var B=ReplaceLiterals($("#_txtEvePhone").val());var z=ReplaceLiterals($("#_txtEmail").val());var g=ReplaceLiterals($("#_txtAddress").val());var D=ReplaceLiterals($("#_txtCity").val());var h=ReplaceLiterals($("#_txtState").val());var H=ReplaceLiterals($("#_txtZip").val());var G=ReplaceLiterals($("#_txtContactMethod").val());var p=ReplaceLiterals($("#_txtYear").val());var e=ReplaceLiterals($("#_txtMake").val());var f=ReplaceLiterals($("#_txtModel").val());var A=ReplaceLiterals($("#_txtVIN").val());var s=ReplaceLiterals($("#_txtMileage").val());var y=ReplaceLiterals($("#_txtApptDate").val());var d=ReplaceLiterals($("#_txtApptTime").val());var I="";if(document.getElementById("_txtPartsDescription")){I=ReplaceLiterals($("#_txtPartsDescription").val())}var b=ReplaceLiterals($("#_txtComment").val());var J=$("#ExportIDHidden").val();var x=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var m=ReplaceLiterals($("#InitialTargetEncodedHidden").val());if(isValidRequestForm()){setDisableBtn(r);$.ajax({type:"POST",url:K+"masterpagewebservice.asmx/SubmitRequest",data:JSON.stringify({contactEmail:l,firstName:a,lastName:u,address:g,city:D,state:h,dayPhone:(w==null?"":w),zip:(H==null?"":H),evePhone:B,email:z,contactMethod:G,year:p,make:e,model:f,vin:A,mileage:s,apptDate:y,apptTime:d,partsDescription:I,comment:b,contactId:C,pageType:q,siteId:E,sourcePage:n,exportID:J,originalUrlEncoded:x,initialTargetEncoded:m}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(M){PageTracking(o,L,false,k,t,F);ExecuteConversionTrackingCode(t);$("#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 A=$("#_txtZip").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 B=$("#_txtPartsDescription").val();var b=$("#_txtComment").val();var q=$("#IsFirstNameHidden").val();var h=$("#IsLastNameHidden").val();var o=$("#IsPhoneNumberRequiredHidden").val();var C=$("#IsZipCodeRequiredHidden").val();var z=$("#IsToValidatePhoneFormatHidden").val();var u="You must enter a value in the following fields: \n";var x=true;$("#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(A!=null&&!/\d{5}/.test(A)&&(!isNullOrEmpty(A)||C=="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(metaCharacters.test(a)||metaCharacters.test(n)||metaCharacters.test(p)||metaCharacters.test(w)||metaCharacters.test(r)||metaCharacters.test(g)||metaCharacters.test(y)||metaCharacters.test(k)||metaCharacters.test(A)||metaCharacters.test(l)||metaCharacters.test(e)||metaCharacters.test(f)||metaCharacters.test(t)||metaCharacters.test(m)||metaCharacters.test(s)||metaCharacters.test(d)||metaCharacters.test(B)||metaCharacters.test(b)){u+="- "+metaCharacterValidateMessage;x=false}if(!x){alert(u)}return x}function IsYearValid(b){var a=/^[^<>]*$/;return a.test(b)}function submitTellAFriend(l,f,n,a,k,b){if(isDisableBtn(b)){return}var d=ReplaceLiterals($("#_txtName").val());var e=ReplaceLiterals($("#_txtSendersEmail").val());var h=ReplaceLiterals($("#_txtEmail").val());var m=$("#_txtCustomMessage").val().replace(/'/g,"_ampersand_");var g=false;if($("#_chkSendCopy").is(":checked")){g=true}if(isValidTellAFriendForm()){setDisableBtn(b);$.ajax({type:"POST",url:l+"masterpagewebservice.asmx/SubmitTellAFriend",data:JSON.stringify({vehiclePath:f,iid:n,name:d,sendersEmail:e,recipientEmailAddress:h,customMessage:m,isSendCopy:g,siteId:a}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(o){if(o==true){PageTracking(k,true,false,true,"",false);$("#ThankYouBox").show();$("#RejectedMessageBox").hide()}else{$("#RejectedMessageBox").show();$("#ThankYouBox").hide()}},failure:function(o){$("#output").text(o);$("#ThankYouBox").hide();$("#RejectedMessageBox").show()}})}}function clearForm(){$("#_txtName").val("");$("#_txtSendersEmail").val("");$("#_txtEmail").val("");$("#_txtCustomMessage").val("");$("#_chkSendCopy").removeAttr("checked");$("#ThankYouBox").hide();$("#RejectedMessageBox").hide()}function submitTellAFriendInventory(m,o,d,l,g,k,a){if(isDisableBtn(a)){return}var b=ReplaceLiterals($("#_txtName").val());var e=ReplaceLiterals($("#_txtSendersEmail").val());var h=ReplaceLiterals($("#_txtEmail").val());var n=$("#_txtCustomMessage").val().replace(/'/g,"_ampersand_");var f=false;if($("#_chkSendCopy").is(":checked")){f=true}if(isValidTellAFriendForm()){setDisableBtn(a);$.ajax({type:"POST",url:m+"masterpagewebservice.asmx/SubmitTellAFriendInventory",data:JSON.stringify({currentUrl:o,dashboardUrlTail:d,currentTitle:l.replace("'",'"').replace("'",'"'),currentSource:g,name:b,sendersEmail:e,recipientEmailAddress:h,customMessage:n,isSendCopy:f}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(p){if(p==true){PageTracking(k,true,false,true,"",false);$("#ThankYouBox").show();$("#RejectedMessageBox").hide()}else{$("#RejectedMessageBox").show();$("#ThankYouBox").hide()}},failure:function(p){$("#output").text(p);$("#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(metaCharacters.test(b)){a+="- "+metaCharacterValidateMessage;$("#NameRequiredFieldValidator").html("*");f=false}if(metaCharacters.test(g)){a+="- "+metaCharacterValidateMessage;$("#PersonalMessageRequiredFieldValidator").html("*");f=false}if(metaCharacters.test(e)){a+="- "+metaCharacterValidateMessage;$("#RecipientEmailRequiredFieldValidator").html("*");f=false}if(metaCharacters.test(d)){a+="- "+metaCharacterValidateMessage;$("#PersonalMessageRequiredFieldValidator").html("*");f=false}if(!f){alert(a)}return f}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 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");if(a.oldStyle){$("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="";clearDefaultText(["txtFirstName","txtLastName","_txtModel","txtEmail","txtPhone","txtZip","txtMessage"]);var a=document.getElementById("txtFirstName");var k=document.getElementById("txtLastName");var g=document.getElementById("txtPhone");var l=document.getElementById("txtZip");var h=document.getElementById("txtEmail");var n=document.getElementById("sltBestTime");if(f&&trim(a.value).length==0){d+="- Please provide your First Name. \n"}if(e&&trim(k.value).length==0){d+="- Please provide your Last Name. \n"}if(g&&b&&trim(g.value).length==0){d+="- Please provide your Phone Number in 9999-999-999 format. \n"}if(l!=null&&!/\d{5}/.test(l.value)&&(!isNullOrEmpty(l.value)||m)){d+="- Please provide a 5 digit numeric zip code. \n"}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(n!=null&&n.value=="0"){d+="- Please select your best time to contact. \n"}if(!checkAllowedChars(a)||!checkAllowedChars(k)||!checkAllowedChars(g)||checkAllowedChars(l)||!checkAllowedChars(h)){d+="- "+metaCharacterValidateMessage}if(d!=""){repopulateDefaultText(["txtFirstName","txtLastName","_txtModel","txtEmail","txtPhone","txtZip","txtMessage"]);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,n){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(n)}}xPopup.prototype.show=function(){this.interval()};xPopup.prototype.hide=function(){this.timeout()};var ConstMaxWindowHeight=1024;var ConstDefaultPopupTop=200;xPopup.prototype.timeout=function(){if(this.open){var a=this.ele;var b=xCardinalPosition(a,this.pos3,this.margin,true);xSlideTo(a,b.x,xClientHeight()>ConstMaxWindowHeight?ConstDefaultPopupTop:b.y,this.slideTime);setTimeout("xHide('"+a.id+"')",this.slideTime);this.open=false}};xPopup.prototype.interval=function(b){if(!this.open){var a=this.ele;var d=xCardinalPosition(a,this.pos1,this.margin,true);xMoveTo(a,d.x,(b==null||d.y>b)?(xClientHeight()>ConstMaxWindowHeight?ConstDefaultPopupTop:d.y):b);xShow(a);d=xCardinalPosition(a,this.pos2,this.margin,false);xSlideTo(a,d.x,(b==null||d.y>b)?(xClientHeight()>ConstMaxWindowHeight?ConstDefaultPopupTop:d.y):b,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(f,u,k,l,s,r){if(isDisableBtn(r)){return false}clearDefaultText(["txtFirstName","txtLastName","_txtModel","txtEmail","txtPhone","txtZip"]);var g="";var t=document.getElementById("txtFirstName");if(u&&trim(t.value).length==0){g+="- Please provide your First Name. \n"}if(!checkAllowedChars(t)){g+="- "+metaCharacterValidateMessage}var q=document.getElementById("txtLastName");if(k&&trim(q.value).length==0){g+="- Please provide your Last Name. \n"}if(!checkAllowedChars(q)){g+="- "+metaCharacterValidateMessage}var a=document.getElementById("txtPhone");if(a!=null&&l&&trim(a.value).length==0){g+="- Please provide your Phone Number in 999-999-9999 format. \n"}if(a!=null&&!checkAllowedChars(a)){g+="- "+metaCharacterValidateMessage}var w=document.getElementById("txtZip");if(w!=null&&!(/\d{5}/.test(w.value))&&(!isNullOrEmpty(w.value)||s)){g+="- Please provide a 5 digit numeric zip code.\n"}if(w!=null&&!checkAllowedChars(w)){g+="- "+metaCharacterValidateMessage}var o=document.getElementById("txtEmail");if(trim(o.value).length==0){g+="- Please provide your Email address, so we may respond to your inquire. \n"}else{if(!checkEmail(o)){g+="- Please fill out properly Your Email address, so we may respond to your inquire. \n"}}if(!checkAllowedChars(o)){g+="- "+metaCharacterValidateMessage}var y=document.getElementById("txtRequestMoreInfoComment");if(!checkAllowedChars(y)){g+="- "+metaCharacterValidateMessage}var n=$(".RequestLeftMainContentPurchaseFrameSelect:visible").get(0);if(n!=null&&n.value=="0"){g+="- Please select your purchase timeframe. \n"}var h=document.getElementById("sltBestTime");if(h!=null&&h.value=="0"){g+="- Please select your best time to contact. \n"}var x=document.getElementById("hdnActiveTab");if(x.value=="RequestTestDrive"){var m=document.getElementById("ctrFirstTimePreferenceDate");if(trim(m.value).length==0){g+="- Please provide your 1st Time Preference. \n"}else{if(!checkDate(m)){g+="- Please fill out properly 1st Time Preference field. I.E. 06/05/2008\n"}}var d=document.getElementById("ctrSecondTimePreferenceDate");if(trim(d.value).length>0){if(!checkDate(d)){g+="- Please fill out properly 2nd Time Preference field. I.E. 06/05/2008 \n"}}var z=document.getElementById("ctrTimePreferenceComment");if(z!=null&&!checkAllowedChars(z)){g+="- "+metaCharacterValidateMessage}}if(x.value=="MakeAnOffer"){var p=document.getElementById("ctrOfferPrice");if(trim(p.value).length==0){g+="- Please provide your Offer Price . \n"}else{if(f=="$"&&!checkOfferPrice(p)){g+="- Please fill out properly Offer Price field. I.E. "+f+"99999 \n"}}var e=document.getElementById("ctrMakeAnOfferComment");if(e!=null&&!checkAllowedChars(e)){g+="- "+metaCharacterValidateMessage}}if(x.value=="RequestMoreInfo"){var b=document.getElementById("txtRequestMoreInfoComment");if(b!=null&&!checkAllowedChars(b)){g+="- "+metaCharacterValidateMessage}}if(x.value=="GetAQuote"){var A=document.getElementById("txtGetAQuoteComment");if(A!=null&&!checkAllowedChars(A)){g+="- "+metaCharacterValidateMessage}}if(g!=""){repopulateDefaultText(["txtFirstName","txtLastName","_txtModel","txtEmail","txtPhone","txtZip"]);alert("You must enter a value in the following fileds: \n"+g);return false}setDisableBtn(r);return true}function clearDefaultText(a){$.each(a,function(){var b=$("#"+this);if(b.length>0&&b.attr("value")==b.attr("title")){b.val("")}})}function repopulateDefaultText(a){$.each(a,function(){var b=$("#"+this);if(b.length>0&&b.attr("value").length==0){b.val(b.attr("title"))}})}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=VehicleFinder";break;case 27:k="leadview=OEMWindowSticker";break;case 28:k="leadview=PrintSpecial";break;case 29:k="leadview=TellAFriendSpecials";break;case 30:k="leadview=TellAFriendSpecialsDetails";break;case 31:k="leadview=TellAFriendService";break;case 32:k="leadview=TellAFriendParts";break;case 33:k="leadview=ShareTwitter";break;case 34:k="leadview=ShareFacebook";break;case 35:k="leadview=ShareMyspace";break;case 36:k="leadview=ShareLinkedin";break;case 37:k="leadview=ShareDelicious";break;case 38:k="leadview=ShareDigg";break;case 39:k="leadview=ShareGooglePlus";break;case 40:k="leadview=360SpinsClick";break;case 41:k="leadview=360SpinsExterior";break;case 42:k="leadview=360SpinsInterior";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(){clearDefaultText(["_txtName","_txtSendersEmail","_txtEmail"]);var f="";var b=document.getElementById("_txtName");var d=document.getElementById("_txtSendersEmail");var a=document.getElementById("_txtEmail");var e=document.getElementById("_txtCustomMessage");if(trim(b.value).length==0){f+="- Please provide Your Name. \n"}if(trim(d.value).length==0||!checkEmail(d)){f+="- Please provide Your Email Address. \n"}if(trim(a.value).length==0||!checkEmail(a)){f+="- Please provide Recipient's Email Address. \n"}if(trim(e.value).length==0){f+="- Please provide Personal Message. \n"}if(!checkAllowedChars(b)){f+="- "+metaCharacterValidateMessage}if(!checkAllowedChars(e)){f+="- "+metaCharacterValidateMessage}if(f!=""){repopulateDefaultText(["_txtName","_txtSendersEmail","_txtEmail"]);alert("You must enter a value in the following fileds: \n"+f);return false}return true}function clearForm(){document.getElementById("_txtName").value="";document.getElementById("_txtSendersEmail").value="";document.getElementById("_txtEmail").value="";document.getElementById("_chkSendCopy").checked=false}function submitSurveyForm(F,C,p,z,t,y,k,m,d,s,n,q){if(isDisableBtn(q)){return}var e=$("#surveyForm")[0];var g=null;var f=[];var b=[];var B=false;var o="";var x="";var a=e.elements.survFirstName;var r=e.elements.survLastName;var w=e.elements.survEmail;var h=e.elements.survPhone;var D=e.elements.survZip;if(k&&isNullOrEmpty(a.value)){o+="- Please fill out first name. \n"}if(!isNullOrEmpty(a)&&!checkAllowedChars(a)){o+="- "+metaCharacterValidateMessage}if(m&&isNullOrEmpty(r.value)){o+="- Please fill out last name. \n"}if(!isNullOrEmpty(r)&&!checkAllowedChars(r)){o+="- "+metaCharacterValidateMessage}if(!checkEmail(w)){o+="- Email address has wrong format. \n"}if(h!=null&&d&&isNullOrEmpty(h.value)){o+="- Please enter phone number.\n"}if(h!=null&&!isNullOrEmpty(h.value)&&!checkAllowedChars(h)){o+="- "+metaCharacterValidateMessage}if(D!=null&&!/\d{5}/.test(D.value)&&(!isNullOrEmpty(D.value)||s)){o+="- Please provide a 5 digit numeric zip code. \n"}for(i=0;i<t.length;i++){g=e.elements["survAnswer"+t[i]];b=[];if(!g.tagName){B=!y[i];for(var A=0;A<g.length;A++){if(g[A].checked){B=true;b[b.length]="'"+g[A].value.replace(/'/g,"&rsquo;")+"'"}}if(!B){x+="- Question "+(i+1)+" needs a response. \n"}if(!checkAllowedChars(g)){o+="- "+metaCharacterValidateMessage}}else{if(y[i]&&isNullOrEmpty(g.value)){x+="- Question "+(i+1)+" needs a response. \n"}else{if(g.type=="text"&&g.value.length>300){x+="- You have exceeded the 300 character limit for question "+(i+1)+". \n"}else{b=["'"+g.value.replace(/'/g,"&rsquo;")+"'"]}if(!checkAllowedChars(g)){o+="- "+metaCharacterValidateMessage}if(g.tagName=="TEXTAREA"&&g.value.length>2500){x+="- 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(x.length!=0){o+="Please Complete the following: \n"+x}if(o.length==0){var E=$("#ExportIDHidden").val();var u=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var l=ReplaceLiterals($("#InitialTargetEncodedHidden").val());setDisableBtn(q);$.ajax({type:"POST",url:F+"masterpagewebservice.asmx/SubmitSurvey",data:"{ siteId: "+C+", pageId: "+p+", contactId: "+z+", firstName: '"+a.value+"', lastName: '"+r.value+"', email: '"+w.value+"', phone: '"+(h==null?"":h.value)+"', zip: '"+(D==null?"":D.value)+"', questions: ["+t+"], answers: ["+f+"], sourcePage: '"+n+"', exportID: "+E+", originalUrlEncoded: '"+u+"', initialTargetEncoded: '"+l+"' }",contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(G){if(G==true){e.style.display="none";$("#surveyThankYouContent")[0].style.display="block"}},failure:function(G){}})}else{alert(o)}}function OpenCompareWindow(d,a){var e="";var b=0;$("input[type='checkbox']:checked").each(function(){if(this.id.substr(0,2)=="cb"){e=e+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");$("#simplemodal-overlay, #CompareVehiclesContainer .ClosePopupBtn").bind("click.simplemodal",function(f){f.preventDefault();_popupObject.close()});$.ajax({type:"POST",url:d,data:"iids="+e,success:function(f){$("#CompareVehiclesContainer .CompareVehiclesInner2").html(f)},error:function(f,g){$("#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(b,a,d){CalculateLoanControl(b,a,d);CalculateLeaseControl(b,a,d)}function PaymentCalcUsed(b,a,d){CalculateLoanControl(b,a,d)}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)}}function ReplaceLiterals(a){if(a){return a.replace(/\\/g,"\\\\").replace(/\'/g,"\\'")}else{return""}}function BaseValidate(){var e="";var a=$("form input, form select");var d=null;var b=null;a.each(function(){b=$(this);if(b.hasClass("validateAsEmail")&&(b.hasClass("fieldIsRequired")||(this.value.length>0))&&!b.parents("._parentContainer").hasClass("invisible")){if(!checkEmailStr(this.value)){d=this.title;if(d!=null){e+="-"+d+"\n"}else{e+="-Please provide correct email.\n"}}}if(b.hasClass("validateAsDate")&&(b.hasClass("fieldIsRequired")||(this.value.length>0&&b.val()!="mm/dd/yyyy"))&&!b.parents("._parentContainer").hasClass("invisible")){if(!checkDate(this)){d=this.title;if(d!=null){e+="-"+d+"\n"}else{e+="-Please provide correct date in format MM.dd.yyyy.\n"}}}if(b.hasClass("validateAsZip")&&(b.hasClass("fieldIsRequired")||(this.value.length>0))&&!b.parents("._parentContainer").hasClass("invisible")){if(!/^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$/i.test(this.value)){d=this.title;if(d!=null){e+="-"+d+"\n"}else{e+="-Please provide a 5 digit numeric zip code.\n"}}}if(b.hasClass("validateAsNumeric")&&(b.hasClass("fieldIsRequired")||(this.value.length>0))&&!b.parents("._parentContainer").hasClass("invisible")){var f=this.value;f=f.replace(",","").replace("$","").replace("�","").replace(/\u20ac/g,"").replace(/\u00A3/g,"");if(!/^[-+]?\d{1,14}(\.\d{1,4})?$/.test(f)){d=this.title;if(d!=null){if(e.indexOf("-"+d+"\n")<0){e+="-"+d+"\n"}}else{e+="-Field should be numeric.\n"}if(metaCharacters.test(f)){e+="-"+metaCharacterValidateMessage}}this.value=f}if(b.hasClass("validateAsCurrancy")&&(b.hasClass("fieldIsRequired")||(this.value.length>0))&&!b.parents("._parentContainer").hasClass("invisible")){var f=this.value;if(!/^(?:(?:\d{0,3}(?:[, ]\d{0,3})*[, ])+\d{3}|\d+)(?:[.]\d{0,2})?$/.test(f)){d=this.title;if(d!=null){if(e.indexOf("-"+d+"\n")<0){e+="-"+d+"\n"}}else{e+="-Field should be in currancy format.\n"}}}if(b.hasClass("validateAsText")&&b.hasClass("fieldIsRequired")&&!b.parents("._parentContainer").hasClass("invisible")){if(isNullOrEmpty(this.value)){d=this.title;if(d!=null){e+="-"+d+"\n"}else{e+="-Field could not be empty \n"}if(metaCharacters.test(this.value)){e+="-"+metaCharacterValidateMessage}}}if(b.hasClass("validateAsSelect")&&(b.hasClass("fieldIsRequired")&&!b.parents("._parentContainer").hasClass("invisible")&&(b.val()=="N/A"||b.val()==""))){if(this.title!=""){e+="-"+this.title+"\n"}else{e+="-Dropdown could not be empty \n"}}});return e}function ValidateCreditApp(){var b=$("#_chPermission")[0];var e=BaseValidate();var d=$("#_AplicantInformation_Years");var f=$("#_AplicantInformation_Month");if(d.hasClass("fieldIsRequired")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}d=$("#_ApplicantFinancialInformation_Years");f=$("#_ApplicantFinancialInformation_Month");if(d.length>0&&d.hasClass("fieldIsRequired")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}d=$("#_CoApplicantFinancialInformation_Years");f=$("#_CoApplicantFinancialInformation_Month");if(d.length>0&&d.hasClass("fieldIsRequired")&&!d.parents("._parentContainer").hasClass("invisible")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}d=$("#_CoApplicantInformation_Years");f=$("#_CoApplicantInformation_Month");if(d.length>0&&d.hasClass("fieldIsRequired")&&!d.parents("._parentContainer").hasClass("invisible")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}d=$("#_ApplicantFinancialInformation_PrYears");f=$("#_ApplicantFinancialInformation_PrMonth");if(d.length>0&&d.hasClass("fieldIsRequired")&&!d.parents("._parentContainer").hasClass("invisible")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}d=$("#_CoApplicantFinancialInformation_PrYears");f=$("#_CoApplicantFinancialInformation_PrMonth");if(d.length>0&&d.hasClass("fieldIsRequired")&&!d.parents("._parentContainer").hasClass("invisible")&&d.val()=="0"&&f.val()=="0"){e+="-"+d.attr("title")+"\n"}var a=$("#_ApplicantInformation_State");if(a.hasClass("isRequired")){if(a.attr("value")=="N/A"||a.attr("value")==""){e+="-Plase select your home state. \n"}}var g=$("#_OtherInfo_Comments");if(g.hasClass("commentsReq")){if(g.val().length<=0){e+="-Please provide your comments. \n"}}if(!b.checked){e+="-You must agree with terms and conditions of this application."}if(e!=""){alert("You must enter a value in the following fields: \n"+e);return false}else{_isCreditAppSubmitAllowed=true;$("#CreditAppForm").submit();return true}}function showPreviousAddEmp(a,d,f){var b=$("#"+a).val();var e=$("#"+d);if(b<f){if(e.hasClass("invisible")){e.removeClass("invisible")}}else{if(!e.hasClass("invisible")){e.addClass("invisible")}}}function CreditAppShowCoApplicant(){var a=$("#_CoAplicantInfDIV");var b=$("#_CoAplicantFinInfDIV");if(a.hasClass("invisible")){a.removeClass("invisible")}if(b.hasClass("invisible")){b.removeClass("invisible")}}function CreditAppHideCoApplicant(){var a=$("#_CoAplicantInfDIV");var b=$("#_CoAplicantFinInfDIV");if(!a.hasClass("invisible")){a.addClass("invisible")}if(!b.hasClass("invisible")){b.addClass("invisible")}}function RequestMoreInfoInputObserver(){$(function(){$(".RequestLeftMainContentContactInformationInner input").focus(function(){if($(this).attr("title")==this.value){this.value=""}})})}function ContactUsInputObserver(){$(function(){$(".ContactInformation input, textarea").focus(function(){if($(this).attr("title")==this.value){this.value=""}})})}function RightHandPageWrapperHeigth(){$("#RightHandPageWrapperBox").height($("#LeftHandPageWrapperBox").height())}function submitSurvey(A,y,n,t,l,o){if(isDisableBtn(o)){return}var d=$("#surveyForm")[0];var g=null;var f=[];var b=[];var x=false;var m="";var a=d.elements.survFirstName;var p=d.elements.survLastName;var r=d.elements.survEmail;var h=d.elements.survPhone;var u=d.elements.survPrice;var e=$("input[name=survPhoneOrEmail]:radio:checked").val();var w=d.elements.survDescription;if(isNullOrEmpty(a.value)){m+="Please fill out first name. \n"}if(isNullOrEmpty(p.value)){m+="Please fill out last name. \n"}if(!checkEmail(r)){m+="Email address has wrong format. \n"}if(isNullOrEmpty(h.value)){m+="Please enter phone number. \n"}if(isNullOrEmpty(u.value)){m+="Please enter price. \n"}var s=u.value;s=s.replace(",",".").replace("$","");if(s.indexOf(".")!=-1){s=s.substring(0,s.indexOf("."))}if(!/^[-+]?\d{1,14}(\.\d{1,4})?$/.test(s)){m+="Price field should be numeric. \n"}else{u.value=s}if(isNullOrEmpty(w.value)){m+="Please fill out description.\n"}if(m.length==0){var z=$("#ExportIDHidden").val();var q=ReplaceLiterals($("#OriginalUrlEncodedHidden").val());var k=ReplaceLiterals($("#InitialTargetEncodedHidden").val());setDisableBtn(o);$.ajax({type:"POST",url:A+"masterpagewebservice.asmx/SubmitSurveyHendrick",data:JSON.stringify({siteId:y,pageId:n,contactId:t,firstName:a.value,lastName:p.value,email:r.value,phone:(h==null?"":h.value),phoneOrEmail:e,price:u.value,description:(w==null?"":w.value),sourcePage:l,exportID:z,originalUrlEncoded:q,initialTargetEncoded:k}),contentType:"application/json; charset=utf-8",dataType:"json",cache:false,success:function(B){if(B==true){d.style.display="none";$("#surveyThankYouContent")[0].style.display="block"}},failure:function(B){}})}else{alert(m)}}function IsCurancyFormat(a){if(/^(?:(?:\d{0,3}(?:[, ]\d{0,3})*[, ])+\d{3}|\d+)(?:[.]\d{0,2})?$/.test(a)){return true}return false}function SetupHoverBtn(){$("input.HasHover").mouseenter(function(){this.src=this.src.replace("_normal.png","_hover.png")}).mouseleave(function(){this.src=this.src.replace("_hover.png","_normal.png")})}var _slider;var _selectedPhotoid;var _selectedVideoid;var _timeout;var _calculatedPhotoCount;function ChangeTabInfo(b,a){$("."+b).css("display","none");$("."+a).css("display","block")}function ChangeMediaViewerNavInfo(a){if($(".PhotoInfoList"+a).css("display")=="none"){$(".PhotoInfoList"+a).css("display","block");$(".VideoInfoList"+a).css("display","none")}else{$(".PhotoInfoList"+a).css("display","none");$(".VideoInfoList"+a).css("display","block")}}function ChangeVehicleVideo(b,f){var e;var d;if(!f){f=1}for(var a=1;a<=b;a++){if(a==f){$("#VideoFaceSelected"+a).css("display","block");$("#ContentVideo").html('<iframe class="VideoIframe" src="'+$("#UrlVideo"+a).val()+'"></iframe>');$("#CurrentVideoNum").html(a);e=$("#ContentVideo").offset().top+parseInt($("#ContentVideo").css("height"))-parseInt($("#BottomVideoFixLine").css("height"));d=$("#ContentVideo").offset().left;$("#BottomVideoFixLine").css("top",e);$("#BottomVideoFixLine").css("left",d)}else{$("#VideoFaceSelected"+a).css("display","none")}}_selectedVideoid=f}function IsNumeric(a){return/^[-+]?\d{1,14}(\.\d{1,4})?$/.test(a)}(function(a){a.fn.thumbnailSlider=function(d){var b=this;var f=null;var e;var g={oriental:"vertical",sliderArea:0,verticalSlideHeight:0,horizontalSlideWidth:0,firstImgId:1};var d=a.extend(g,d);if(d.oriental=="vertical"){f=a("#Slider").slider({change:function(h,k){a("#PhotoList").animate({marginTop:-(d.sliderArea-k.value)},0)},slide:function(h,k){b.StopPlay()},orientation:"vertical",min:0,max:d.sliderArea,value:d.sliderArea})}if(d.oriental=="horizontal"){f=a("#Slider").slider({change:function(h,k){a("#PhotoList").animate({marginLeft:-k.value},0)},slide:function(h,k){b.StopPlay()},orientation:"horizontal",min:0,max:d.sliderArea,value:0})}a(".MediaTab").mousedown(function(){b.StopPlay()});a("#FullSizeLink").mousedown(function(){b.StopPlay()});a(".UpButton").mousedown(function(){b.StopPlay();b.ChangePlayerButton("UpBtn","UpBtnHover");if(d.sliderArea>0){f.slider("value",d.sliderArea+b.MoveDownPhotoListByButton())}}).mouseup(function(){e=setTimeout(function(){b.ChangePlayerButton("UpBtnHover","UpBtn")},500)});a(".DownButton").mousedown(function(){b.StopPlay();b.ChangePlayerButton("DownBtn","DownBtnHover");if(d.sliderArea>0){f.slider("value",d.sliderArea+b.MoveUpPhotoListByButton())}}).mouseup(function(){e=setTimeout(function(){b.ChangePlayerButton("DownBtnHover","DownBtn")},500)});a(".LeftButton").mousedown(function(){b.StopPlay();b.ChangePlayerButton("LeftBtn","LeftBtnHover");if(d.sliderArea>0){f.slider("value",b.MoveLeftPhotoListByButton())}}).mouseup(function(){e=setTimeout(function(){b.ChangePlayerButton("LeftBtnHover","LeftBtn")},500)});a(".RightButton").mousedown(function(){b.StopPlay();b.ChangePlayerButton("RightBtn","RightBtnHover");if(d.sliderArea>0){f.slider("value",b.MoveRightPhotoListByButton())}}).mouseup(function(){e=setTimeout(function(){b.ChangePlayerButton("RightBtnHover","RightBtn")},500)});a(".PlayerButtonPauseOuter").mousedown(function(){clearInterval(_timeout);a(".PlayerButtonPause").addClass("PlayerButtonPauseHover")}).mouseup(function(){e=setTimeout(function(){a(".PlayerButtonPause").removeClass("PlayerButtonPauseHover");a(".PlayerButtonPauseOuter").css("display","none");a(".PlayerButtonPlayOuter").css("display","block")},500)});a(".PlayerButtonPlayOuter").mousedown(function(){_timeout=setInterval(function(){_slider.ChangeBigPhoto2(_selectedPhotoid>_calculatedPhotoCount?d.firstImgId:_selectedPhotoid+1)},5000);a(".PlayerButtonPlay").addClass("PlayerButtonPlayHover")}).mouseup(function(){e=setTimeout(function(){a(".PlayerButtonPlay").removeClass("PlayerButtonPlayHover");a(".PlayerButtonPlayOuter").css("display","none");a(".PlayerButtonPauseOuter").css("display","block")},500)});a(".PlayerButtonNextOuter").mousedown(function(){b.StopPlay();a(".PlayerButtonNext").addClass("PlayerButtonNextHover");b.ChangeBigPhoto2(_selectedPhotoid>_calculatedPhotoCount?d.firstImgId:_selectedPhotoid+1)}).mouseup(function(){e=setTimeout(function(){a(".PlayerButtonNext").removeClass("PlayerButtonNextHover")},500)});a(".PlayerButtonPrewOuter").mousedown(function(){b.StopPlay();a(".PlayerButtonPrew").addClass("PlayerButtonPrewHover");b.ChangeBigPhoto2(_selectedPhotoid==d.firstImgId?_calculatedPhotoCount+1:_selectedPhotoid-1)}).mouseup(function(){e=setTimeout(function(){a(".PlayerButtonPrew").removeClass("PlayerButtonPrewHover")},500)});a(".ContentPhotoTab1SmallPhoto").mousedown(function(){b.StopPlay();b.ChangeBigPhoto(this)});b.StopPlay=function(){clearInterval(_timeout);a(".PlayerButtonPauseOuter").css("display","none");a(".PlayerButtonPlayOuter").css("display","block")};b.ChangePlayerButton=function(k,h){a("#"+k).css("display","none");a("#"+h).css("display","block")};b.ChangeBigPhoto=function(h){var k=aLarge[h.id].src;a("#ImgFaceSelected"+h.id).css("display","block");a("#ImgFaceSelected"+_selectedPhotoid).css("display","none");_selectedPhotoid=parseInt(h.id);a("#BigPhoto").fadeOut(300,function(){a("#BigPhoto").attr("src",k).fadeIn(300)});a("#CurrentPhotoNum").html(_selectedPhotoid+1-d.firstImgId);b.MovePhotoList(h.id)};b.ChangeBigPhoto2=function(k){var h=aLarge[k].src;a("#ImgFaceSelected"+k).css("display","block");a("#ImgFaceSelected"+_selectedPhotoid).css("display","none");_selectedPhotoid=parseInt(k);a("#BigPhoto").fadeOut(300,function(){a("#BigPhoto").attr("src",h).fadeIn(300)});a("#CurrentPhotoNum").html(_selectedPhotoid+1-d.firstImgId);b.MovePhotoList(k)};b.MovePhotoList=function(k){if(d.oriental=="vertical"){var t=parseInt(a("#ImgFaceSelected"+k).css("top"));var l=parseInt(a("#ImgFaceSelected"+k).css("top"))+80;var s=parseInt(a("#PhotoList").css("margin-top"));var n=0-s;var q=d.verticalSlideHeight-s;var p;if(n>t){p=s+n-t}else{if(l>q){p=s+q-l}}if(p!=null){a("#PhotoList").animate({marginTop:p},1200);f.slider("value",d.sliderArea+p)}}if(d.oriental=="horizontal"){var o=parseInt(a("#ImgFaceSelected"+k).css("left"));var m=o+107;var s=parseInt(a("#PhotoList").css("margin-left"));var h=0-s;var r=h+d.horizontalSlideWidth;var p;if(m>r){p=s+r-m}else{if(o<h){p=s+h-o}}if(p!=null){a("#PhotoList").animate({marginLeft:p},1200);f.slider("value",-p)}}};b.MoveUpPhotoListByButton=function(){var h=parseInt(a("#PhotoList").css("height"));var m=parseInt(a("#PhotoList").css("margin-top"));var l=0-m;var k=d.verticalSlideHeight-m;if(h-k>85){m=m-85}else{m=d.verticalSlideHeight-h}a("#PhotoList").animate({marginTop:m},600);return m};b.MoveDownPhotoListByButton=function(){var h=parseInt(a("#PhotoList").css("height"));var m=parseInt(a("#PhotoList").css("margin-top"));var l=0-m;var k=d.verticalSlideHeight-m;if(l-85>0){m=m+85}else{m=0}a("#PhotoList").animate({marginTop:m},600);return m};b.MoveLeftPhotoListByButton=function(){var k=parseInt(a("#PhotoList").css("width"))-5;var l=parseInt(a("#PhotoList").css("margin-left"));var h=parseInt(a(".ContentPhotoTab3PhotoListOuter").css("width"));if(l<-112){l=l+112}else{l=0}a("#PhotoList").animate({marginLeft:l},600);return -l};b.MoveRightPhotoListByButton=function(){var k=parseInt(a("#PhotoList").css("width"))-5;var l=parseInt(a("#PhotoList").css("margin-left"));var h=parseInt(a(".ContentPhotoTab3PhotoListOuter").css("width"));if(k+l-5>=h+112){l=l-112}else{l=l+(h-(k+l))}a("#PhotoList").animate({marginLeft:l},600);return -l};return this}})(jQuery);function onTabLinkClick(g,d,f,b){$("#"+f+g+"s").show();$("#"+f+g).hide();$("#"+f+g+"Content").show();var e,a;for(e=1;e<=d;e++){if(e!=g){a=$("#"+f+e+"s")[0];if(a!=null&&a.style.display!="none"){$("#"+f+e+"s").hide();$("#"+f+e).show();$("#"+f+e+"Content").hide()}}}if(b&&jQuery.isFunction(b)){b(g,d,f)}}function SwitchBodyStyleTab(d,a,b){$("#NewVehicleMainTabContent .BodyStyle").hide();if(d==1){$("#NewVehicleMainTabContent .BodyStyle").show()}else{$("#NewVehicleMainTabContent .BodyStyle"+d).show()}}function AdvancedSearchSubmit(a){$("form",a).each(function(){this.submit()})}function AdvancedSearchReset(a){$("select",a).each(function(){this.selectedIndex=0});$("form",a).each(function(){this.reset()})}function GetModelHomePageAdvancedSearchContentNew(obj){var hostURL=obj.data("HostUrl");var siteId=obj.data("SiteId");var make=$(".sltMake",obj).val();if(!make){make=""}$(".sltModel",obj).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetModelHomePageAdvancedSearchContent",data:JSON.stringify({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=$(".sltModel",obj);modelsList.empty().append('<option value="">Select Vehicle Model</option>');for(var i=0;i<models.length;i++){modelsList.append('<option value="'+models[i]+'">'+models[i]+"</option>")}GetYearsHomePageAdvancedSearchContentNew(obj);GetBodyStylesHomePageAdvancedSearchContentNew(obj)},failure:function(msg){$("#output").text(msg)}})}function GetYearsHomePageAdvancedSearchContentNew(obj){var hostURL=obj.data("HostUrl");var siteId=obj.data("SiteId");var make=$(".sltMake",obj).val();var model=$(".sltModel",obj).val();if(!make){make=""}if(!model){model=""}$(".sltYearFrom",obj).empty().append('<option value="">Loading...</option>');$(".sltYearTo",obj).empty().append('<option value="">Loading...</option>');$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetYearsHomePageAdvancedSearchContent",data:JSON.stringify({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;$(".sltYearFrom",obj).empty().append('<option value="">Select Low Year</option>');for(var i=years.length-1;i>=0;i--){$(".sltYearFrom",obj).append('<option value="'+years[i]+'">'+years[i]+"</option>")}$(".sltYearTo",obj).empty().append('<option value="">Select High Year</option>');for(var j=0;j<years.length;j++){$(".sltYearTo",obj).append('<option value="'+years[j]+'">'+years[j]+"</option>")}GetBodyStylesHomePageAdvancedSearchContentNew(obj)},failure:function(msg){$("#output").text(msg)}})}function GetBodyStylesHomePageAdvancedSearchContentNew(obj){var hostURL=obj.data("HostUrl");var siteId=obj.data("SiteId");var country=obj.data("Country");var make=$(".sltMake",obj).val();var model=$(".sltModel",obj).val();if(!make||0==make.length){return}if(!model||0==make.length){return}$(".sltBodyStyle",obj).empty().append('<option value="">Loading...</option>');var bodyStylesTemp=[];$.ajax({type:"POST",url:hostURL+"masterpagewebservice.asmx/GetBodyStylesHomePageAdvancedSearchContent",data:JSON.stringify({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;$(".sltBodyStyle",obj).empty().append('<option value="">Select Body Style</option>');for(var i=0;i<bodyStyles.length;i++){bodyStylesTemp[i]=eval("("+bodyStyles[i]+")");$(".sltBodyStyle",obj).append('<option value="'+bodyStylesTemp[i].Value+'">'+bodyStylesTemp[i].Name+"</option>")}},failure:function(msg){$("#output").text(msg)}})}function AdvancedSearchUpdateCondition(a){switch($(".sltCondition",a).val()){case"0":$(".hdnNew",a).val("");$(".hdnUsed",a).val("");$(".hdnCpo",a).val("");$(".hdnDealerCpo",a).val("");break;case"1":$(".hdnNew",a).val("true");$(".hdnUsed",a).val("false");$(".hdnCpo",a).val("");$(".hdnDealerCpo",a).val("");break;case"2":$(".hdnNew",a).val("false");$(".hdnUsed",a).val("true");$(".hdnCpo",a).val("");$(".hdnDealerCpo",a).val("");break;case"3":$(".hdnNew",a).val("false");$(".hdnUsed",a).val("true");$(".hdnCpo",a).val("true");$(".hdnDealerCpo",a).val("");break;case"4":$(".hdnNew",a).val("false");$(".hdnUsed",a).val("true");$(".hdnCpo",a).val("");$(".hdnDealerCpo",a).val("true");break}}function ImageViewerHideTab(a,b){$(".TabContentTab"+a,b).hide();$(".TabButtonOverTab"+a,b).hide()}function ImageViewerShowTab(h,e){for(var f=0;f<10;f++){ImageViewerHideTab(f,e)}$(".TabContentTab"+h,e).show();$(".TabButtonOverTab"+h,e).show();if(h==0&&($(".TabContentTab0",e).data("IsAdjusted")!==true)){var g=$(".MakeColumn",e);var k=0;var a=0;for(f=0;f<g.length;f++){var m=($("div.sboCol-"+(f+1)+" > div.MakeItem > a",e));var l=90;for(j=0;j<m.length;j++){var b=$(m[j]).width();if(b>l){l=b}}a=a+(l-90);$("div.sboCol-"+(f+1),e).width(l);if(f+1<g.length){var d=$("div.sboCol-"+(f+2),e).position().left;d=d+a;$("div.sboCol-"+(f+2),e).css("left",d+"px")}}$(".TabContentTab0 > div.MakesTab",e).width($(".TabContentTab0 > div.MakesTab",e).width()+a);$(".TabContentTab0",e).width($(".TabContentTab0",e).width()+a+($.browser.msie?e.data("PopupBorderWidth")*4:0));$(".TabContentTab0",e).data("IsAdjusted",true)}}function ImageViewerHoverTab(a,d){for(var b=0;b<10;b++){if($(".TabContentTab"+b,d).css("display")!="block"){ImageViewerHideTab(b,d)}}$(".TabButtonOverTab"+a,d).show()}function ImageViewerHoverOffTab(a,b){if($(".TabContentTab"+a,b).css("display")!="block"){$(".TabButtonOverTab"+a,b).hide()}}function ImageViewerTransit(b,f,e){switch(e){case 1:case 2:b.fadeOut();f.delay(400).fadeIn();break;case 3:b.fadeOut();f.fadeIn();break;case 4:var d=f.parent().width();f.css({top:0,left:d}).show();b.show();f.animate({left:0},{complete:function(){b.hide()}});break;case 5:var d=f.parent().width();f.css({top:0,left:-d}).show();b.show();f.animate({left:0},{complete:function(){b.hide()}});break;case 6:var a=f.parent().height();f.css({top:-a,left:0}).show();b.show();f.animate({top:0},{complete:function(){b.hide()}});break;case 7:var a=f.parent().height();f.css({top:a,left:0}).show();b.show();f.animate({top:0},{complete:function(){b.hide()}});break;default:f.show();b.hide();break}}function ImageViewerPrevious(b){var a=$(".ViewImages .ViewImage",b);if(a.length<2){return}a.stop(false,true);newImage=$(a[a.length-2]);oldImage=$(a[a.length-1]);$(".ViewImages",b).prepend(oldImage);ImageViewerTransit(oldImage,newImage,b.data("TransitionType"))}function ImageViewerNext(b){var a=$(".ViewImages .ViewImage",b);if(a.length<2){return}a.stop(false,true);newImage=$(a[0]);oldImage=$(a[a.length-1]);$(".ViewImages",b).append(newImage);ImageViewerTransit(oldImage,newImage,b.data("TransitionType"))}function ImageViewerPlay(a){if(a.IsPlaying){return}if(window.Touch||("ontouchstart" in document.documentElement)){ImageViewerShowPlayback(a)}else{$(".ImageRotator",a).mouseenter(function(){ImageViewerShowPlayback(a)}).mouseleave(function(){ImageViewerHidePlayback(a)})}a.IsPlaying=true;a.Timer=setInterval(function(){ImageViewerNext(a)},a.data("ImageViewTime")*1000);$(".PlaybackControl .PlayButton",a).hide();$(".PlaybackControl .PauseButton",a).show()}function ImageViewerPause(a){if(!a.IsPlaying){return}a.Timer=clearInterval(a.Timer);a.IsPlaying=false;$(".ImageRotator",a).unbind("mouseenter").unbind("mouseleave");$(".PlaybackControl",a).stop(true,true).css({opacity:1,marginTop:0});$(".PlaybackControl .PlayButton",a).show();$(".PlaybackControl .PauseButton",a).hide()}function ImageViewerPlayPause(a){if(a.IsPlaying){ImageViewerPause(a)}else{ImageViewerPlay(a)}}function ImageViewerShowPlayback(b){var a=$(".ViewImages .ViewImage",b);if(a.length<2){return}$(".PlaybackControl",b).stop(true,true).css({opacity:0,marginTop:-40}).animate({opacity:1,marginTop:0})}function ImageViewerHidePlayback(b){var a=$(".ViewImages .ViewImage",b);if(a.length<2){return}$(".PlaybackControl",b).stop(true,true).css({opacity:1,marginTop:0}).animate({opacity:0,marginTop:-40})}function InitImageViewer(b){for(i=0;i<10;i++){(function(d){$(".TabButton"+d,b).mouseover(function(){ImageViewerHoverTab(d,b)});$(".TabContentTab"+d+" .closePopupLink a",b).click(function(){ImageViewerHideTab(d,b)});$(".TabButtonOverTab"+d,b).click(function(){ImageViewerShowTab(d,b)}).mouseout(function(){ImageViewerHoverOffTab(d,b)})})(i)}var a=$(".ViewImages .ViewImage",b);$(a[0]).show();if(a.length>1){$(".ViewImages",b).append(a[0]);b.IsPaying=false;$(".ViewImages",b).click(function(){ImageViewerPlayPause(b)});$(".ViewImages",b).touchwipe({wipeLeft:function(){ImageViewerPause(b);ImageViewerNext(b)},wipeRight:function(){ImageViewerPause(b);ImageViewerPrevious(b)},preventDefaultEvents:false});$(".PlaybackControl .PrevButton",b).click(function(){ImageViewerPause(b);ImageViewerPrevious(b)});$(".PlaybackControl .PlayButton",b).click(function(){ImageViewerPlayPause(b)});$(".PlaybackControl .PauseButton",b).click(function(){ImageViewerPlayPause(b)});$(".PlaybackControl .NextButton",b).click(function(){ImageViewerPause(b);ImageViewerNext(b)});ImageViewerPlayPause(b)}}function InitSpecialsTicker(b,a){b.data("IsScrolling",true);b.hover(function(){b.data("IsScrolling",false)},function(){b.data("IsScrolling",true)});$(this).everyTime(a,function(){if(b.data("IsScrolling")){getSpecials(b,"next")}})}function InitFeaturedLarge(b){if(window.Touch||("ontouchstart" in document.documentElement)){$(".ImageContainer .Overlay",b).show().css({bottom:0})}else{$(".ImageContainer",b).hover(function(){$(".Overlay",b).stop().animate({bottom:0})},function(){$(".Overlay",b).stop().animate({bottom:-30})})}var a=$(".Images .ImageContainer",b);$(a[0]).show();if(a.length<2){return}$(".Images",b).append(a[0]);b.Timer=setInterval(function(){var d=$(".Images .ImageContainer",b);newImage=$(d[0]);oldImage=$(d[d.length-1]);$(".Images",b).append(newImage);ImageViewerTransit(oldImage,newImage,3)},8000)};
