
vjo.ctype("vjo.darwin.core.pageleveltab.PageLevelTab").protos({sHtmlName:null,sactiveRgt:null,sactiveLft:null,shighlightLft:null,shighlightRgt:null,sinactiveLft:null,sinactiveRgt:null,shoverLft:null,shoverRgt:null,stabcontentOuterOff:null,stabcontentOuterOn:null,sContentElementId:null,sActiveBkgColor:null,aTabs:[],iCurrTab:0,hon:false,constructs:function(_1){var t=_1,o=this;o.sHtmlName=t.htmlName;o.sactiveRgt=t.activeRgt;o.sactiveLft=t.activeLft;o.shighlightLft=t.highlightLft;o.shighlightRgt=t.highlightRgt;o.sinactiveLft=t.inactiveLft;o.sinactiveRgt=t.inactiveRgt;o.shoverLft=t.hoverLft;o.shoverRgt=t.hoverRgt;o.stabcontentOuterOff=t.tabcontentOuterOff;o.stabcontentOuterOn=t.tabcontentOuterOn;o.sContentElementId=null;o.sActiveBkgColor=t.activeBkgColor;o.aTabs=[];o.iCurrTab=t.activeTabId;o.hon=t.hoverOn;}}).endType();

vjo.ctype("vjo.darwin.core.pageleveltab.TabProperties").needs("vjo.Registry","R").needs("vjo.darwin.core.utils.ServiceUtils","SU").needs("vjo.dsf.EventDispatcher","ED").needs("vjo.dsf.Element","E").protos({E:vjo.dsf.Element,R:vjo.Registry,ED:vjo.dsf.EventDispatcher,hN:null,iId:null,sUrl:null,bIsActive:false,bIsHighlighted:false,bIsAjaxEnabled:false,clkSvcId:null,dsbl:false,mName:null,constructs:function(_1){var t=this;var m=_1,mName=m.htmlName;t.hN=m.htmlName;t.iId=m.id;t.sUrl=m.url;t.bIsActive=m.active;t.bIsHighlighted=m.highlighted;t.bIsAjaxEnabled=m.ajaxEnabled;t.clkSvcId=m.clkSvcId;t.dsbl=m.dsbl;var _n=t.R.get(t.hN);if(_n!==null){var _5=_n.aTabs;_5[_5.length]=t;}
t.bindEventsInJS(_n.hon);t.attachEventListner(t.hN,t.clkSvcId);},bindEventsInJS:function(_6){var t=this,ED=this.ED,_tProp=vjo.darwin.core.pageleveltab.TabProperties;var _8=t.hN+"_tab_rgt_"+t.iId,tbL=t.hN+"_tab_lft_"+t.iId,tb=t.hN+"_"+t.iId;if(t.sUrl===null){t.sUrl="";}
var _f=function(_a){return _tProp.switchToTab(t.hN,t.iId,_a,t.clkSvcId);},ar=[_8,tbL,"mouseover","mouseout"],j=0;ED.add(tbL,"click",_f);ED.add(_8,"click",_f);if(_6){for(j=0;j<2;j++){ED.add(ar[j],ar[2],function(_b){return _tProp.hoverChange(t.hN,t.iId,true);});ED.add(ar[j],ar[3],function(_c){return _tProp.hoverChange(t.hN,t.iId,false);});}}},attachEventListner:function(_d,_e){var t=vjo.darwin.core.pageleveltab.TabProperties,fn=function(){t.initializer(_d,_e);};this.ED.addEventListener(window,"load",fn);}}).props({tLft:"_tab_lft_",tRgt:"_tab_rgt_",tCnt:"_content_",tCurrId:"CurrId",_rg:vjo.Registry,_elm:vjo.dsf.Element,switchToTab:function(_10,_11,_12,_13){var t=this,pTab=t._rg.get(_10),pArrTab=pTab.aTabs,hid=t._elm.get(_10+t.tCurrId),currId=(hid)?hid.value:1,from,to;hid.value=currId=(hid.value==0)?1:currId;for(var i=0;i<pArrTab.length;i++){if(currId==pArrTab[i].iId){from=i;}
if(_11==pArrTab[i].iId){to=i;}}
var tp=vjo.darwin.core.pageleveltab.TabProperties,fTbR=_10+t.tRgt+pArrTab[from].iId,fTbL=_10+t.tLft+pArrTab[from].iId,tTbR=_10+t.tRgt+pArrTab[to].iId,tTbL=_10+t.tLft+pArrTab[to].iId;if(pArrTab){if(pArrTab[to].bIsActive===true||pArrTab[to].dsbl==true){return;}
if(pArrTab[to].iId==_11){var rt=t._elm.get(tTbR),url=pArrTab[to].sUrl;if(_12&&(!pArrTab[to].bIsAjaxEnabled)&&(url&&url.length>1&&url.toLowerCase().indexOf("javascript")<0)){var src=_12.nativeEvent.target?_12.nativeEvent.target:_12.nativeEvent.srcElement;if(src.tagName.toLowerCase()==="a"){src.blur();return;}
document.location.href=pArrTab[to].sUrl;return;}
if(hid){hid.value=_11;}
tp.setTabs(_11,pArrTab[from],_10,pTab,_13);tp.setTabs(_11,pArrTab[to],_10,pTab,_13);}}},sendMsg:function(_19,tb,rTb,lTb,url){var t=this,SU=t.vj$.SU,msg=SU.gM(_19);msg.tb=tb;msg.rTb=rTb;msg.lTb=lTb;msg.tbUrl=url;SU.sndM(msg);},setClz:function(_1f,_20){var el;el=this._elm.get(_1f);if(el){el.className=_20;}},setBkgColor:function(_22,_23){var el;el=this._elm.get(_22);if(el){el.style.backgroundColor=_23;}},initializer:function(_25,_26){var t=this,to,pTab=t._rg.get(_25),pArrTab=pTab.aTabs,tp=vjo.darwin.core.pageleveltab.TabProperties,hid=t._elm.get(_25+tp.tCurrId),currId=(hid)?hid.value:1;for(var i=0;i<pArrTab.length;i++){if(currId==pArrTab[i].iId){to=i;break;}}
if(pArrTab){if((pArrTab[to])&&(pArrTab[to].bIsActive===true||pArrTab[to].dsbl==true)){return;}
for(var i=0;i<pArrTab.length;i++){tp.setTabs(currId,pArrTab[i],_25,pTab,_26);}}},setTabs:function(_29,_2a,_2b,_2c,_2d){var t=vjo.darwin.core.pageleveltab.TabProperties;var _2f=_2b+t.tRgt+_2a.iId,fTbL=_2b+t.tLft+_2a.iId;if(_29==_2a.iId){_2a.bIsActive=true;if(_2d){t.sendMsg(_2d,_29,_2f,fTbL);}
if(_2c.sActiveBkgColor!==null){t.setBkgColor(fTbL,_2c.sActiveBkgColor);t.setBkgColor(_2f,_2c.sActiveBkgColor);}
t.setClz(fTbL,_2c.sactiveLft);t.setClz(_2f,_2c.sactiveRgt);t.setClz(_2b+t.tCnt+_2a.iId,_2c.stabcontentOuterOn);}else{_2a.bIsActive=false;t.setBkgColor(fTbL,"");t.setBkgColor(_2f,"");if(_2a.bIsHighlighted===true){t.setClz(fTbL,_2c.shighlightLft);t.setClz(_2f,_2c.shighlightRgt);}else{t.setClz(fTbL,_2c.sinactiveLft);t.setClz(_2f,_2c.sinactiveRgt);}
t.setClz(_2b+t.tCnt+_2a.iId,_2c.stabcontentOuterOff);}},hoverChange:function(_30,_31,_32){var _33=this._rg.get(_30),tp=vjo.darwin.core.pageleveltab.TabProperties,pArrTab=_33.aTabs,to;for(var i=0;i<pArrTab.length;i++){if(pArrTab[i].iId==_31){to=i;break;}}
var _35=_30+tp.tRgt+pArrTab[to].iId,tTbL=_30+tp.tLft+pArrTab[to].iId;if(pArrTab){if(pArrTab[to].bIsActive===true||pArrTab[to].dsbl==true){return;}
if(pArrTab[to].bIsHighlighted===true){if(_32===true){tp.setClz(tTbL,_33.shighlightLft+" "+_33.shoverLft);tp.setClz(_35,_33.shighlightRgt+" "+_33.shoverRgt);}else{tp.setClz(tTbL,_33.shighlightLft);tp.setClz(_35,_33.shighlightRgt);}}else{if(_32===true){tp.setClz(tTbL,_33.sinactiveLft+" "+_33.shoverLft);tp.setClz(_35,_33.sinactiveRgt+" "+_33.shoverRgt);}else{tp.setClz(tTbL,_33.sinactiveLft);tp.setClz(_35,_33.sinactiveRgt);}}}}}).endType();

