function ValidateZip(a){ret=false;if(a!=null||a!=""){ret=g_regexZip.test(a)}return ret}function ClearErrBkg(a){removeCssClass(a,"orangeBack")}function SetErrBkg(a){addCssClass(a,"orangeBack")}function SetDDLInnerHtml(a,b){ddl=$get(a);if(null==ddl){return}if($get("hiddenIE")){ddl.options.length=0;var e=new ActiveXObject("Msxml2.DOMDocument");e.async=false;e.loadXML("<list>"+b+"</list>");var c=e.documentElement;while(c.hasChildNodes()){objNode=c.firstChild;var d=document.createElement("OPTION");ddl.options.add(d);
d.innerText=objNode.text;if(null!=objNode.selectSingleNode("@value")){d.value=objNode.selectSingleNode("@value").text}c.removeChild(c.firstChild)}}else{ddl.innerHTML=b}}function fnSetDDLByValue(a,d){var c=false;var b=$get(a);b.selectedIndex=0;if(""!=d){for(i=0;i<=b.options.length-1;i++){if(b.options[i].value==d){b.selectedIndex=i;c=true;break}}}return c}function fnSetDDLByText(a,d){var c=false;var b=$get(a);b.selectedIndex=0;if(""!=d){for(i=0;i<=b.options.length-1;i++){if(b.options[i].text==d){b.selectedIndex=i;
c=true;break}}}return c}var shadowBoxStack=[];function showShadowBox(e,c){if(null!=$get(e)){if(null==c){c=true}var b=false;if(0==shadowBoxStack.length){b=true}var d=false;for(var a=0;a<shadowBoxStack.length;a++){hideDIV(shadowBoxStack[a].name);if(shadowBoxStack[a].name==e){d=true}}if(!d){shadowBoxStack.push({name:e,isRoot:b})}showAlertBackground();if(c){addCssClass($get(e),"fixed")}setPopupDivPosition(e,c);showDIV(e)}}function hideShadowBox(b){if(null!=$get(b)){for(var a=0;a<shadowBoxStack.length;
a++){if(b==shadowBoxStack[a].name){shadowBoxStack.splice(a,1)}}var c=null;if(0<shadowBoxStack.length){c=shadowBoxStack[shadowBoxStack.length-1]}hideDIV(b);removeCssClass($get(b),"fixed");if(c!=null&&c.isRoot&&containsCssClass){showDIV(c.name)}if(0==shadowBoxStack.length){hideAlertBackground()}}}function hideAllShadowBoxes(){for(var a=0;a<shadowBoxStack.length;a++){hideDIV(shadowBoxStack[a].name);removeCssClass($get(shadowBoxStack[a].name),"fixed")}shadowBoxStack=[];hideAlertBackground()}function showAlertBackground(){hideDropDownVarList();
showDIV("alertBackground")}function hideAlertBackground(){hideDIV("alertBackground");showDropDownVarList()}function showDropDownVarList(){if("undefined"!=typeof(dropDownVarList)){showHideDropDowns("visible",dropDownVarList)}}function hideDropDownVarList(){if("undefined"!=typeof(dropDownVarList)){showHideDropDowns("hidden",dropDownVarList)}}function showHideDropDowns(b,a){if(a){for(i=0;i<a.length;i++){$get(a[i]).style.visibility=b}}}function showHideDropDownsNew(d,b){var c=document.getElementsByTagName("select");
var a=$get("advancedSearch");for(i=0;i<c.length;i++){if(a&&(null==$get(c[i].id,a))){c[i].style.display=d}}}function setPopupDivPosition(c,a){if(true!=a){a=false}myWidth=0;if(typeof(window.innerHeight)=="number"){myWidth=window.innerWidth}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth
}}}myHeight=0;if(typeof(window.innerHeight)=="number"){myHeight=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myHeight=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myHeight=document.body.clientHeight}}}scrollX=0;if(!a){if(typeof(window.pageXOffset)=="number"){scrollY=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrollY=document.body.scrollLeft
}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrollY=document.documentElement.scrollLeft}}}}scrollY=0;if(!a){if(typeof(window.pageYOffset)=="number"){scrollY=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrollY=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrollY=document.documentElement.scrollTop
}}}}divElm=$get(c);var b=Sys.UI.DomElement.getBounds(divElm);if(0==b.width||0==b.height){addCssClass(divElm,"invis");addCssClass(divElm,"block");b=Sys.UI.DomElement.getBounds(divElm);removeCssClass(divElm,"block");removeCssClass(divElm,"invis")}if((((myHeight/2)-(b.height/2))+scrollY)>0){divElm.style.top=((myHeight/2)-(b.height/2))+scrollY+"px"}else{divElm.style.top="0px"}if((b.width/2)>0){divElm.style.left="50%";divElm.style.marginLeft="-"+(b.width/2)+"px"}}function toggleLayer(a){var b,c;if(document.getElementById){b=$get(a)
}else{if(document.all){b=document.all[a]}else{if(document.layers){b=document.layers[a]}}}c=b.style;if(c.display==""&&b.offsetWidth!=undefined&&b.offsetHeight!=undefined){c.display=(elemoffset.Width!=0&&b.offsetHeight!=0)?"block":"none"}c.display=(c.display==""||c.display=="block")?"none":"block"}function toggleDisabled(a){try{a.disabled=a.disabled?false:true}catch(b){}if(a.childNodes&&a.childNodes.length>0){for(var c=0;c<a.childNodes.length;c++){toggleDisabled(a.childNodes[c])}}}var hdrSearchLF=null;
function HeaderVehSearch(f,c,d,b,e){if(null==hdrSearchLF){hdrSearchLF=new LinkFactory()}hdrSearchLF._path=f;hdrSearchLF._qstring=c;if(ValidateZip(d)){HeaderVehSearchExec(d)}else{var a=b+" "+e;zipPromptVar.Open(a,HeaderVehSearchExec)}}function HeaderVehSearchExec(a){hdrSearchLF.ReplaceToken("xZIPx",a);fnNavToSearchResults(hdrSearchLF.FinalizeUrl())}function navigateTo(a){if($get("hiddenIE6")){SideBar_RedirectUrl=a;setTimeout("window.location.href = SideBar_RedirectUrl",0)}else{window.location.href=a
}return false}function fnNavToSearchResults(a){fnShowSearchingProgress();navigateTo(a)}function fnShowSearchingProgress(){var b=$get("divSearching");var a=Sys.UI.DomElement.getBounds(b.parentNode);var c=2;var d=a.y;Sys.UI.DomElement.setLocation(b,c,d);b.style.width="975px";b.style.height=a.height+"px";hideDropDownVarList();showDIV("divSearching");showDIV("searchingSmall");LoadSwf()}function fnHideSearchingProgress(){hideDIV("searchingSmall");hideDIV("divSearching");showDropDownVarList()}function openFooterLink(d,b,c,a,e){window.open(d,b,"width="+c+",height="+a+",resizable=yes,scrollbars="+e+",toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=100,top=100,screenX=100,screenY=100,modal=yes")
}function openRegister(b){var a=b;window.open(a,"Register","width=800,height=750,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=0,top=100,screenX=0,screenY=100,modal=yes")}function openPrint(b){var a=b;if((null==a)||(!a)){a=printUrl}window.open(a,"Print","width=730,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=0,top=100,screenX=0,screenY=100,modal=yes")}function openDirections(a){var b=a;
if((null==a)||(!a)){b=a}window.open(b,"Map","width=780,height=760,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=0,top=100,screenX=0,screenY=100,modal=yes")}function mapKeyToAction(c){var a;var d=false;var e=false;if(c&&c.charCode==13){e=true}else{if(window.event&&window.event.keyCode==13){c=window.event;e=true}}if(e){if(c.target){a=c.target}else{if(c.srcElement){a=c.srcElement}}if(a.nodeType==3){a=a.parentNode}var b=a.tagName.toUpperCase();
if(b=="TEXTAREA"){d=false}else{if(b=="SELECT"){if(("undefined"!=typeof(a.ddlMapEnter))&&a.ddlMapEnter){d=true}else{d=false}}else{d=true}}var f=getUserBrowser();if(f=="Chrome"||f=="Safari"){enterPress=true}}return d}function DDLMapEnter_OnChange(a){a.ddlMapEnter=false;setTimeout("$get('"+a.id+"').ddlMapEnter = true;",200)}function getUserBrowser(){return Sys.Browser.name}function setEnterPress(){var a=getUserBrowser();if(a=="Opera"){enterPress=true}}function setFixValidation(){var a=getUserBrowser();
if(a=="Firefox"||a=="Opera"){fixValidation=true}}function ReyLogout(a){Reynolds.CL.Web.WebServices.LoginFunctions.Logout(LogoutSuccess,LogoutFailure,a)}function LogoutSuccess(a,b){ReloadPage()}function ReloadPage(){try{if(typeof(Page_OnLogoutComplete)=="function"){Page_OnLogoutComplete()}else{var c=window.location.href.indexOf("#");var b=window.location.href.length;if(c>0){window.location.href=window.location.href.substr(0,c)}else{window.location=window.location}}}catch(a){}}function LogoutFailure(a){alert(a.get_message())
}function Master_RefreshLoginArea(){try{if(typeof(Page_OnLoginComplete)=="function"){Page_OnLoginComplete()}}catch(a){}$get(btnRefreshLoginAreaId).click()}function fnTrim(a){return String(a).replace(/^\s+/g,"").replace(/\s+$/g,"")}function PopulateMakes(c,f,d,e,a,b){$get(c).disabled=true;$get(f).disabled=true;var g=new Object();g.makeListId=c;g.modelListId=f;g.preserveSelections=b;if(b){g.makeListValue=$get(c).value;g.modelListValue=$get(f).value;g.includeNew=d;g.includeUsed=e;g.includeCert=a}$get(c).selectedIndex=0;
Reynolds.CL.Web.WebServices.VehicleFunctions.GetMakeDDList(WSKey,d,e,a,GetMakesSuccess,GetMakesFailure,g)}function PopulateMakesByCategory(a,f,c,b,g,h,e){$get(a).disabled=true;$get(f).disabled=true;var d=new Object();d.makeListId=a;d.modelListId=f;d.styleListId=e;d.preserveSelections=h;if(h){d.makeListValue=$get(a).value;d.modelListValue=$get(f).value;d.includeNew=c;d.includeUsed=b;d.includeCert=g;d.styleListValue=$get(e).value}$get(a).selectedIndex=0;Reynolds.CL.Web.WebServices.VehicleFunctions.GetMakeByCategoryDDList(WSKey,c,b,g,$get(e).value,GetMakesByCategorySuccess,GetMakesFailure,d)
}function GetMakesSuccess(b,a){SetDDLInnerHtml(a.makeListId,b);$get(a.makeListId).disabled=false;$get(a.modelListId).disabled=false;if(a.preserveSelections){fnSetDDLByValue(a.makeListId,a.makeListValue);PopulateModels(a.makeListId,a.modelListId,a.includeNew,a.includeUsed,a.includeCert,true)}}function GetMakesFailure(b,a){alert(b.get_message());$get(a.makeListId).innerHTML="";$get(a.makeListId).disabled=false;$get(a.modelListId).innerHTML="";$get(a.modelListId).disabled=false}function GetMakesByCategorySuccess(b,a){SetDDLInnerHtml(a.makeListId,b);
$get(a.makeListId).disabled=false;$get(a.modelListId).disabled=true;fnSetDDLByValue(a.makeListId,a.makeListValue);PopulateModelsByCategory(a.makeListId,a.modelListId,a.includeNew,a.includeUsed,a.includeCert,true,a.styleListId)}function PopulateModels(c,f,d,e,a,b){var g=new Object();g.modelListId=f;g.preserveSelections=b;if(b){g.modelListValue=$get(f).value}$get(f).disabled=true;if((0<$get(c).value.length)&&(0<$get(c).value)){Reynolds.CL.Web.WebServices.VehicleFunctions.GetModelDDList($get(c).value,WSKey,d,e,a,GetModelsSuccess,GetModelsFailure,g)
}else{SetDDLInnerHtml(f,"")}}function PopulateModelsByCategory(a,f,c,b,g,h,e){var d=new Object();d.modelListId=f;d.preserveSelections=h;if(h){d.modelListValue=$get(f).value}$get(f).selectedIndex=0;$get(f).disabled=true;if(0<$get(a).value.length&&0<$get(a).value){Reynolds.CL.Web.WebServices.VehicleFunctions.GetModelByCategoryDDList($get(a).value,WSKey,c,b,g,$get(e).value,GetModelsSuccess,GetModelsFailure,d)}else{SetDDLInnerHtml(f,"")}}function GetModelsSuccess(b,a){SetDDLInnerHtml(a.modelListId,b);
$get(a.modelListId).disabled=false;if(a.preserveSelections){fnSetDDLByValue(a.modelListId,a.modelListValue)}}function GetModelsFailure(b,a){alert(b.get_message());$get(a.modelListId).innerHTML="";$get(a.modelListId).disabled=false}function addUnderline(a){addCssClass($get(a),"underline")}function removeUnderline(a){removeCssClass($get(a),"underline")};
