var QU={};var DD={};QU.cache={};DD.MakesModels=function(a,b,h,c,f,k,j,g,d,i){this.mki=isNaN(a)||a===0?999:parseInt(a,10);this.mdi=isNaN(b)||b===0||this.mki===999?999:parseInt(b,10);this.year=parseInt(h,10);this.mks=Com.$(c);this.mds=Com.$(f);this.tgl=k;this.tgl_label=(j?j:"");var e=this;if(g!==undefined){this.mkshtml=DD.buildHTML("select",g)+">"}else{this.mkshtml=this.mks.innerHTML;this.mkshtml=this.mkshtml.substr(this.mkshtml.indexOf("<select"),this.mkshtml.indexOf(">")+1)}this.mkshtml+='<option value="999">Select a Make</option>';if(d!==undefined){this.mdshtml=DD.buildHTML("select",d)+">"}else{this.mdshtml=this.mds.innerHTML;this.mdshtml=this.mdshtml.substr(this.mdshtml.indexOf("<select"),this.mdshtml.indexOf(">")+1)}this.mdshtml+='<option value="999">Select a Model</option>';if(i!==undefined){this.tglhtml=DD.buildHTML('input type="radio"',i)}else{this.tglhtml='<input type="radio" id="2f_year" name="2f_year" onclick="this.checked=true;Local.yearToggle(this.value);"'}this.getMakes=function(){if(QU.cache.makes){this.fillMakes(null);return}if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(e)}var l={method:"post",parameters:"",onSuccess:e.fillMakes,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)};this.fillMakes=function(o){var m,l=e.mkshtml,n=QU.cache.makes?QU.cache:Com.evalJSON(o.responseText);if(n.makes===undefined){return}for(m=0;m<n.makes.length;m+=1){l+='<option value="'+n.makes[m].make_id+'"'+(parseInt(n.makes[m].make_id,10)===parseInt(e.mki,10)?' selected="selected"':"")+">"+n.makes[m].make_name+(typeof Landing!=="undefined"&&Landing.promo_makes!==undefined&&QU.in_array(n.makes[m].make_id,Landing.promo_makes)?" *":"")+"</option>"}e.mks.innerHTML=l+"</select>";e.getModels()};this.getModels=function(){e.clearToggle();if(e.mki===999){e.mdi=999;e.mds.innerHTML=e.mdshtml+"</select>";if(Local!==undefined&&typeof Local.turnON==="function"){Local.turnON(e)}}else{if(QU.cache[e.mki]){this.fillModels(null);return}else{if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(e)}var l={method:"post",parameters:"make_id="+e.mki,onSuccess:e.fillModels,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)}}};this.fillModels=function(o){var m,l=e.mdshtml,n=QU.cache[e.mki]?QU.cache[e.mki]:Com.evalJSON(o.responseText);if(n.models===undefined){return}for(m=0;m<n.models.length;m+=1){l+='<option value="'+n.models[m].model_id+'"'+(parseInt(n.models[m].model_id,10)===parseInt(e.mdi,10)?' selected="selected"':"")+">"+n.models[m].model_name+(typeof Landing!=="undefined"&&Landing.promo_models!==undefined&&QU.in_array(n.models[m].model_id,Landing.promo_models)?" *":"")+"</option>"}e.mds.innerHTML=l+"</select>";if(parseInt(e.mdi,10)!==999){e.getModelYears()}if(Local!==undefined&&typeof Local.turnON==="function"){Local.turnON(e)}};this.getModelYears=function(){if(typeof QU.cache.model_years!=="undefined"){this.showToggle(null);return}var l={method:"post",parameters:"model_years="+e.mdi,onSuccess:e.showToggle,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)};this.showToggle=function(o){var m,l="",n=typeof QU.cache.model_years!=="undefined"?QU.cache.model_years[e.mdi]:Com.evalJSON(o.responseText);if(n.years===undefined){return}e.clearToggle();if(e.year===0){e.year=e.defaultYear(n.years)}if(n.years.length===1){e.year=parseInt(n.years[0],10);l=e.tglhtml+' value="'+e.year+'" style="display:none" />'}else{if(n.years.length>1){Com.$(e.tgl+"_").innerHTML=e.tgl_label;for(m=0;m<n.years.length;m+=1){l+="&nbsp; "+e.tglhtml+' value="'+n.years[m]+'"'+(parseInt(n.years[m],10)===parseInt(e.year,10)?' checked="checked"':"")+"/> "+n.years[m]+(typeof Landing!=="undefined"&&Landing.promo_years!==undefined&&Landing.promo_models!==undefined&&QU.in_array(DD.MakesModels.mdi,Landing.promo_models)&&QU.in_array(n.years[m],Landing.promo_years)?"* ":"")}}}Com.$(e.tgl).innerHTML=l};this.clearToggle=function(){Com.$(e.tgl).innerHTML="";Com.$(e.tgl+"_").innerHTML=""};this.resetMakeModels=function(n,o){var l,m;if(parseInt(e.mki,10)===parseInt(n,10)){e.mdi=o;m=DD.getSelect(e.mds);for(l=0;l<m.options.length;l+=1){if(parseInt(m.options[l].value,10)===parseInt(o,10)){m.options[l].selected=true}}}else{e.mki=n;e.mdi=o;m=DD.getSelect(e.mks);for(l=0;l<m.options.length;l+=1){if(parseInt(m.options[l].value,10)===parseInt(n,10)){m.options[l].selected=true}}e.getModels()}};this.defaultYear=function(l){return l[0]}};DD.StylesColors=function(b,h,c,a,f,d,j,i,e){this.mdi=parseInt(b,10);this.year=parseInt(h,10);this.sti=parseInt(c,10);this.clr=this.sti===0?0:a;this.inc=j;this.sts=Com.$(f);this.cls=Com.$(d);var g=this;if(i!==undefined){this.stshtml=DD.buildHTML("select",i)+">"}else{this.stshtml=this.sts.innerHTML;this.stshtml=this.stshtml.substr(this.stshtml.indexOf("<select"),this.stshtml.indexOf(">")+1)}if(this.sti===0){this.stshtml+='<option value="0">Select Style</option>'}if(e!==undefined){this.clshtml=DD.buildHTML("select",e)+">"}else{this.clshtml=this.cls.innerHTML;this.clshtml=this.clshtml.substr(this.clshtml.indexOf("<select"),this.clshtml.indexOf(">")+1)}if(this.clr===0){this.clshtml+='<option value="0">Select Colors</option>'}this.clshtml+='<option value="No Preferences|No Preferences">Undecided</option>';this.getStyles=function(){if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(g)}var k={method:"post",parameters:"model_id="+g.mdi+"&year="+g.year,onSuccess:g.fillStyles,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",k,g)};this.fillStyles=function(n){var l,k=g.stshtml,m=Com.evalJSON(n.responseText);if(m.trims===undefined){return}for(l=0;l<m.trims.length;l+=1){k+='<option value="'+m.trims[l].style_id+'"'+(parseInt(m.trims[l].style_id,10)===parseInt(g.sti,10)?' selected="selected"':"")+">"+m.trims[l].style+"</option>"}k+="</select>";if(m.trims.length===1){g.sti=m.trims[0].style_id;g.clr="No Preferences|No Preferences";k=m.trims[0].style+'<span style="display:none">'+k+"</span>"}g.sts.innerHTML=k;g.getColors();if(m.trims.length>1){DD.fixIeDropDown(DD.getSelect(g.sts))}};this.getColors=function(){if(parseInt(g.sti,10)===0){g.resetColors();if(Local!==undefined&&Local.turnON==="function"){Local.turnON(g)}}else{if(typeof Local!=="undefined"&&typeof Local.turnOFF==="function"){Local.turnOFF(g)}var k={method:"post",parameters:"style_id="+g.sti,onSuccess:g.fillColors,onFailure:QU.fracaso};if(g.inc&&parseInt(mvc.zipcode.value,10)){k.parameters+="&zip="+mvc.zipcode.value}QU.ajaxRequest("/ajax/makes_models.php",k,g)}};this.fillColors=function(n){var l,k=g.clshtml,m=Com.evalJSON(n.responseText);if(typeof m.colors==="undefined"){return}if(parseInt(g.sti,10)===0){g.clr=0}else{if(m.colors.length&&parseInt(g.clr,10)===0){g.clr="No Preferences|No Preferences"}}for(l=0;l<m.colors.length;l+=1){k+='<option value="'+m.colors[l].exterior+"|"+m.colors[l].interior+'"'+(m.colors[l].exterior+"|"+m.colors[l].interior===g.clr?' selected="selected"':"")+">Exterior: "+m.colors[l].exterior+" - Interior: "+m.colors[l].interior+"</option>"}k+="</select>";if(m.colors.length===0){g.clr="N/A|N/A";k='No detailed colors available.<span style="display:none">'+k+"</span>"}g.cls.innerHTML=k;if(m.colors.length>1&&Com.isIE()){DD.fixIeDropDown(DD.getSelect(g.cls))}if(typeof Local!=="undefined"){if(typeof Local.showVehicleData==="function"){Local.showVehicleData(m,g)}if(typeof Local.turnON==="function"){Local.turnON(g)}}};this.resetColors=function(){g.cls.innerHTML=g.clshtml+"</select>";g.clr=0}};DD.buildHTML=function(c,b){var d,e;e="<"+c;for(d in b){if(b.hasOwnProperty(d)){e+=" "+d+'="'+b[d]+'"'}}return e};DD.getSelect=function(b){for(var a=0;a<b.childNodes.length;a+=1){if(b.childNodes[a].type==="select-one"){return b.childNodes[a]}}return false};DD.fixIeDropDown=function(c){c=(typeof c==="string")?Com.$(c):c;if(!c.attachEvent||c.multiple||c.currentStyle.width==="auto"){return}var a,e,b,d;a=document.getElementsByTagName("body").item(0);e=c.cloneNode(true);e.style.position="absolute";e.style.visibility="hidden";e.style.width="auto";a.appendChild(e);c.initialOffsetWidth=c.offsetWidth;c.initialOffsetHeight=c.offsetHeight;c.autoWidth=e.offsetWidth;a.removeChild(e);c.style.position="absolute";c.style.width=c.initialOffsetWidth+"px";c.parentNode.style.width=c.initialOffsetWidth+"px";c.parentNode.style.height=c.initialOffsetHeight+"px";if(c.autoWidth>c.initialOffsetWidth){b=function(){event.srcElement.parentNode.style.zIndex=1;event.srcElement.style.width="auto";if(event.srcElement.offsetWidth>event.srcElement.initialOffsetWidth){event.srcElement.style.width="auto"}else{event.srcElement.style.width=event.srcElement.initialOffsetWidth+"px"}};d=function(){event.srcElement.parentNode.style.zIndex=0;event.srcElement.style.width=event.srcElement.initialOffsetWidth+"px"};c.attachEvent("onactivate",b);c.attachEvent("ondeactivate",d);c.attachEvent("onchange",d)}};QU.checkZip=function(a){return(/^[0-9]{5}$/.test(a))};QU.checkPhone=function(a){return(/^(\d){3}[\s.\-]?(\d){3}[\s.\-]?(\d){4}$/.test(a))};QU.checkEmail=function(a){return(/^([a-zA-Z0-9._%+\-]+)@([a-zA-Z0-9.\-]+)\.([a-zA-Z]{2,6})$/.test(a))};QU.checkAddress=function(a){return a.length};QU.checkName=function(a){return(/^[A-Za-z]+[A-Za-z \.\'\-]+$/.test(a))};QU.ajaxCheckZip=function(c,a){var b={method:"post",parameters:"zip="+c,onSuccess:a,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/validate.php",b,null)};QU.keyEnter=function(a){return((window.event&&a.keyCode===13)||(a&&a.which===13))};QU.check=function(a){mvc.zipcode.value=Com.trim(a);if(parseInt(dropdowns.mki,10)===999||parseInt(dropdowns.mdi,10)===999){alert("Please select Make & Model");return false}else{if(QU.checkZip(mvc.zipcode.value)){QU.ajaxCheckZip(mvc.zipcode.value,QU.toForm);return false}else{alert("Please enter a valid U.S. ZIP code to continue.");return false}}};QU.toForm=function(a){if(!Com.evalJSON(a.responseText)){alert("Please enter a valid U.S. ZIP code to continue.")}else{mvc.make_id.value=dropdowns.mki;mvc.model_id.value=dropdowns.mdi;mvc.year.value=dropdowns.year;Local.turnOFF(dropdowns);mvc.submit()}};QU.imageCall=function(a){Com.$("omniture_event").innerHTML='<img src="'+a+'" />'};QU.in_array=function(c,b){for(var a=0;a<b.length;a+=1){if(b[a]===c){return true}}return false};QU.MMpreload=function(){var a={method:"post",parameters:"cache=1",onSuccess:QU.MMcache,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",a,null)};QU.MMcache=function(a){QU.cache=Com.evalJSON(a.responseText);if(typeof Local.DDinit==="function"){Local.DDinit()}};QU.ajaxRequest=function(b,d,c){var a=new Com.Ajax.Request(b,d,c)};QU.fracaso=function(){};QU.getMousePosition=function(c){var b,a;if(document.documentElement){b=c.clientX+document.documentElement.scrollLeft;a=c.clientY+document.documentElement.scrollTop}else{b=c.pageX;a=c.pageY}if(b<0){b=0}if(a<0){a=0}return{x:b,y:a}};QU.getElementDimensions=function(c){var a=0,b=0;if(c===undefined){if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientWidth;b=document.body.clientHeight}}}}else{a=c.offsetWidth;b=c.offsetHeight}return{w:a,h:b}};QU.popUp=function(c,a){var d,b=this;this.closeOnClickOut=(a!==undefined&&a.closeOnClickOut)?a.closeOnClickOut:0;this.omniture=(a!==undefined&&a.omniture)?a.omniture:0;this.getcoords=function(j){var g=QU.getMousePosition(j),m=Com.getElementPosition(b.dlg),i=QU.getElementDimensions(b.dlg),h=m.x,l=h+i.h,k=m.y,f=k+i.h;if(g.x>l||g.x<h||g.y>f||g.y<k){b.close()}return this};this.screenCenter=function(){if(this.dlg&&!this.movedtobody){document.body.appendChild(this.dlg);this.movedtobody=true}var h,f=QU.getElementDimensions(b.dlg),e=QU.getElementDimensions(),g=Com.getScrollXY();b.dlg.style.left=parseInt(g.left+(e.w-f.w)/2,10)+"px";b.dlg.style.top=((e.h-f.h>0)?parseInt(g.top+(e.h-f.h)/2,10):g.top)+"px";return this};if(!this.dlg){this.dlg=Com.$(c);this.dlg.style.position="absolute";this.dlg.style.zIndex=999999;if(this.closeOnClickOut){Com.addEvent(document,"click",this.getcoords)}if(this.dlg&&!Boolean(this.shim)&&Com.isIE6()){d="ie_shim_hack_"+Date.parse(new Date());this.shim=document.createElement("iframe");this.shim.id=d;this.shim.name=d;this.shim.frameBorder="0";this.shim.fid=d;this.shim.style.cssText="width:100% !important;height:102% !important;position:absolute;top:0;left:-3px;z-index:-1;padding: 5px !important";this.shim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";this.dlg.appendChild(this.shim);this.shim=Com.$(d);this.shim.style.height=QU.getElementDimensions(this.dlg).h+"px"}}this.open=function(){b.dlg.style.display="block";b.dlg.style.visibility="visible";b.screenCenter();if(b.shim){b.shim.style.height=QU.getElementDimensions(b.dlg).h+"px"}if(b.omniture){s_clven.linkTrackVars="events";s_clven.events=b.omniture;s_clven.t()}return this};this.close=function(){b.dlg.style.display="none";if(b.closeOnClickOut){Com.stopEvent(document,"click",b.getcoords)}return this}};var QU={};var DD={};QU.cache={};DD.MakesModels=function(a,b,h,c,f,k,j,g,d,i){this.mki=isNaN(a)||a===0?999:parseInt(a,10);this.mdi=isNaN(b)||b===0||this.mki===999?999:parseInt(b,10);this.year=parseInt(h,10);this.mks=c;this.mds=f;this.tgl=k;this.tgl_label=(j?j:"");this.mksattr=g;this.mdsattr=d;this.tglattr=i;var e=this;if(g!==undefined){this.mkshtml=DD.buildHTML("select",g)+">"}else{this.mkshtml=Com.$(c).innerHTML;this.mkshtml=this.mkshtml.substr(this.mkshtml.indexOf("<select"),this.mkshtml.indexOf(">")+1)}this.mkshtml+='<option value="999">Select a Make</option>';if(d!==undefined){this.mdshtml=DD.buildHTML("select",d)+">"}else{this.mdshtml=Com.$(f).innerHTML;this.mdshtml=this.mdshtml.substr(this.mdshtml.indexOf("<select"),this.mdshtml.indexOf(">")+1)}this.mdshtml+='<option value="999">Select a Model</option>';if(i!==undefined){this.tglhtml=DD.buildHTML('input type="radio"',i)}else{this.tglhtml='<input type="radio" id="2f_year" name="2f_year" onclick="this.checked=true;Local.yearToggle(this.value);"'}this.getMakes=function(){if(QU.cache.makes){this.fillMakes(null);return}if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(e)}var l={method:"post",parameters:"",onSuccess:e.fillMakes,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)};this.fillMakes=function(o){var m,l=e.mkshtml,n=QU.cache.makes?QU.cache:Com.evalJSON(o.responseText);if(n.makes===undefined){return}for(m=0;m<n.makes.length;m+=1){l+='<option value="'+n.makes[m].make_id+'"'+(parseInt(n.makes[m].make_id,10)===parseInt(e.mki,10)?' selected="selected"':"")+">"+n.makes[m].make_name+(typeof Landing!=="undefined"&&Landing.promo_makes!==undefined&&QU.in_array(n.makes[m].make_id,Landing.promo_makes)?" *":"")+"</option>"}Com.$(e.mks).innerHTML=l+"</select>";e.getModels()};this.getModels=function(){e.clearToggle();if(e.mki===999){e.mdi=999;Com.$(e.mds).innerHTML=e.mdshtml+"</select>";if(Local!==undefined&&typeof Local.turnON==="function"){Local.turnON(e)}}else{if(QU.cache[e.mki]){this.fillModels(null);return}else{if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(e)}var l={method:"post",parameters:"make_id="+e.mki,onSuccess:e.fillModels,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)}}};this.fillModels=function(o){var m,l=e.mdshtml,n=QU.cache[e.mki]?QU.cache[e.mki]:Com.evalJSON(o.responseText);if(n.models===undefined){return}for(m=0;m<n.models.length;m+=1){l+='<option value="'+n.models[m].model_id+'"'+(parseInt(n.models[m].model_id,10)===parseInt(e.mdi,10)?' selected="selected"':"")+">"+n.models[m].model_name+(typeof Landing!=="undefined"&&Landing.promo_models!==undefined&&QU.in_array(n.models[m].model_id,Landing.promo_models)?" *":"")+"</option>"}Com.$(e.mds).innerHTML=l+"</select>";if(parseInt(e.mdi,10)!==999){e.getModelYears()}if(Local!==undefined&&typeof Local.turnON==="function"){Local.turnON(e)}};this.getModelYears=function(){if(typeof QU.cache.model_years!=="undefined"){this.showToggle(null);return}var l={method:"post",parameters:"model_years="+e.mdi,onSuccess:e.showToggle,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",l,e)};this.showToggle=function(o){var m,l="",n=typeof QU.cache.model_years!=="undefined"?QU.cache.model_years[e.mdi]:Com.evalJSON(o.responseText);if(n.years===undefined){return}e.clearToggle();if(e.year===0){e.year=e.defaultYear(n.years)}if(n.years.length===1){e.year=parseInt(n.years[0],10);l=e.tglhtml+' value="'+e.year+'" style="display:none" />'}else{if(n.years.length>1){Com.$(e.tgl+"_").innerHTML=e.tgl_label;for(m=0;m<n.years.length;m+=1){l+="&nbsp; "+e.tglhtml+' value="'+n.years[m]+'"'+(parseInt(n.years[m],10)===parseInt(e.year,10)?' checked="checked"':"")+"/> "+n.years[m]+(typeof Landing!=="undefined"&&Landing.promo_years!==undefined&&Landing.promo_models!==undefined&&QU.in_array(DD.MakesModels.mdi,Landing.promo_models)&&QU.in_array(n.years[m],Landing.promo_years)?"* ":"")}}}Com.$(e.tgl).innerHTML=l};this.clearToggle=function(){Com.$(e.tgl).innerHTML="";Com.$(e.tgl+"_").innerHTML=""};this.resetMakeModels=function(n,o){var l,m;if(parseInt(e.mki,10)===parseInt(n,10)){e.mdi=o;m=DD.getSelect(Com.$(e.mds));for(l=0;l<m.options.length;l+=1){if(parseInt(m.options[l].value,10)===parseInt(o,10)){m.options[l].selected=true}}}else{e.mki=n;e.mdi=o;m=DD.getSelect(Com.$(e.mks));for(l=0;l<m.options.length;l+=1){if(parseInt(m.options[l].value,10)===parseInt(n,10)){m.options[l].selected=true}}e.getModels()}};this.defaultYear=function(l){return l[0]}};DD.StylesColors=function(b,h,c,a,f,d,j,i,e){this.mdi=parseInt(b,10);this.year=parseInt(h,10);this.sti=parseInt(c,10);this.clr=this.sti===0?0:a;this.inc=j;this.sts=f;this.cls=d;this.stsattr=i;this.clsattr=e;var g=this;if(i!==undefined){this.stshtml=DD.buildHTML("select",i)+">"}else{this.stshtml=Com.$(f).innerHTML;this.stshtml=this.stshtml.substr(this.stshtml.indexOf("<select"),this.stshtml.indexOf(">")+1)}if(this.sti===0){this.stshtml+='<option value="0">Select Style</option>'}if(e!==undefined){this.clshtml=DD.buildHTML("select",e)+">"}else{this.clshtml=Com.$(d).innerHTML;this.clshtml=this.clshtml.substr(this.clshtml.indexOf("<select"),this.clshtml.indexOf(">")+1)}if(this.clr===0){this.clshtml+='<option value="0">Select Colors</option>'}this.clshtml+='<option value="No Preferences|No Preferences">Undecided</option>';this.getStyles=function(){if(Local!==undefined&&typeof Local.turnOFF==="function"){Local.turnOFF(g)}var k={method:"post",parameters:"model_id="+g.mdi+"&year="+g.year,onSuccess:g.fillStyles,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",k,g)};this.fillStyles=function(n){var l,k=g.stshtml,m=Com.evalJSON(n.responseText);if(m.trims===undefined){return}for(l=0;l<m.trims.length;l+=1){k+='<option value="'+m.trims[l].style_id+'"'+(parseInt(m.trims[l].style_id,10)===parseInt(g.sti,10)?' selected="selected"':"")+">"+m.trims[l].style+"</option>"}k+="</select>";if(m.trims.length===1){g.sti=m.trims[0].style_id;g.clr="No Preferences|No Preferences";k=m.trims[0].style+'<span style="display:none">'+k+"</span>"}Com.$(g.sts).innerHTML=k;g.getColors();if(m.trims.length>1){DD.fixIeDropDown(DD.getSelect(Com.$(g.sts)))}};this.getColors=function(){if(parseInt(g.sti,10)===0){g.resetColors();if(Local!==undefined&&Local.turnON==="function"){Local.turnON(g)}}else{if(typeof Local!=="undefined"&&typeof Local.turnOFF==="function"){Local.turnOFF(g)}var k={method:"post",parameters:"style_id="+g.sti,onSuccess:g.fillColors,onFailure:QU.fracaso};if(g.inc&&parseInt(mvc.zipcode.value,10)){k.parameters+="&zip="+mvc.zipcode.value}QU.ajaxRequest("/ajax/makes_models.php",k,g)}};this.fillColors=function(n){var l,k=g.clshtml,m=Com.evalJSON(n.responseText);if(typeof m.colors==="undefined"){return}if(parseInt(g.sti,10)===0){g.clr=0}else{if(m.colors.length&&parseInt(g.clr,10)===0){g.clr="No Preferences|No Preferences"}}for(l=0;l<m.colors.length;l+=1){k+='<option value="'+m.colors[l].exterior+"|"+m.colors[l].interior+'"'+(m.colors[l].exterior+"|"+m.colors[l].interior===g.clr?' selected="selected"':"")+">Exterior: "+m.colors[l].exterior+" - Interior: "+m.colors[l].interior+"</option>"}k+="</select>";if(m.colors.length===0){g.clr="N/A|N/A";k='No detailed colors available.<span style="display:none">'+k+"</span>"}Com.$(g.cls).innerHTML=k;if(m.colors.length>1){DD.fixIeDropDown(DD.getSelect(Com.$(g.cls)))}if(typeof Local!=="undefined"){if(typeof Local.showVehicleData==="function"){Local.showVehicleData(m,g)}if(typeof Local.turnON==="function"){Local.turnON(g)}}};this.resetColors=function(){Com.$(g.cls).innerHTML=g.clshtml+"</select>";g.clr=0}};DD.buildHTML=function(c,b){var d,e;e="<"+c;for(d in b){if(b.hasOwnProperty(d)){e+=" "+d+'="'+b[d]+'"'}}return e};DD.getSelect=function(b){for(var a=0;a<b.childNodes.length;a+=1){if(b.childNodes[a].type==="select-one"){return b.childNodes[a]}}return false};DD.fixIeDropDown=function(c){c=(typeof c==="string")?Com.$(c):c;if(!c.attachEvent||c.multiple||c.currentStyle.width==="auto"){return}var a,e,b,d;a=document.getElementsByTagName("body").item(0);e=c.cloneNode(true);e.style.position="absolute";e.style.visibility="hidden";e.style.width="auto";a.appendChild(e);c.initialOffsetWidth=c.offsetWidth;c.initialOffsetHeight=c.offsetHeight;c.autoWidth=e.offsetWidth;a.removeChild(e);c.style.position="absolute";c.style.width=c.initialOffsetWidth+"px";c.parentNode.style.width=c.initialOffsetWidth+"px";c.parentNode.style.height=c.initialOffsetHeight+"px";if(c.autoWidth>c.initialOffsetWidth){b=function(){event.srcElement.parentNode.style.zIndex=1;event.srcElement.style.width="auto";if(event.srcElement.offsetWidth>event.srcElement.initialOffsetWidth){event.srcElement.style.width="auto"}else{event.srcElement.style.width=event.srcElement.initialOffsetWidth+"px"}};d=function(){event.srcElement.parentNode.style.zIndex=0;event.srcElement.style.width=event.srcElement.initialOffsetWidth+"px"};c.attachEvent("onactivate",b);c.attachEvent("ondeactivate",d);c.attachEvent("onchange",d)}};QU.checkZip=function(a){return(/^[0-9]{5}$/.test(a))};QU.checkPhone=function(a){return(/^(\d){3}[\s.-]?(\d){3}[\s.-]?(\d){4}$/.test(a))};QU.checkEmail=function(a){return(/^([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+)\.([a-zA-Z]{2,6})$/.test(a))};QU.checkAddress=function(a){return a.length};QU.checkName=function(a){return(/^[A-Za-z]+[A-Za-z \.\'\-]+$/.test(a))};QU.ajaxCheckZip=function(c,a){var b={method:"post",parameters:"zip="+c,onSuccess:a,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/validate.php",b,null)};QU.keyEnter=function(a){return((window.event&&a.keyCode===13)||(a&&a.which===13))};QU.check=function(a){mvc.zipcode.value=Com.trim(a);if(parseInt(dropdowns.mki,10)===999||parseInt(dropdowns.mdi,10)===999){alert("Please select Make & Model");return false}else{if(QU.checkZip(mvc.zipcode.value)){QU.ajaxCheckZip(mvc.zipcode.value,QU.toForm);return false}else{alert("Please enter a valid U.S. ZIP code to continue.");return false}}};QU.toForm=function(a){if(!Com.evalJSON(a.responseText)){alert("Please enter a valid U.S. ZIP code to continue.")}else{mvc.make_id.value=dropdowns.mki;mvc.model_id.value=dropdowns.mdi;mvc.year.value=dropdowns.year;Local.turnOFF(dropdowns);mvc.submit()}};QU.imageCall=function(a){Com.$("omniture_event").innerHTML='<img src="'+a+'" />'};QU.in_array=function(c,b){for(var a=0;a<b.length;a+=1){if(b[a]===c){return true}}return false};QU.MMpreload=function(){var a={method:"post",parameters:"cache=1",onSuccess:QU.MMcache,onFailure:QU.fracaso};QU.ajaxRequest("/ajax/makes_models.php",a,null)};QU.MMcache=function(a){QU.cache=Com.evalJSON(a.responseText);if(typeof Local.DDinit==="function"){Local.DDinit()}};QU.ajaxRequest=function(b,d,c){var a=new Com.Ajax.Request(b,d,c)};QU.fracaso=function(){};QU.getMousePosition=function(c){var b,a;if(document.documentElement){b=c.clientX+document.documentElement.scrollLeft;a=c.clientY+document.documentElement.scrollTop}else{b=c.pageX;a=c.pageY}if(b<0){b=0}if(a<0){a=0}return{x:b,y:a}};QU.getElementPosition=function(d){var b=0,a=0,c;if(d.offsetParent){b=d.offsetLeft;a=d.offsetTop;while(d.offsetParent){c=d.offsetParent;b+=c.offsetLeft;a+=c.offsetTop;d=c}}return{x:b,y:a}};QU.getElementDimensions=function(c){var a=0,b=0;if(c===undefined){if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){a=document.body.clientWidth;b=document.body.clientHeight}}}}else{a=c.offsetWidth;b=c.offsetHeight}return{w:a,h:b}};QU.popUp=function(c,a){var d,b=this;this.closeOnClickOut=(a!==undefined&&a.closeOnClickOut)?a.closeOnClickOut:0;this.omniture=(a!==undefined&&a.omniture)?a.omniture:0;this.dim_effect=(a!==undefined&&a.dim_effect)?a.dim_effect:0;this.getcoords=function(j){var g=QU.getMousePosition(j),m=QU.getElementPosition(b.dlg),i=QU.getElementDimensions(b.dlg),h=m.x,l=h+i.h,k=m.y,f=k+i.h;if(g.x>l||g.x<h||g.y>f||g.y<k){b.close()}return this};this.screenCenter=function(){var h,f=QU.getElementDimensions(b.dlg),e=QU.getElementDimensions(),g=Com.getScrollXY();b.dlg.style.left=(g.left+(e.w-f.w)/2)+"px";b.dlg.style.top=(g.top+(e.h-f.h)/2)+"px";return this};if(!this.dlg){this.dlg=Com.$(c);this.dlg.style.position="absolute";this.dlg.style.zIndex=999999;if(this.closeOnClickOut){Com.addEvent(document,"click",this.getcoords)}if(this.dim_effect){if(Com.isIE6()){container_style="display: none;background: black none;filter:alpha(opacity=40);position: absolute; left: "+0+"px; top: "+0+"px; width: "+document.body.offsetWidth+"px; height: "+document.body.offsetHeight+"px; "}else{container_style="display: none;background: transparent url(/images/transparent.png);width: 100%; height: 100%; position: fixed; left: 0;top: 0"}this.container=document.getElementById("darkenScreenObject");if(!this.container){this.container=document.createElement("div");Com.setElementStyle(this.container,container_style);document.body.appendChild(this.container)}else{Com.setElementStyle(this.container,container_style)}}if(this.dlg&&!Boolean(this.shim)&&Com.isIE6()){d="ie_shim_hack_"+Date.parse(new Date());this.shim=document.createElement("iframe");this.shim.id=d;this.shim.name=d;this.shim.frameBorder="0";this.shim.fid=d;this.shim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";this.shim.style.zIndex=-1;this.shim.style.position="absolute";this.shim.style.top=0;this.shim.style.left=0;this.shim.style.width="100%";this.shim.style.height="100%";this.dlg.appendChild(this.shim)}}this.open=function(){if(b.container){b.container.style.display="block";b.container.style.visibility="visible"}b.dlg.style.display="block";b.dlg.style.visibility="visible";b.screenCenter();if(b.shim){b.shim.style.height=QU.getElementDimensions(b.dlg).h+"px"}if(b.omniture){QU.omnitureTrack(b.omniture,"o")}return this};this.close=function(){b.dlg.style.display="none";if(b.container){b.container.style.display="none"}if(b.closeOnClickOut){Com.stopEvent(document,"click",b.getcoords)}return this}};QU.omnitureTrack=function(a,c,b){if(typeof(a)==="undefined"){return}c=c?c:"o";s_clven.events=a;s_clven.linkTrackVars="events";s_clven.linkTrackEvents=a;s_clven.tl(true,c)};