vjo.ctype("vjo.darwin.domain.motors.component.productsnapshot.ProductSnapshot").needs("vjo.dsf.window.utils.VjWindowUtils").needs("vjo.darwin.transitional.ajax.AjaxUtils").protos({AjaxUtils:vjo.darwin.transitional.ajax.AjaxUtils,constructs:function(_1){this.model=_1;this.tabID=_1.tabID;this.priceResearchID=_1.priceResearchID;this.viewSelectorID=_1.viewSelectorID;var _2=document.getElementById(this.tabID);this.AjaxUtils.addAjaxHandler(this,this.onPage,"Page.productSnapshot",_2);},onPage:function(_3){var _4=_3.response.productSnapshot;if(_4){this.setTabLinks(_4.tabLinks);this.setPriceResearchLink(_4.tabLinks[3]);this.setViewSelector(_4.viewSelector);}},setTabLinks:function(_5){if(_5){var _6=document.getElementById(this.tabID);var ul=_6.getElementsByTagName("ul")[0];var _8=_5.length;for(var _9=1;_9<_8;_9++){ul.getElementsByTagName("li")[_9].getElementsByTagName("a")[0].href=_5[_9];}}},setPriceResearchLink:function(_a){if(_a){var _b=document.getElementById(this.priceResearchID);if(_b){_b.getElementsByTagName("a")[0].href=_a;}}},setViewSelector:function(vs){if(vs){var _d=document.getElementById(this.viewSelectorID);if(_d){_d.innerHTML=vs;}}},submitYear:function(){document.location.href=this.model.baseUrl+(this.model.baseUrl.indexOf("?")>0?"&":"?")+this.model.yearParam+"="+document.getElementById(this.model.selectId).value;},scrollToResultSet:function(){window.scrollTo(0,vjo.dsf.window.utils.VjWindowUtils.offsetTop(document.getElementById("ff_left"))-10);return false;}}).endType();

