function Memory(){this.transmissionID=this.engineID=this.gradeID=null}Memory.prototype.reset=function(){memory=new Memory};var memory=new Memory;
$(document).ready(function(){$(".bookatestdrive ul.testDriveProductChooser li").live("click",function(){$(this).find("input").attr("checked",true);$(this).siblings("li").each(function(){var a=$(this).find("a").attr("class");a.substring(0,6)=="chosen"&&$(this).find("a").removeClass(a).addClass(a.substring(6,a.length))});var b=$(this).find("a").attr("class");b.substring(0,6)!="chosen"&&$(this).find("a").attr("class","chosen"+b)});$(".carColours a").live("click",function(){var b=$(this).attr("href"),
a=$(this).attr("title"),c=$(this).parent("li").attr("id").replace("swatch","");removeClassFromSelector("ul.carColours","sw");$("#colourChooser ul").addClass("sw"+c);$("#mainCar").attr("src")!=b&&$("#mainCar").fadeOut("fast",function(){$("#mainCar").attr({src:b,alt:a,title:a});$("#overviewColours p").html(a);$("#mainCar").fadeIn("fast")});return false});$(".hijaxTool").hondaToolbox();$("#promo").randomiseBrandStory({customClass:"fixPng"});$("#testDriveForm button").click(function(b){if(!isValidPostcode($("#testDriveForm #location").val())){b.preventDefault();
alert("Please enter a valid UK postcode")}});hideCarButtons();replaceLabels()});function hideCarButtons(){$(".bookatestdrive ul.testDriveProductChooser li .carButton").each(function(){$(this).addClass("hideCarButton")})}
function replaceLabels(){$(".placeSearch").each(function(){var b="",a=$(this).find("label.place"),c=$("input.place",this);if(a.length){b=a.text();a.remove()}else{b=c.attr("title");c.attr("title","")}c.addClass("placeholder").data("label",b).val(b);c.live("focus",function(){this.value==$(this).data("label")&&$(this).removeClass("placeholder").val("")});c.live("blur",function(){this.value==""&&$(this).addClass("placeholder").val($(this).data("label"))})})};
