if(typeof QU==="undefined"){var QU={}}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,d){var b={method:"post",parameters:"zip="+c,onSuccess:a,onFailure:QU.fracaso};if(typeof d!=="undefined"&&d===true){b.parameters+="&fetchCityandState=true"}QU.ajaxRequest("/ajax/validateZIP.php",b,null)};QU.keyEnter=function(a){return((window.event&&a.keyCode===13)||(a&&a.which===13))};QU.check=function(a,b){mvc.make_id.value=a.mki;mvc.model_id.value=a.mdi;mvc.year.value=a.year;if(a.mki===999||a.mdi===999){alert("Please select Make & Model");return false}if(QU.checkZip(mvc.zipcode.value)){QU.ajaxCheckZip(mvc.zipcode.value,b);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).valid){alert("Please enter a valid U.S. ZIP code to continue.");return false}else{Local.turnOFF();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.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 e,b=this,d;this.alwaysCentered=0;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(g){var l,j=QU.getElementDimensions(g),f=QU.getElementDimensions(),k=Com.getScrollXY(),i=k.left+(f.w-j.w)/2,h=k.top+(f.h-j.h)/2;i=i<0?0:i;h=h<0?0:h;g.style.left=i+"px";g.style.top=h+"px";return this};this.open=function(){if(b.container){b.container.style.display="block";b.container.style.visibility="visible"}this.dlg.style.display="block";this.dlg.style.visibility="visible";this.screenCenter(b.dlg);if(b.shim){b.shim.style.height=QU.getElementDimensions(b.dlg).h+"px"}if(b.omniture){if(typeof(b.omniture)==="string"){TRACK.OM.dataTracker({events:b.omniture})}else{if(typeof(b.omniture)==="object"){TRACK.OM.dataTracker(b.omniture)}}}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};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()){d="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; display: none;"}else{d="background: transparent url(http://images.newcars.com/images/cfc/transparent.png);width: 100%; height: 100%; position: fixed; left: 0;top: 0;display: none;z-index: 9999;"}this.container=document.createElement("div");Com.setElementStyle(this.container,d);document.body.appendChild(this.container)}if(this.dlg&&!Boolean(this.shim)&&Com.isIE6()){e="ie_shim_hack_"+Date.parse(new Date());this.shim=document.createElement("iframe");this.shim.id=e;this.shim.name=e;this.shim.frameBorder="0";this.shim.fid=e;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)}}return this};QU.setCookie=function(b,e,c){var a=new Date(),d="";if(c){a.setTime(a.getTime()+(c*1000));d+="; expires="+a.toGMTString()}document.cookie=b+"="+e+d+"; path=/"};QU.getCookie=function(b){var e=b+"=",a=document.cookie.split(";"),d,f;for(d=0;d<a.length;d=d+1){f=a[d];while(f.charAt(0)===" "){f=f.substring(1,f.length)}if(f.indexOf(e)===0){return f.substring(e.length,f.length)}}return null};QU.delCookie=function(a){QU.setCookie(a,"",-1)};QU.omnitureTrack=function(c,e,d){var b="",a="";if(typeof(c)==="undefined"){return}if(typeof(d)==="object"){for(b in d){if(d.hasOwnProperty(b)){s_clven[b]=d[b];a+=","+b}}}e=e?e:"o";s_clven.events=c;s_clven.linkTrackVars="events"+a;s_clven.linkTrackEvents=c;s_clven.tl(true,e)};