vjo.ctype("vjo.darwin.domain.motors.component.productsnapshot.savedialog.SaveDialog").needs(["vjo.dsf.Element","vjo.dsf.EventDispatcher","vjo.dsf.ServiceEngine"]).protos({constructs:function(_1){this.model=_1;this.vE=vjo.dsf.Element;this.oC=_1||{};var c=this.oC;if(c.saveURL==null){}else{this.saveurl=c.saveURL;}
this.timeoutTime=c.timeOutPeriod;this.ontimeout=this.timeoutDialog;this.serviceId=c.serviceId;this.signedOn=c.isSignedOn;window.Motors2SaveLinkResponse=this.Motors2SaveLinkResponse;var _3=vjo.dsf.EventDispatcher;this.eBtn=this.vE.get(_1.btnId);if(this.eBtn){_3.addEventListener(this.eBtn,"click",this.callFromDialog,this);}},openDialog:function(){vjo.dsf.ServiceEngine.handleRequest(new vjo.dsf.Message(this.serviceId));},saveVehiclePsedoAjaxCall:function(){this.script=vjo.dsf.Element.createElement("script");this.script.type="text/javascript";this.script.charset="utf-8";this.timer=window.setTimeout(this.ontimeout,this.timeoutTime);this.script=document.body.appendChild(this.script);this.script.src=this.saveurl;},clearSaveVehicleDialog:function(_4){window.clearTimeout(this.timer);document.body.removeChild(this.script);return false;},timeoutDialog:function(){try{this.clearSaveVehicleDialog("Time Out");}
catch(e){}},callFromDialog:function(){var vE=this.vE;this.idEmailMeCHk1=vE.get(this.model.emailId);this.idEmailSelect1=vE.get(this.model.emailDurId);this.idOwnthis1=vE.get(this.model.ownThisId);this.idAlredayOwned1=vE.get(this.model.ownItId);var _6="&emailMe=";if(this.idEmailMeCHk1.checked==1){_6+="1";}else{_6+="2";}
_6+="&ownIt=";if(this.idOwnthis1.checked){_6+=this.idOwnthis1.value;}else{_6+=this.idAlredayOwned1.value;}
_6+="&emailDuration="+this.idEmailSelect1.options[this.idEmailSelect1.selectedIndex].value;if(this.signedOn=="true"){this.saveurl+="&tr=1"+_6;try{this.saveVehiclePsedoAjaxCall();}
catch(e){this.clearSaveVehicleDialog("Got exception while making psedu ajax call. Clearing now");}}else{if(this.signedOn=="false"){this.saveurl+="&tr=2"+_6;document.location.href=this.saveurl;}}
var _7=new vjo.dsf.Message(this.model.retireSrv);_7.isRetire=true;vjo.dsf.ServiceEngine.handleRequest(_7);return false;},Motors2SaveLinkResponse:function(_8){var vE=vjo.dsf.Element;var _a;var _b=vE.get("SaveVehicle_msg1");var _c=vE.get("SaveVehicle_msg2");var _d=vE.get("SaveVehicle_msg3");_b.style.display="none";_b.style.visibility="hidden";_c.style.display="none";_c.style.visibility="hidden";_d.style.display="none";_d.style.visibility="hidden";switch(_8){case 1:_a=vE.get("SaveVehicle_msg1");break;case 3:_a=vE.get("SaveVehicle_msg2");break;case 4:_a=vE.get("SaveVehicle_msg2");break;default:_a=vE.get("SaveVehicle_msg3");break;}
if(_a){_a.style.display="block";_a.style.visibility="visible";}
this.clearSaveVehicleDialog("Clearing now");},hideMsg:function(_e){var vE=vjo.dsf.Element;msgElem=vE.get(_e);if(!msgElem){return;}
msgElem.style.display="none";msgElem.style.visibility="hidden";}}).endType();

