var memory=new Memory;function Memory(){this.transmissionID=this.engineID=this.gradeID=null}Memory.prototype.reset=function(){this.transmissionID=this.engineID=this.gradeID=null};var carHomePage;
(function(){dp.cars=function(){};dp.cars.init=function(){$("#promo").randomiseBrandStory({customClass:"fixPng"});$(".bookatestdrive ul.testDriveProductChooser li").live("click",function(){$(this).find("input").attr("checked",!0);$(this).siblings("li").each(function(){var b=$(this).find("a").attr("class");"chosen"==b.substring(0,6)&&$(this).find("a").removeClass(b).addClass(b.substring(6,b.length))});var c=$(this).find("a").attr("class");"chosen"!=c.substring(0,6)&&$(this).find("a").attr("class","chosen"+
c)});$(".carColours a").live("click",function(){var c=$(this).attr("href"),b=$(this).attr("title"),a=$(this).parent("li").attr("id").replace("swatch","");dp.removeClassFromSelector("ul.carColours","sw");$("#colourChooser ul").addClass("sw"+a);$("#mainCar").attr("src")!=c&&$("#mainCar").fadeOut("fast",function(){$("#mainCar").attr({src:c,alt:b,title:b});$("#overviewColours p").html(b);$("#mainCar").fadeIn("fast")});return!1});"undefined"===typeof showroom&&($("body #tools .hijaxTool").hondaToolbox({indicator:!0}),
$("body .hijaxTool").hondaToolbox());$("#testDriveForm button").click(function(a){isValidPostcode($("#testDriveForm #location").val())||(a.preventDefault(),alert("Please enter a valid UK postcode"))});var a=window.location.toString(),a=a+(-1<a.indexOf("?")?"&":"?");$(".mobileSite").attr("href",a+"mobile_site=1").click(function(){$.cookie("hukmcars",null,{path:"/"})});"undefined"===typeof showroom&&0>navigator.userAgent.toLowerCase().indexOf("android")&&($("body").append("<div id='liveChat'><a href='#' style='top: 40%; right: 0pt; z-index: 50000; position: fixed;'><img width='29' height='190' border='0' alt='Honda Live Chat' src='http://livechat.honda-uk.sophus3.com/image.php?id=05&amp;type=inlay'></a></div>"),
$("#liveChat a").click(function(a){a.preventDefault();window.open("http://livechat.honda-uk.sophus3.com/chat.php","","width=500,height=550,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes")}),$("#liveChat a").hover(function(){$("img",this).attr("src","http://livechat.honda-uk.sophus3.com/image.php?id=08&amp;type=inlay")},function(){$("img",this).attr("src","http://livechat.honda-uk.sophus3.com/image.php?id=05&amp;type=inlay")}));dp.cars.hideCarButtons();dp.cars.replaceLabels()};
dp.cars.hideCarButtons=function(){$(".bookatestdrive ul.testDriveProductChooser li .carButton").each(function(){$(this).addClass("hideCarButton")})};this.hideCarButtons=dp.cars.hideCarButtons;dp.cars.replaceLabels=function(){$(".placeSearch").each(function(){var a="",c=$(this).find("label.place"),b=$("input.place",this);c.length?(a=c.text(),c.remove()):(a=b.attr("title"),b.attr("title",""));b.addClass("placeholder").data("label",a).val(a);b.live("focus",function(){this.value==$(this).data("label")&&
$(this).removeClass("placeholder").val("")});b.live("blur",function(){""==this.value&&$(this).addClass("placeholder").val($(this).data("label"))})})};this.replaceLabels=dp.cars.replaceLabels;dp.cars.loadGlossary=function(){$.getJSON("/cars/glossary/_assets/data/glossary-data.js",function(a){function c(b){return a.definitions[b.index]}var b={data:[]};$.maparray(a.terms,function(a,d){b.data.push({key:d,title:d,html:c,index:a});return d});$.execute({async:!0,race:10,interval:20},function(){$("#mainContentArea").glossary(b)})})}})();
(function(){var a={};a.xmlSrc=carHomePage?"/cars/_assets/data/navigation/navigationCarHome.xml":"/cars/_assets/data/navigation/navigation.xml";var c={wmode:"transparent",menu:"false",allowscriptaccess:"always",align:"T",salign:"T",quality:"best",scale:"noscale"},b={id:"newCarsMenuFlash",name:"newCarsMenuFlash"};"undefined"!==typeof swfobject&&swfobject.embedSWF("/cars/_assets/flash/verticalnav.swf","newCarsMenu","200","500","9.0.0","/_assets/flash/expressInstall.swf",a,c,b);dp.cars.menu=function(){};
dp.cars.menu.init=function(){var a=$("#flashMenuWrapper");$("#flashMenuWrapper object").live("mouseleave",function(){void 0===carHomePage&&dp.cars.menu.closeMenu()});$("#flashMenuWrapper object").live("mouseenter",function(){void 0===carHomePage&&dp.cars.menu.openMenu()});void 0===carHomePage&&a.css({background:"none",width:"350px",height:"23px",marginLeft:"-525px",overflow:"hidden"})};dp.cars.menu.closeMenu=function(){$("#flashMenuWrapper").css({height:"23px",zIndex:"40"});if(FL("inspireFlash"))try{FL("inspireFlash").startProcessing()}catch(a){}};
dp.cars.menu.openMenu=function(){$("#flashMenuWrapper").css({height:"460px",zIndex:"80"});if(FL("inspireFlash"))try{FL("inspireFlash").stopProcessing()}catch(a){}}})();
