var BROWSER="";if(navigator.appVersion.indexOf("MSIE")!=-1){BROWSER="IE"}else{if(navigator.userAgent.indexOf("Firefox")!=-1){BROWSER="Firefox"}else{if(navigator.userAgent.indexOf("Opera")!=-1){BROWSER="Opera"}else{if(navigator.userAgent.indexOf("Netscape")!=-1){BROWSER="Netscape"}}}}var d=document;var filter_email=new RegExp("^([a-z0-9_.-])+@(([a-z0-9_-])+.)+([a-z0-9]{2,4})$","gi");var filter_email_replace=new RegExp("([a-z0-9_.-])+@(([a-z0-9_-])+.)+([a-z0-9]{2,4})","gi");var filter_url=new RegExp("^(http://|https://){1}([a-z0-9_.-])+.{1}([a-z0-9]{2,4})(/(.)*)?$","gi");var filter_url_replace=new RegExp("(http://|https://){1}([a-z0-9_.-])+.{1}([a-z0-9]{2,4})(/(.)*)?","gi");var filter_newline=new RegExp("(\n)+|(\r\n)+","g");function test_email(A){var B=new RegExp("^([a-z0-9_.-])+@(([a-z0-9_-])+.)+([a-z0-9]{2,4})$","gi");return B.test(A)}function test_url(A){var B=new RegExp("^(http://|https://){1}([a-z0-9_.-])+.+([a-z0-9]{2,4})(/(.)*)?$","gi");return B.test(A)}function test_ip(B){var A=new RegExp("^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$","g");return A.test(B)}function test_date(A){filter_date=new RegExp("^([0-9]{2,2})/([0-9]{2,2})/([0-9]{4,4})$","g");return filter_date.test(A)}function findPosX(A){var B=0;if(A.offsetParent){while(A.offsetParent){B+=A.offsetLeft;A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetTop;B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function screenCenterX(){return getInnerWindowWidth()/2}function screenCenterY(){if(BROWSER=="IE"){return getInnerWindowHeight()/2+d.documentElement.scrollTop}else{return getInnerWindowHeight()/2+window.pageYOffset}}function loadArray(A){return A.split(";")}function getArrayKey(A,B){var C;for(C=0;C<A.length;C++){if(A[C]==B){return C}}return -1}function getArrayKeyByObjId(A,B){var C;for(C=0;C<A.length;C++){if(A[C].id==B){return C}}return -1}function trimString(A){while(A.substring(0,1)==" "||A.substring(0,1)=="\r"||A.substring(0,1)=="\n"||A.substring(0,1)=="\t"){A=A.substring(1,A.length)}while(A.substring(A.length-1,A.length)==" "||A.substring(A.length-1,A.length)=="\r"||A.substring(A.length-1,A.length)=="\n"||A.substring(A.length-1,A.length)=="\t"){A=A.substring(0,A.length-1)}return A}function removeAllChild(A){while(A.firstChild){A.removeChild(A.firstChild)}}function createXMLHttpRequest(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}}function DBStr(B,A){this.id=B;this.str=A}function getInnerWindowWidth(){if(!window.innerWidth){return d.documentElement.clientWidth}else{return window.innerWidth}}function getInnerWindowHeight(){if(!window.innerHeight){return d.documentElement.clientHeight}else{return window.innerHeight}}function getDocumentHeight(){return d.body.clientHeight}function setOpacity(B,A){if(BROWSER=="IE"){B.style.filter="alpha(opacity="+A+")"}else{B.style.opacity=(A/100)}}function showLayer(E,C,F,G,A,B,H,D){if(E){if(!D>0){D=0}var I=d.getElementById(E.id+"Iframe");if(BROWSER=="IE"&&I){if(B>0){I.style.width=(B+D*2)+"px"}if(H>0){I.style.height=(H+D*2)+"px"}if(C>0){I.style.left=Math.round(C)+"px"}if(F>0){I.style.top=Math.round(F)+"px"}if(G>0){I.style.right=Math.round(G)+"px"}if(A>0){I.style.top=Math.round(A)+"px"}I.style.visibility="visible"}E.style.borderWidth=D+"px";if(B>0){E.style.width=(B)+"px"}if(H>0){E.style.height=(H)+"px"}if(C>0){E.style.left=Math.round(C)+"px"}if(F>0){E.style.top=Math.round(F)+"px"}if(G>0){E.style.right=Math.round(G)+"px"}if(A>0){E.style.top=Math.round(A)+"px"}E.style.visibility="visible"}}function hideLayer(B){if(B){var A;if(BROWSER=="IE"&&(A=d.getElementById(B.id+"Iframe"))){A.style.visibility="hidden"}B.style.visibility="hidden"}}function checkInteger(A){return A.replace(/([^0-9])+/g,"")}function getPasswordStrength(K){var E=(K.length);if(E>8){E=8}var H=K.replace(/[0-9]/g,"");var I=(K.length-H.length);if(I>2){I=2}var B=K.replace(/\W/g,"");var C=(K.length-B.length);if(C>2){C=2}var F=K.replace(/[a-z]/g,"");var D=(K.length-F.length);if(D>2){D=2}var A=K.replace(/[A-Z]/g,"");var J=(K.length-A.length);if(J>2){J=2}var L=-3;if(I>0){L++}if(C>0){L++}if(D>0){L++}if(J>0){L++}var G=((E*12)-10)+(I*8)+(C*10)+(J*7)+(L*10);if(G<0){G=0}if(G>100){G=100}return G}function getTextLength(A,D,B){var C;if(!D>0){D=600}if(A.value.length>D){A.value=A.value.substr(0,D)}if(C=d.getElementById(B)){if((D-A.value.length)>=0){C.innerHTML=(D-A.value.length)}else{C.innerHTML=0}}}function multiIdString(C){var D=new String();var A=C.elements;var B;for(B=0;B<A.length;B++){if(A[B].name.substr(0,4)=="sel_"){if(A[B].checked){D=D+A[B].name.substr(4)+","}}}return D.substr(0,D.length-1)}function showMap(C,B,A){window.open("index.php?action=popup&function=view_map&id="+C+"&lat="+B+"&lng="+A,"","location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=yes,width=750,height=550")}function showTechSpec(A){window.open("index.php?action=popup&function=view_techspec&id="+A,"","location=no,menubar=no,toolbar=no,status=no,scrollbars=auto,resizable=yes,width=500,height=550")}function showPolicy(){window.open("index.php?action=popup&function=view_policy","","location=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,width=560,height=500")}function newModelRequest(){window.open("index.php?action=popup&function=new_model_request","","location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,width=400,height=430")}function navbarClick(A){tab_modern_cars=d.getElementById("modern_cars");tab_new_cars=d.getElementById("new_cars");tab_used_cars=d.getElementById("used_cars");tab_classic_cars=d.getElementById("classic_cars");tab_vintage_cars=d.getElementById("vintage_cars");if(A=="modern_cars"){if(area=="modern_cars"){tab_used_cars.style.display="block";tab_new_cars.style.display="block"}else{area="modern_cars";tab_used_cars.className="nsel";tab_new_cars.className="nsel";tab_modern_cars.className="sel"}return false}else{if(A=="used_cars"){tab_used_cars.className="sel";tab_new_cars.className="nsel";tab_modern_cars.className="nsel";area="used_cars";return false}else{if(A=="new_cars"){tab_used_cars.className="nsel";tab_new_cars.className="sel";tab_modern_cars.className="nsel";area="new_cars";return false}else{if(A=="classic_cars"){if(area=="classic_cars"){tab_vintage_cars.style.display="block"}else{area="classic_cars";tab_vintage_cars.className="nsel";tab_classic_cars.className="sel";if(d.form_quick_search.anno_a){selectOption(d.form_quick_search.anno_a,"")}}return false}else{if(A=="vintage_cars"){tab_vintage_cars.className="sel";tab_classic_cars.className="nsel";area="vintage_cars";if(d.form_quick_search.anno_a){selectOption(d.form_quick_search.anno_a,"1970")}return false}}}}}return true}function showHomeIntro(){d.getElementById("intro_home_container").appendChild(d.getElementById("intro_home"));d.getElementById("intro_home_container").appendChild(d.getElementById("intro_home_links"));d.getElementById("intro_home").style.display="block";d.getElementById("intro_home_links").style.display="block"}function showDetailModelText(){d.getElementById("detail_model_text_container").appendChild(d.getElementById("detail_model_text"));d.getElementById("detail_model_text").style.display="block"}function showDetailModelTestDrive(){d.getElementById("detail_model_test_drive").style.display="block"}var tooltip_id="";function showTooltip(A,C,I,D,H,E,G,F){tt=d.getElementById("tooltipContainer");if(tt){tt_text=d.getElementById("tooltip_text");tt_v=d.getElementById("tooltip_v");if(tt.style.visibility=="visible"&&C==tooltip_id){hideLayer(tt)}else{tooltip_id=C;if(E!="l"&&E!="r"){E="r"}if(E=="r"){tt_v.src="http://image.i0100.com/tooltip_vr.gif";tt_v.style.left="6px"}else{tt_v.src="http://image.i0100.com/tooltip_vl.gif";tt_v.style.left=(I-29-6)+"px"}if(H){if(E=="r"){G=findPosX(H)+H.clientWidth-24;F=findPosY(H)-D}else{G=findPosX(H)-I+24;F=findPosY(H)-D}}var B=d.getElementById(tt.id+"Iframe");if(BROWSER=="IE"&&B){B.style.width=I+"px";B.style.height=D+"px";B.style.left=G+"px";B.style.top=F+"px";B.style.visibility="visible"}tt.style.width=I+"px";tt.style.height=D+"px";tt.style.left=G+"px";tt.style.top=F+"px";d.getElementById("tooltip_t").style.width=(I-12)+"px";d.getElementById("tooltip_b").style.width=(I-12)+"px";d.getElementById("tooltip_l").style.height=(D-32)+"px";d.getElementById("tooltip_r").style.height=(D-32)+"px";d.getElementById("tooltip_title").style.width=(I-12)+"px";tt_text.style.width=(I-12)+"px";tt_text.style.height=(D-48)+"px";tt_text.innerHTML=A;tt.style.visibility="visible"}}};