vjo.ctype("vjo.darwin.domain.motors.component.productsnapshot.SaveCompareVehicle").needs(["vjo.dsf.Message","vjo.dsf.ServiceEngine","vjo.dsf.EventDispatcher","vjo.dsf.Element"]).protos({constructs:function(_1){this.model=_1;this.element=document.getElementById(this.model.htmlId);vjo.dsf.ServiceEngine.registerSvcRespHdl("SaveSearch.Cancel",this);vjo.dsf.ServiceEngine.registerSvcRespHdl("SaveSearch.Confirm",this);},handleResponse:function(_2){if(_2.svcId=="SaveSearch.Cancel"){this.onCancel(_2);}else{if(_2.svcId=="SaveSearch.Confirm"){this.onConfirm(_2);}}},onCancel:function(_3){this.element.style.display="block";},onConfirm:function(_4){this.element.style.display="block";}}).endType();

vjo.ctype("vjo.darwin.core.pulldowndialog1.PulldownDialog").needs("vjo.dsf.Element","E").needs("vjo.darwin.core.overlaypanel3.OverlayPanel","OP").protos({E:vjo.dsf.Element,O:null,OP:vjo.darwin.core.overlaypanel3.OverlayPanel,mnu:null,c:null,content:null,constructs:function(_1,_2){var t=this,om=t.c=_1||{},J=t.J=t.vj$;t.E=J.E;t.O=_2;t.mnu=t.E.get(om.cntId);t.OP=t.vj$.OP;},openPanel:function(_4){var t=this,m=t.c,mnu=t.mnu;if(t.content){mnu=t.content;}
t.OP.olpMsg(m.opId,_4,mnu,t.O);return false;},close:function(){this.OP.olpMsg(this.c.ocId);},setContent:function(o){this.content=o;}}).endType();

// en_GB/e685i/Finding_MotorsPDP_e685i11945596_6b_en_GB
// b=11945596
