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){var b={method:"post",parameters:"zip="+c,onSuccess:a,onFailure:QU.fracaso};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 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=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.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(){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.closeOnClickOut){Com.stopEvent(document,"click",b.getcoords)}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(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)};