/* Copyright (C) Abarthisti 2008-2010 */
if(top!=self){top.location.href=self.location.href}function pop(a,b,c){var d="new_wnd";var e=1;var f=0;var g=0;var h=0;if(screen){g=(screen.width/2)-(b/2);h=(screen.height/2)-(c/2)}var i=window.open("/pop.html?"+a,d,"height="+c+",width="+b+",status=0,toolbar=0,resizable="+e+",scrollbars="+f+",menubar=0,location=0,directories=0,left="+g+",top="+h+"")}function showCar(a,b,c,d){var e="new_wnd";var f=1;var g=0;var h=0;var i=0;if(screen){h=(screen.width/2)-(c/2);i=(screen.height/2)-(d/2)}var j=window.open("/find-a-car/stockpop.php?id="+a+"&s="+b,e,"height="+d+",width="+c+",status=0,toolbar=0,resizable="+f+",scrollbars="+g+",menubar=0,location=0,directories=0,left="+h+",top="+i+"")}function formatCurrency(a){var b=new RegExp("(-?[0-9]+)([0-9]{3})");a=a.toString().replace(/\,/g,"");a=!isNaN(a)?Math.round(a*100)/100:0;while(/\.\d{0,1}$/.test(a)){a+="0"}while(b.test(a)){a=a.toString().replace(b,"$1,$2")}return a}function calc(){var a=document.getElementById("fields").value.split(",");var b=parseFloat(document.getElementById("baseprice").value);for(var i=0;i<a.length;i++){if(document.getElementById(a[i]).checked){b=b+parseFloat(document.getElementById(a[i]).value)}}document.getElementById("total").innerHTML="&pound;"+formatCurrency(b)}function calc2(){var a=document.getElementById("fields").value.split(",");var b=parseFloat(document.getElementById("baseprice").value);for(var i=0;i<a.length;i++){if(document.getElementById(a[i]).checked){b=b+parseFloat(document.getElementById(a[i]).value)}}document.getElementById("total").innerHTML="&pound;"+formatCurrency2(b)}function eventcalc(){var a=0;if(document.getElementById("spectator").checked){document.getElementById("moredrivers").selectedIndex=0;document.getElementById("instruction").selectedIndex=0;document.getElementById("moredrivers").disabled=true;document.getElementById("instruction").disabled=true}else{document.getElementById("moredrivers").disabled=false;document.getElementById("instruction").disabled=false}if(document.getElementById("driver").checked){a=a+99}if(document.getElementById("spectator").checked){a=a+20}a=a+(document.getElementById("moredrivers").options[document.getElementById("moredrivers").selectedIndex].value*39);a=a+(document.getElementById("guests").options[document.getElementById("guests").selectedIndex].value*20);a=a+(document.getElementById("instruction").options[document.getElementById("instruction").selectedIndex].value*15);a=a+(document.getElementById("paxrides").options[document.getElementById("paxrides").selectedIndex].value*10);document.getElementById("totaltext").innerHTML="&pound;"+a;document.getElementById("totalfield").value=a}function formatCurrency2(a){var b=new RegExp("(-?[0-9]+)([0-9]{3})");a=a.toString().replace(/\,/g,"");a=!isNaN(a)?Math.round(a*100)/100:0;a.toString().indexOf(".")==-1?a+=".00":void 0;while(/\.\d{0,1}$/.test(a)){a+="0"}while(b.test(a)){a=a.toString().replace(b,"$1,$2")}return a}var IsIE=false;var IsIE7=false;function DisplayMainCover(){var a=document.getElementById("cover");var b=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;a.style.width=Math.max(b.scrollWidth,b.clientWidth,document.scrollWidth||0)-1+"px";a.style.height=Math.max(b.scrollHeight,b.clientHeight,document.scrollHeight||0)-1+"px";var c=document.getElementById("covercontent");c.style.top="-99999px";c.style.left="-999999px";a.style.display="block";document.getElementById("coverhorizon").style.display="block";var d=getPageSize();var e=getScrollPos();var f=getElementSize(c);var x=Math.round((d.width-f.width)/2+e.scrollX);var y=Math.round((d.height-f.height)/2+e.scrollY);if(c.offsetLeft){x-=c.offsetLeft}if(c.offsetTop){y-=c.offsetTop}if(c.style.left){x+=parseInt(c.style.left)}if(c.style.top){y+=parseInt(c.style.top)}x-=10;c.style.top=y+"px";c.style.left=x+"px"}function getPageSize(){return {width:window.innerWidth||(document.documentElement&&document.documentElement.clientWidth)||document.body.clientWidth,height:window.innerHeight||(document.documentElement&&document.documentElement.clientHeight)||document.body.clientHeight}}function getScrollPos(){var a=document.documentElement;return {scrollX:document.body.scrollLeft||window.pageXOffset||(a&&a.scrollLeft),scrollY:document.body.scrollTop||window.pageYOffset||(a&&a.scrollTop)}}function getElementSize(a){return {width:a.offsetWidth||a.style.pixelWidth,height:a.offsetHeight||a.style.pixelHeight}}function closeImage(){document.getElementById("cover").style.display="none";document.getElementById("coverhorizon").style.display="none"}function zoomImage(a){document.getElementById("coverimage").src=a;DisplayMainCover()}function clickAllColours(){var a=clickAllColours.arguments;var b=document.getElementById("allcolours").checked;for(var i=0;i<a.length;i++){document.getElementById("colour"+a[i]).checked=b}}function checkAllColours(){var a=checkAllColours.arguments;var b=true;for(var i=0;i<a.length;i++){if(document.getElementById("colour"+a[i]).checked==false){b=false;break}}document.getElementById("allcolours").checked=b}