/**
 * DO NOT EDIT THIS FILE!
 * This is a generated file.  Your changes will be overwritten.
 */
Configurator.PaneCommon={setComplete:function(_1){
this.is_complete=_1;
NotificationCenter.sendNotification("PanelComplete Status Change",[this]);
},handleTabChanged:function(_2,_3){
if(_3==this.pane_name){
this.is_current_pane=true;
}else{
if(this.is_current_pane){
this.setComplete(true);
}
this.is_current_pane=false;
}
}};
Configurator.PopupCommon={positionCenter:function(_4){
this.positionCenterX(_4);
this.positionCenterY(_4);
},positionCenterX:function(_5){
var _6=(document.all)?document.documentElement.clientWidth:window.innerWidth;
var _7=_5.offsetWidth;
var _8=(document.all)?document.documentElement.scrollLeft:window.pageXOffset;
_5.style.left=Math.floor((_6/2)-(_7/2))+"px";
},positionCenterY:function(_9){
var _a=(document.all)?document.documentElement.clientHeight:window.innerHeight;
var _b=_9.offsetHeight;
var _c=(document.all)?document.documentElement.scrollTop:window.pageYOffset;
var _d=Math.floor((_a/2)-(_b/2)+_c);
_9.style.top=(_d>0?_d:"0")+"px";
},positionAboveElement:function(_e,_f,_10){
var _11=_10||{};
var _12=Position.cumulativeOffset(_f)[0];
var top=Position.cumulativeOffset(_f)[1];
var _14=Math.floor((_12-(_e.offsetWidth/2))+(_f.offsetWidth/2));
var _15=(top-(_e.offsetHeight));
var _16=(document.all)?document.documentElement.scrollLeft:window.pageXOffset;
var _17=(document.all)?document.documentElement.scrollTop:window.pageYOffset;
var _18=(document.all)?document.documentElement.clientWidth:window.innerWidth;
if(_14+_e.offsetWidth>=(_18+_16)){
_14=((_18+_16)-_e.offsetWidth)-15;
}
var _19={left:(_14>_16?_14:_16),top:(_15>_17?_15:_17)};
if(!_11.return_only){
_e.style.left=_19.left+"px";
_e.style.top=_19.top+"px";
}
return _19;
},positionBelowElement:function(_1a,_1b,_1c){
var _1d=_1c||{};
var _1e=(document.all)?document.documentElement.scrollLeft:window.pageXOffset;
var _1f=(document.all)?document.documentElement.scrollTop:window.pageYOffset;
var _20=(document.all)?document.documentElement.clientWidth:window.innerWidth;
var _21=Position.cumulativeOffset(_1b)[0];
var top=Position.cumulativeOffset(_1b)[1]-Position.realOffset(_1b)[1]+_1f;
var _23=(_1a)?_1a.offsetWidth:0;
var _24=(_21-(_23/2))+(_1b.offsetWidth/2);
var _25=(top+(_1b.offsetHeight));
if(_24+_23>=(_20+_1e)){
_24=((_20+_1e)-_23)-15;
}
var _26={left:(_24>_1e?_24:_1e),top:(_25>_1f?_25:_1f)};
if(!_1d.return_only){
_1a.style.left=_26.left+"px";
_1a.style.top=_26.top+"px";
}
return _26;
},positionRightOfElement:function(_27,_28){
var _29=Position.cumulativeOffset(_28)[0];
var top=Position.cumulativeOffset(_28)[1];
var _2b=(_29+_28.getWidth()+5);
var _2c=(top-($(_27).getHeight()/2));
var _2d=(document.all)?document.documentElement.scrollLeft:window.pageXOffset;
var _2e=(document.all)?document.documentElement.scrollTop:window.pageYOffset;
var _2f=(document.all)?document.documentElement.clientWidth:window.innerWidth;
if(_2b+_27.offsetWidth>=(_2f+_2d)){
_2b=((_2f+_2d)-_27.offsetWidth)-15;
}
_27.style.left=(_2b>_2d?_2b:_2d)+"px";
_27.style.top=(_2c>_2e?_2c:_2e)+"px";
}};
Configurator.ControllerCommon={loadTemplate:function(url,_31){
var _31=_31||{};
var req=new Ajax.Request(url,{method:"get",wait:true,onComplete:function(req){
var _34=req.responseText;
var _35=/(?:^|\n)\s*#\s*[a-z0-9_ ]+?\s*-{2,}\s*\n/ig;
var _36=_34.split(_35);
if(document.all){
_36=[""].concat(_36);
}
var _37=[""].concat(_34.match(_35).map(function(t){
return t.match(/[a-z0-9_ ]+/i)[0].trim();
}));
if(!this.templates){
this.templates={};
}
if(_36.length>1){
for(var i=1;i<_36.length;i++){
this.templates[_37[i]]=new Template(_36[i]);
}
}else{
this.templates[_31.name]=_34;
}
if(_31.onComplete){
_31.onComplete(_31.name);
}
}.bind(this)});
Configurator.Queue.addAction(req,{priority:6});
},setup_iLinks:function(_3a,_3b){
}};
Configurator.ApplicationCommon={fatalError:function(_3c){
var _3d={510:"Your session has expired."};
var _3e=_3c.message.match(/[0-9]+/)||"";
var _3f=(_3e.length?" ("+_3e+")":"");
try{
Configurator.ErrorDialog.trigger({name:"Error",description:_3d[_3c.code]||"An error has occurred while loading this page."+_3f,closable:false,options:[{text:"Return to Build Your Toyota Start Page",clickAction:function(){
window.location.href="/byt/pub/init.do";
return false;
}}]});
}
catch(e){
Debug.error(e);
}
},redirect:function(url){
window.location=url;
return false;
},launchSurveyOverlay:function(){
var _41=function(){
return {"animate":function(){
return;
},"ready":function(){
return;
},"show":function(){
return;
}};
};
decipherInit(_41);
decipher.onScriptStart();
$("interstitial").writeAttribute("class","surveyIntercept");
$("modal_overlay").style.width="100%";
$("modal_overlay").show();
$("interstitial").show();
$("interstitial_msg").innerHTML="";
$("interstitial_title").innerHTML="Welcome. Your opinion is important.<p>Thank you for agreeing to complete this brief 2 minute survey about Toyota.com.  Any information you share will be anonymous and will be kept strictly confidential.</p><h3>It's easy to participate:</h3><p>By clicking [Continue], Toyota is referring you to a third party site to participate in the survey.</p><p>Thank you, in advance, for your assistance.</p><p>* Please make sure not to close that window if you wish to participate.</p>";
$("interstitial_continue").style.display="none";
if(!$("interstitial_survey")){
$$(".interstitial_buttons").first().insert("<a id=\"interstitial_survey\" target=\"_blank\" title=\"Continue\" class=\"\">&nbsp;</a>");
}
$("interstitial_survey").writeAttribute("href","http://v2.decipherinc.com/survey/selfserve/ffb/110201?_type=1");
$$(".interstitial_back")[0].observe("click",function(e){
var _43={properties:{"46":TMSSite.i18n[TMSSite.lang].pageName+":Survey:Site:Participation Overlay:No"},linkTrackVars:"prop46",linkTrackType:"o",linkTrackName:((TMSSite.i18n[TMSSite.lang].pageName=="GM")?"tcom_":"esp_")+"survey_site_participation_no"};
TMSSite.analytics.sendTrackingLink(_43);
return false;
});
$("interstitial_survey").observe("click",function(e){
var _45={properties:{"46":TMSSite.i18n[TMSSite.lang].pageName+":Survey:Site:Participation Overlay:Yes"},linkTrackVars:"prop46",linkTrackType:"o",linkTrackName:((TMSSite.i18n[TMSSite.lang].pageName=="GM")?"tcom_":"esp_")+"survey_site_participation_yes"};
TMSSite.analytics.sendTrackingLink(_45);
return false;
});
}};

with(Configurator){
Configurator.DealerList=Class.create(ControllerCommon,{initialize:function(_1){
this.dealers=_1;
this.dealer_groups=[];
this.getTemplate("/configurator/includes/dealer_list.html",{onComplete:this.template_loaded.bind(this)});
this.divideDealers(this.dealers);
Event.observe(window,"load",function(){
this.displayDealerGroups(0);
}.bind(this));
},template_loaded:function(){
this.template_loaded=true;
},divideDealers:function(_2){
this.dealer_groups.push(_2.findAll(function(d){
return d.pma;
}));
this.dealer_groups.push(_2.findAll(function(d){
return !d.pma;
}));
},displayDealerGroups:function(_5){
var _6="";
var _7=this.dealer_groups[_5];
var dl="";
for(i=0;i<_7.length;i++){
dl+=this.templates["dealer"].evaluate(_7[i]);
}
if(_5>0){
var bb="<a href=\"javascript:;\" class=\"redLink back_button\">Back to previous</a>";
}else{
var bb="";
}
if(_5<dealerGroups.length-1){
var fb="<a href=\"javascript:;\" class=\"redLink fwd_button\">More Dealers</a>";
}else{
var fb="";
}
$("dealersListContainerDiv").innerHTML=this.templates.apply["main"].evaluate({back_button:bb,fwd_button:fb,dealers:dl});
document.getElementsByClassName("back_button",$("dealersListContainerDiv"),"a").each(function(_b){
Event.observe(_b,"click",this.displayDealerGroups(_5-1).bind(this));
}.bind(this));
document.getElementsByClassName("fwd_button",$("dealersListContainerDiv"),"a").each(function(_c){
Event.observe(_c,"click",this.displayDealerGroups(_5+1).bind(this));
}.bind(this));
}});
}

with(Configurator){
Configurator.ContactDealer=Class.create(ControllerCommon,PopupCommon,{initialize:function(_1,_2){
this.vehicle=_1;
this.zip_code=App.zip_code;
this.dealers=[];
this.submitting=false;
this.validation_events=[];
this.covered_content=_2;
this.default_header_text="";
this.error_message="Please fill in all the required fields.";
this.current_view="";
if(!$("containerDynElement")){
this.conainer_mbox_loader=$("wrapper_holder").appendChild(document.createElement("div"));
this.conainer_mbox_loader.setAttribute("id","containerDynElement");
this.conainer_mbox_loader.style.height="1px";
this.conainer_mbox_loader.style.width="1px";
this.conainer_mbox_loader.style.visibility="hidden";
this.conainer_mbox_loader.style.overflow="hidden";
this.mbox_loader=$("containerDynElement").appendChild(document.createElement("div"));
this.mbox_loader.setAttribute("id","dynamicElement");
mboxDefine("dynamicElement","startRAQ");
mboxUpdate("startRAQ");
}
setTimeout(function(){
this.delayed_init();
}.bind(this),900);
},delayed_init:function(){
if(!$("containerDynElement").firstDescendant().empty()){
if($("containerDynElement").firstDescendant().innerHTML.include("quote_tabs")){
this.ab_test_version=2;
this.ab_test_name="_tabs";
}else{
if($("containerDynElement").firstDescendant().innerHTML.include("contact_dealer_confirm_map")){
this.ab_test_version=1;
this.ab_test_name="_cols";
}else{
this.ab_test_version=0;
this.ab_test_name="";
}
}
console.debug("mbox layout used: version "+this.ab_test_version+" name:"+this.ab_test_name);
}else{
var _3=document.location.pathname.replace(/^(\/[^\/]*)\/.*/i,"$1");
var _4=(new Cookie("raq_type",_3));
var _5=_4.read();
if(_5!=null){
this.ab_test_version=_5;
}else{
var _6=new Cookie("raq_type");
var _7=Math.floor(Math.random()*3);
_6.set(_7,-1,{path:_3+"; expires="});
this.ab_test_version=_7;
}
this.ab_test_name="";
switch(parseInt(this.ab_test_version)){
case 0:
this.ab_test_name="";
break;
case 1:
this.ab_test_name="_cols";
break;
case 2:
this.ab_test_name="_tabs";
break;
}
console.debug("non-mbox layout used: version "+this.ab_test_version+" name:"+this.ab_test_name);
}
this.element=$("wrapper_holder").appendChild(document.createElement("div"));
this.element.className="contact_dealer"+this.ab_test_name+" popup";
this.element.style.display="none";
this.confirm_holder=$("wrapper_holder").appendChild(document.createElement("div"));
this.submitting_pane=new LoadingPanel(this.element);
this.dealersPages=[];
this.currentDealerPage=0;
this.selectedDealerIndex=0;
this.selectedDealerURL;
this.session_form_data;
var _8=(window.location+"").toQueryParams();
if(_8.lang&&_8.lang=="es"){
this.langString="es";
}
this.loadTemplate("/configurator/includes/contact_dealer"+this.ab_test_name+".html",{oncomplete:this.init_ontemplate.bind(this)});
if(App.use_static){
new Ajax.Request("/configurator/includes/example_getDealers.xml",{onComplete:this.init_ondata.bind(this)});
}else{
new Ajax.Request("/byt/pub/showDealers.do",{onComplete:this.init_ondata.bind(this)});
}
},init_ontemplate:function(){
this.template_loaded=true;
},changeTab:function(_9){
if(this.ab_test_version!=2){
return;
}
var _a=[1,2,3].find(function(_b){
return $("quote_tabs_"+_b).hasClassName("current_tab");
});
if(_9==_a||(_a==1&&_9==3)){
this.blurTabs();
return;
}
if(_a==2&&_9==3){
var _c=this.getFormData();
var _d=this.validate(_c);
if(_d.errs!="dealerCode"&&_d.errs!=""){
this.blurTabs();
return;
}else{
$("cd_select_dealer_error").style.display="none";
$("dealer_header_and_error").innerHTML="";
}
}
$("quote_request_form").className="tab_step_"+_9;
this.blurTabs();
[1,2,3].each(function(_e){
$("quote_tabs_"+_e).className="";
});
$("quote_tabs_"+_9).className="current_tab";
if(_9==1){
$("quote_tabs_3").className="inactivetab";
}
if(_9==3){
this.showMapForSelectedDealer();
}
},blurTabs:function(){
[1,2,3].each(function(_f){
$$("#quote_tabs_"+_f+" a")[0].blur();
});
$$("#continue_button a")[0].blur();
$$("#continue_button_2 a")[0].blur();
},showMapForSelectedDealer:function(){
new Ajax.Request("/byt/pub/dealerMap.do?&dealerCode="+((this.selected_dealer)?this.selected_dealer.id:this.dealers[0].id)+"&position=0&lang=&zipCode="+App.zip_code+"&maponly=true",{method:"get",onSuccess:function(_10){
var _11=_10.responseText.evalJSON();
$("dlrimg_tab3").src=_11.mapurl;
}});
},init_ondata:function(_12){
var xml=XML.getRootNode(_12.responseXML);
this.dealers=[];
$NL(xml.getElementsByTagName("dealer")).each(function(_14){
var d=new Dealer();
d.initWithXML(_14);
this.dealers.push(d);
}.bind(this));
this.data_loaded=true;
NotificationCenter.sendNotification("Dealers List Loaded",[this.dealers]);
},raqAgain:function(){
this.selected_dealer={};
this.session_form_data=this.getFormData();
App.contact_dealer.dismiss();
App.requestDealerQuote();
},triggerMapRequest:function(_16){
var _17=this.dealers.find(function(d){
return d.id==_16;
});
_17.popupMap(_17.position);
},triggerDealerList:function(){
if(App.tracker.is_summary_page){
this.justParams=window.location.href.replace(/^.*?\?/i,"");
}else{
this.justParams="seriesCategory="+App.vehicle.series.id+"&zipCode="+App.zip_code+"&modelId="+(App.vehicle.model)?App.vehicle.model.id:""+"&packageId="+App.vehicle.pkg.id+"&exteriorColorId="+App.vehicle.extColor.id+"&interiorId="+App.vehicle.intColor.id+"#";
}
this.current_view="DEALERLIST";
this.element.innerHTML=this.templates["contact_dealer_list"].evaluate({"user_zip":App.zip_code});
this.currentDealerPage=0;
this.firstDealerPageIsPma=false;
this.dealersPages=[];
var _19=this.dealers.findAll(function(d){
return d.pma;
});
var _1b=6;
if(this.ab_test_version>0){
_1b=5;
}
if(_19.length<_1b&&_19.length>0){
this.firstDealerPageIsPma=true;
this.dealersPages.push(_19);
}
this.dealers.eachSlice(_1b).each(function(s){
this.dealersPages.push(s);
}.bind(this));
this.dealers.each(function(dlr,_1e){
dlr.position=_1e;
}.bind(this));
this.dealersPages.each(function(_1f,_20){
var _21=_1f.collect(function(_22){
return this.templates["contact_dealer_item"].evaluate(_22);
}.bind(this)).join("");
var _23=document.createElement("div");
var _24="dealersPage"+_20;
_23.setAttribute("id",_24);
_23.innerHTML=_21;
_23.className="dealerPage";
$("contact_dealer_list").appendChild(_23);
}.bind(this));
$("dealersPage0").style.visibility="visible";
if(this.dealersPages.length>1){
$("dealer_pagination_holder").style.visibility="visible";
}
this.attachCloseEvent();
this.default_header_text=$("dealer_header_and_error").innerHTML;
if(this.ab_test_version==0){
var _25=document.getElementsByClassName("dealer");
$$(".dealerPage").each(function(d){
var _27=d.getElementsByClassName("dealer");
for(i=0;i<_27.length;i++){
if(i%2!=0){
_27[i].style.background="#e8e8e8";
}
}
}.bind(this));
}
var _28=window.location+"";
var _29=_28.toLowerCase().toQueryParams();
if(this.zip_code==undefined){
this.zip_code=_29.zipcode;
}
$("cd_zip").value=this.zip_code;
Element.hide(this.covered_content);
Element.show(this.element);
this.element.style.visibility="visible";
if(this.ab_test_version>0){
$("quote_summary").innerHTML+=this.templates["contact_dealer_vehic_summary"].evaluate({series_name_up:App.vehicle.series.name.toUpperCase(),model_year:(App.tracker.is_summary_page)?pageVehicle.year:App.vehicle.model.year,series_name:App.vehicle.series.name,model_msrp:(App.tracker.is_summary_page)?pageVehicle.msrp:"$"+App.vehicle.model.msrp.moneyFormat(),desc_sum:(App.tracker.is_summary_page)?$("desc_sum_info").innerHTML:((App.vehicle.model.bed)?App.vehicle.model.bed.name+", ":"")+((App.vehicle.model.cab)?App.vehicle.model.cab.name+", ":"")+((App.vehicle.model.drive)?App.vehicle.model.drive.name+", ":"")+((App.vehicle.model.engine)?App.vehicle.model.engine.name+", ":"")+((App.vehicle.model.transmission)?App.vehicle.model.transmission.name:""),pkg_msrp:(App.tracker.is_summary_page)?pageVehicle.pkg_msrp:"$"+App.vehicle.pkg.msrp.moneyFormat(),pkg_name:(App.tracker.is_summary_page)?($("package_name_holder").innerHTML):App.vehicle.pkg.name,color_msrp:(App.tracker.is_summary_page)?pageVehicle.color_msrp:"$"+(App.vehicle.extColor.msrp+App.vehicle.intColor.msrp).moneyFormat(),extcolor_name:(App.tracker.is_summary_page)?pageVehicle.extcolor_name:App.vehicle.extColor.name,intcolor_name:(App.tracker.is_summary_page)?pageVehicle.intcolor_name:App.vehicle.intColor.name,acc_msrp:(App.tracker.is_summary_page)?pageVehicle.acc_msrp:"$"+App.vehicle.userAccessories.pluck("msrp").inject(0,function(acc,n){
return acc+n;
}).moneyFormat(),fee_msrp:(App.tracker.is_summary_page)?pageVehicle.fee_msrp:"$"+App.vehicle.fee.moneyFormat(),total_msrp:(App.tracker.is_summary_page)?pageVehicle.total_msrp:"$"+App.vehicle.totalMsrp.moneyFormat(),model_color_image_id:(App.tracker.is_summary_page)?pageVehicle.model_color_image_id:App.vehicle.extColor.model_color_image_id});
if((document.all)&&(!window.XMLHttpRequest)){
setTimeout(function(){
$("vehic_img_sum").src=$("vehic_img_sum").src;
},10);
}
if(this.ab_test_version==2){
$("step2_vehic_sum").innerHTML+=$("quote_summary").innerHTML;
$$("#step2_vehic_sum .yourname")[0].innerHTML+=" <span class=\"msr\">&nbsp;"+$$("#step2_vehic_sum .total_sum")[0].innerHTML+"</span>";
}
if(this.firstDealerPageIsPma==true){
$("dealer_pagination_holder").addClassName("pma");
}else{
this.updatePaginationCount();
}
this.modal_backdrop=new ModalBackdrop();
}
if(this.ab_test_version>0&&this.session_form_data!=null){
$("cd_first_name").value=this.session_form_data.firstName;
$("cd_last_name").value=this.session_form_data.lastName;
$("cd_email").value=this.session_form_data.email;
$("cd_phone_1").value=this.session_form_data.homePhoneA;
$("cd_phone_2").value=this.session_form_data.homePhoneB;
$("cd_phone_3").value=this.session_form_data.homePhoneC;
$("cd_comments").value=this.session_form_data.comments;
}
NotificationCenter.sendNotification("Contact Dealer Popup: Trigger Dealer List");
},showPkgOver:function(){
this.modal_backdrop.enable();
if($$("#pkg_det_over").length>0){
$("pkg_det_over").remove();
}
var _2c="<div id=\"pkg_det_over\">"+((App.tracker.is_summary_page)?($("options_details_holder").innerHTML):App.packages_pane.showPackageDetails(App.vehicle.pkg))+"</div>";
new Insertion.Bottom($$("body")[0],_2c);
this.pkg_over_scale_nine=new ScaleNine($("pkg_det_over"),{tl:{image:"/configurator/images/conflict_backdrop/conflict_box_01.png",width:9,height:9},tm:{image:"/configurator/images/conflict_backdrop/conflict_box_02.png",width:2,height:9},tr:{image:"/configurator/images/conflict_backdrop/conflict_box_03.png",width:9,height:9},ml:{image:"/configurator/images/conflict_backdrop/conflict_box_04.png",width:9,height:3},mm:{color:"#FFFFFF"},mr:{image:"/configurator/images/conflict_backdrop/conflict_box_06.png",width:9,height:3},bl:{image:"/configurator/images/conflict_backdrop/conflict_box_07.png",width:9,height:9},bm:{image:"/configurator/images/conflict_backdrop/conflict_box_08.png",width:2,height:9},br:{image:"/configurator/images/conflict_backdrop/conflict_box_09.png",width:9,height:9}});
this.pkg_over_scale_nine.render();
Configurator.PopupCommon.positionCenter($("pkg_det_over"));
this.pkg_over_scale_nine.resize();
if(!App.tracker.is_summary_page){
new Insertion.Bottom($$("#pkg_det_over .packagesDetailMarginsDiv")[0],"<div id=\"options_details_close\" class=\"popup_close_button\" style=\"position: absolute; right: 5px; top: 5px;\"><a href=\"javascript:;\" onmouseover=\"App.swapImage('options_details_close_button','/configurator/images/summary_page/popup_close_button_on.png')\" onmouseout=\"App.swapImage('options_details_close_button','/configurator/images/summary_page/popup_close_button_off.png')\"><img src=\"/configurator/images/summary_page/popup_close_button_off.png\" id=\"options_details_close_button\" class=\"png\" width=\"25\" height=\"26\">");
}
Event.observe($$("#pkg_det_over .popup_close_button a")[0],"click",function(){
if(App.contact_dealer&&App.contact_dealer.modal_backdrop&&App.contact_dealer.modal_backdrop.element.style.display=="block"){
App.contact_dealer.modal_backdrop.disable();
$("pkg_det_over").hide();
}
}.bind(this));
},showDisclaim:function(){
App.disclaimer_pane.showDisclaimers("your vehicle");
this.modal_backdrop.enable();
$$("body")[0].appendChild($("disclaimer_holder").parentNode.removeChild($("disclaimer_holder")));
$("disclaimer_holder").addClassName("inoverlay");
App.disclaimer_pane.scale_nine.resize();
if((document.all)&&(!window.XMLHttpRequest)){
setTimeout(function(){
App.disclaimer_pane.showDisclaimers("your vehicle");
},10);
}
},showPkgDetails:function(){
},triggerEBrochure:function(_2d){
return window.open("/byt/pub/generateEBrochure.do?"+(App.vehicle.getParamList?App.vehicle.getParamList():justParams)+"&dealerCode="+_2d);
},selectDealer:function(_2e,_2f){
this.selected_dealer={};
this.selected_dealer=this.dealers.findByProperty("id",_2e+"");
this.selectedDealerIndex=_2f;
if(this.ab_test_version==2){
this.showMapForSelectedDealer();
}
},validateAndSubmit:function(){
if(this.submitting){
return false;
}
mboxTrack("Toyota_onClick","destination=RAQGetDealer");
var _30=this.getFormData();
var _31=this.validate(_30);
if(_31.is_valid){
this.submit(_30);
}
NotificationCenter.sendNotification("Contact Dealer: Validate and Submit",_31.errs);
return false;
},getFormData:function(){
if($("cd_preferred_phone").checked){
var _32="Phone";
}else{
if($("cd_preferred_email").checked){
var _32="Email";
}else{
var _32="Null";
}
}
var _33={firstName:$("cd_first_name").value,lastName:$("cd_last_name").value,address:$("cd_address").value,city:$("cd_city").value,state:$("cd_state").value,zip:$("cd_zip").value,email:$("cd_email").value,homePhoneA:$("cd_phone_1").value,homePhoneB:$("cd_phone_2").value,homePhoneC:$("cd_phone_3").value,homePhone:$("cd_phone_1").value+$("cd_phone_2").value+$("cd_phone_3").value,comments:$("cd_comments").value,preferredContact:_32,optIn:$("cd_get_info").checked?"true":"false",lang:this.langString?this.langString:""};
if(this.selected_dealer){
_33.dealerCode=this.selected_dealer.id;
}
return _33;
},validate:function(_34){
var _35=true;
var _36=[];
this.validation_events.each(function(e){
Event.stopObserving(e);
});
if(!_34.firstName||!_34.firstName.match(/^[a-z0-9 \-\,]+$/i)){
$("cd_first_name_error").style.display="block";
($("field_first_name"))?$("field_first_name").addClassName("error"):0;
_35=false;
_36[_36.length]="firstName";
}else{
$("cd_first_name_error").style.display="none";
($("field_first_name"))?$("field_first_name").removeClassName("error"):0;
}
if(!_34.lastName||!_34.lastName.match(/^[a-z0-9 \-\,]+$/i)){
$("cd_last_name_error").style.display="block";
($("field_last_name"))?$("field_last_name").addClassName("error"):0;
_35=false;
_36[_36.length]="lastName";
}else{
$("cd_last_name_error").style.display="none";
($("field_last_name"))?$("field_last_name").removeClassName("error"):0;
}
if(!_34.zip||!_34.zip.match(/^[0-9]{5}$/)){
$("cd_zip_error").style.display="block";
($("field_zip"))?$("field_zip").addClassName("error"):0;
_35=false;
_36[_36.length]="zip";
}else{
$("cd_zip_error").style.display="none";
($("field_zip"))?$("field_zip").removeClassName("error"):0;
}
if(!_34.email||!_34.email.match(/^[a-z0-9\-\._+]+@[a-z0-9-_\.]+\.[a-z0-9]{2,}$/i)){
$("cd_email_error").style.display="block";
($("field_email"))?$("field_email").addClassName("error"):0;
_36[_36.length]="email";
_35=false;
}else{
$("cd_email_error").style.display="none";
($("field_email"))?$("field_email").removeClassName("error"):0;
}
if(!_34.homePhone||!_34.homePhone.match(/^([0-9 .()\-x+]|(ext\.?)){10,}$/i)||_34.homePhone.replace(/\D/g,"").length>10||parseInt(_34.homePhoneA)<201||parseInt(_34.homePhoneB)<200){
$("cd_phone_error").style.display="block";
($("field_phone"))?$("field_phone").addClassName("error"):0;
_35=false;
_36[_36.length]="homePhone";
}else{
$("cd_phone_error").style.display="none";
($("field_phone"))?$("field_phone").removeClassName("error"):0;
}
if(!_34.dealerCode||_34.dealerCode==null){
$("cd_select_dealer_error").style.display="block";
_35=false;
_36[_36.length]="dealerCode";
}else{
$("cd_select_dealer_error").style.display="none";
}
if(_35==false){
this.displayRequired();
}else{
if(this.ab_test_version==0){
Element.update($("dealer_header_and_error"),"- &nbsp; Enter your contact information then select a Dealer to receive a quote for your configured vehicle.");
}
Element.removeClassName($("dealer_header_and_error"),"error");
}
return {is_valid:_35,errs:_36.join(",")};
},displayRequired:function(){
this.default_header_text=$("dealer_header_and_error").innerHTML;
Element.update($("dealer_header_and_error"),this.error_message);
Element.addClassName($("dealer_header_and_error"),"error");
},openDealerSite:function(){
(this.selectedDealerURL)?TMSSite.extlink.display(this.selectedDealerURL):0;
},submit:function(_38){
this.submitting=true;
this.submitting_pane.enable();
var _39=[];
for(key in _38){
_39.push(escape(key)+"="+escape(_38[key]));
}
try{
params=App.vehicle.getParamList()+"&"+_39.join("&");
}
catch(e){
params=justParams.replace(/#$/,"")+"&"+_39.join("&");
}
new Ajax.Request("/byt/pub/contactDealerSubmitXml.do",{method:"post",contentType:"application/x-www-form-urlencoded",parameters:params.toQueryParams(),onComplete:this.onSubmitComplete.bind(this)});
},onSubmitComplete:function(_3a){
this.submitting=false;
this.submitting_pane.disable();
try{
var _3b=new Status();
_3b.initWithXML(XML.getRootNode(_3a.responseXML));
Debug.log("Submitted request: ",_3a,_3b);
}
catch(e){
Debug.error(e);
}
var _3c="";
if(_3b.message.include("leadId")){
try{
_3c=_3b.message.match(/leadId\=\d+$/g)[0].match(/\d+/g);
}
catch(e){
Debug.error(e);
}
}
if(_3b.code=="200"){
if(this.ab_test_version==0){
try{
this.confirm_holder.innerHTML=this.templates["contact_dealer_thank_you"].evaluate();
this.confirm_holder.className="contact_dealer_confirm";
this.confirm_holder.style.display="block";
this.element.style.display="none";
Element.show(this.covered_content);
this.current_view="THANKYOU";
NotificationCenter.sendNotification("Contact Dealer Popup: Trigger Request Complete",[$("cd_get_info").checked?true:false,_3c]);
}
catch(e){
}
}else{
var _3d=this.getFormData();
var _3e=this.dealers.find(function(d){
return d.id==_3d.dealerCode;
});
this.confirm_holder.innerHTML=this.templates["contact_dealer_thank_you"].evaluate({sum_vehicle:App.vehicle.series.name,sum_color:(App.tracker.is_summary_page)?pageVehicle.extcolor_name:App.vehicle.extColor.name,sum_interior:(App.tracker.is_summary_page)?pageVehicle.intcolor_name:App.vehicle.intColor.name,sum_name:_3d.firstName+" "+_3d.lastName,sum_zip:_3d.zip,sum_email:_3d.email,sum_phone:_3d.homePhone,sum_comments:(_3d.comments.length>150)?(_3d.comments.substr(0,150)+" ..."):_3d.comments,dlr_name:(_3e.name)?_3e.name:"",dlr_address1:(_3e.address1)?_3e.address1:"",dlr_city:(_3e.city)?_3e.city:"",dlr_state:(_3e.state)?_3e.state:"",dlr_zip:(_3e.namezip)?_3e.zip:"",dlr_phone:(_3e.phone)?_3e.phone:"",dlr_id:(_3e.id)?_3e.id:""});
new Ajax.Request("/byt/pub/dealerMap.do?&dealerCode="+_3d.dealerCode+"&position=0&lang=&zipCode="+_3d.zip+"&maponly=true",{method:"get",onSuccess:function(_40){
var _41=_40.responseText.evalJSON();
$("dlrimg").src=_41.mapurl;
App.contact_dealer.selectedDealerURL=_41.dealerurl;
$("dlrhours").innerHTML=(_41.hours!="")?"<span class=\"infoname\">Sales Hours:</span><br />"+App.contact_dealer.parseDealerHours(_41.hours)+"<span class=\"no_print\"><br /></span>":"";
}});
this.confirm_holder.style.display="block";
this.element.style.display="none";
this.current_view="THANKYOU";
NotificationCenter.sendNotification("Contact Dealer Popup: Trigger Request Complete",[$("cd_get_info").checked?true:false,_3c]);
}
}else{
if(_3b.code=="510"&&App&&App.fatalError){
this.dismiss();
App.fatalError(_3b);
}else{
$("cd_error_message").innerHTML="There was an error submitting your request.  Please try again later.";
}
}
},parseDealerHours:function(_42){
if(_42==null||_42.length==0){
return "";
}else{
var _43="";
var _44=["Mon","Tues","Wed","Thur","Fri","Sat","Sun"];
_42=_42.substring(_42.indexOf(":")+1);
if(_42.startsWith("[")){
_42=_42.substring(1,_42.length-1);
}
days=_42.replace(/[0-7]\(/g,"").replace(/[\(\)]/g,"").split(", ");
days.each(function(day,xdx){
if(day==days[xdx+1]){
return;
}
var _47=xdx;
if((_47-1>0)&&day==days[xdx-1]){
while(_47>-1&&day==days[_47-1]){
_47--;
}
_43+=_44[_47]+"-"+_44[xdx]+": ";
}else{
_43+=_44[xdx]+": ";
}
day.split("&gt;").each(function(_48,idx){
var _4a=_48.slice(0,2).replace(/^0/,"");
if(_4a=="-1"){
(idx)?_43+="Closed":0;
return;
}
var _4b=" am";
if(parseInt(_4a)>12){
_4b=" pm";
_4a-=12;
}
_43+=_4a+":"+_48.slice(3,5)+_4b+((!idx)?" - ":"");
});
_43+="<br />";
});
return _43;
}
},paginateDealersNext:function(){
if($("dealer_pagination_next").className=="next_button_inactive"){
$$("#dealer_pagination_next a")[0].blur();
return;
}
$("dealer_pagination_holder").removeClassName("pma");
var _4c="dealersPage"+this.currentDealerPage;
$(_4c).style.visibility="hidden";
this.currentDealerPage+=1;
var _4d="dealersPage"+this.currentDealerPage;
$(_4d).style.visibility="visible";
if((this.currentDealerPage+1)==this.dealersPages.length){
if(this.ab_test_version>0){
$("dealer_pagination_next").className="next_button_inactive";
}else{
$("dealer_pagination_next").style.visibility="hidden";
}
}
if(!((this.firstDealerPageIsPma==true)&&(this.currentDealerPage==1))){
if(this.ab_test_version>0){
$("dealer_pagination_back").className="";
}else{
$("dealer_pagination_back").style.visibility="visible";
}
}
if(this.ab_test_version>0){
this.updatePaginationCount();
}
NotificationCenter.sendNotification("Dealer List: Show More");
$$("#dealer_pagination_next a")[0].blur();
},paginateDealersBack:function(){
if($("dealer_pagination_back").className=="back_button_inactive"){
$$("#dealer_pagination_back a")[0].blur();
return;
}
var _4e="dealersPage"+this.currentDealerPage;
$(_4e).style.visibility="hidden";
this.currentDealerPage-=1;
var _4f="dealersPage"+this.currentDealerPage;
$(_4f).style.visibility="visible";
if((this.currentDealerPage==0)||(this.firstDealerPageIsPma==true&&this.currentDealerPage==1)){
if(this.ab_test_version>0){
$("dealer_pagination_back").className="back_button_inactive";
}else{
$("dealer_pagination_back").style.visibility="hidden";
}
}
if(this.ab_test_version>0){
$("dealer_pagination_next").className="";
}else{
$("dealer_pagination_next").style.visibility="visible";
}
if(this.ab_test_version>0){
this.updatePaginationCount();
}
$$("#dealer_pagination_back a")[0].blur();
},updatePaginationCount:function(){
var _50=((this.currentDealerPage-this.firstDealerPageIsPma)+1);
if(this.dealersPages.length-this.firstDealerPageIsPma==_50){
$("dealer_pagination_index").innerHTML=(_50*5)-4+" - "+this.dealers.size()+" of "+this.dealers.size();
}else{
$("dealer_pagination_index").innerHTML=(_50*5)-4+" - "+_50*5+" of "+this.dealers.size();
}
},attachCloseEvent:function(){
document.getElementsByClassName("close_button",this.element).each(function(btn){
if(App.tracker.is_summary_page&&this.ab_test_version>0){
Event.observe(btn,"click",function(){
App.handleEditClick("model");
}.bind(this));
}else{
Event.observe(btn,"click",this.dismiss.bind(this));
}
btn.style.display="none";
setTimeout(function(){
btn.style.display="";
},10);
}.bind(this));
},dismiss:function(){
this.element.style.display="none";
this.confirm_holder.style.display="none";
this.current_view="";
Element.show(this.covered_content);
}});
}

with(Configurator){
Configurator._Warranty=Class.create(ControllerCommon,PopupCommon,{initialize:function(_1){
this.events=[];
this.element=document.createElement("div");
this.element.className="warranty";
this.element.style.display="none";
this.updater=new Ajax.Updater(this.element,"/configurator/includes/warranty.html",{method:"get",onComplete:this.handleOnComplete.bind(this)});
if($("wrapper")){
$("wrapper").appendChild(this.element);
}else{
Event.observe(window,"load",function(){
if($("wrapper")){
$("wrapper").appendChild(this.element);
}
}.bind(this));
}
},handleOnComplete:function(){
Event.asap(function(){
if($("warrantyRightContentHolder")){
new ScrollBox($("warrantyRightContentHolder"),{auto_hide:true});
}
});
},trigger:function(_2){
this.element.style.visibility="hidden";
this.element.style.display="";
this.element.style.visibility="";
},dismiss:function(){
this.element.style.display="none";
}});
}
Configurator.Warranty=new Configurator._Warranty();

with(Configurator){
Configurator._ErrorDialog=Class.create(ControllerCommon,PopupCommon,{initialize:function(_1){
this.loadTemplate("/configurator/includes/error_dialog.html",{name:"err_templates",onComplete:this.init_onpartials.bind(this)});
this.events=[];
this.element=document.createElement("div");
this.element.className="error_dialog";
this.element.style.display="none";
this.scale_nine=new ScaleNine(this.element,{tl:{image:"/configurator/images/conflict_backdrop/conflict_box_01.png",width:9,height:9},tm:{image:"/configurator/images/conflict_backdrop/conflict_box_02.png",width:2,height:9},tr:{image:"/configurator/images/conflict_backdrop/conflict_box_03.png",width:9,height:9},ml:{image:"/configurator/images/conflict_backdrop/conflict_box_04.png",width:9,height:3},mm:{color:"#FFFFFF"},mr:{image:"/configurator/images/conflict_backdrop/conflict_box_06.png",width:9,height:3},bl:{image:"/configurator/images/conflict_backdrop/conflict_box_07.png",width:9,height:9},bm:{image:"/configurator/images/conflict_backdrop/conflict_box_08.png",width:2,height:9},br:{image:"/configurator/images/conflict_backdrop/conflict_box_09.png",width:9,height:9}});
if(document.body){
this.modal_backdrop=new ModalBackdrop($("container"));
Element.addClassName(this.modal_backdrop.element,"conflict_backdrop");
document.body.appendChild(this.element);
if(this.needs_trigger){
this.trigger(this.needs_trigger);
this.needs_trigger=false;
}
}else{
Event.onDOMReady(function(){
this.modal_backdrop=new ModalBackdrop($("container"));
Element.addClassName(this.modal_backdrop.element,"conflict_backdrop");
document.body.appendChild(this.element);
if(this.needs_trigger){
this.trigger(this.needs_trigger);
this.needs_trigger=false;
}
}.bind(this));
}
},init_onpartials:function(){
this.partials_loaded=true;
},reposition:function(_2,_3){
if(!_3){
this.positionCenter(this.element);
return;
}
switch(_2){
case "BELOW":
var _4=Configurator.PopupCommon.positionBelowElement(this.element,_3,{return_only:true});
this.element.style.top=(_4.top+3)+"px";
this.element.style.left=(_4.left)+"px";
break;
default:
this.positionCenter(this.element);
}
},trigger:function(_5){
if(!this.modal_backdrop){
this.needs_trigger=_5;
}
this.events.push(Event.observe(this.element,"click",this.dontBubbleClose.bindAsEventListener(this)));
this.events.push(Event.observe(document.body,"click",this.dismiss.bind(this)));
var _6=[];
if(_5.options){
_5.options.each(function(o,i){
_6.push(this.templates["err_option"].evaluate(Object.extend({i:i},o)));
}.bind(this));
}
this.element.innerHTML=this.templates["error_dialog"].evaluate(Object.extend({option_list:_6.join("")},_5));
if(_5.closable!==false){
this.events.push(Event.observe($("err_close_button"),"click",this.dismiss.bind(this)));
$("err_close_button").style.display="";
}else{
$("err_close_button").style.display="none";
}
this.onClose=_5.onClose||false;
if(_5.options){
var _9=document.getElementsByClassName("err_option",this.element,"a");
_5.options.each(function(o,i){
if(o.clickAction&&_9[i]){
this.events.push(Event.observe(_9[i],"click",o.clickAction));
}else{
}
}.bind(this));
}
this.element.style.visibility="hidden";
this.element.style.display="";
this.scale_nine.render();
(_5.reposition)?this.reposition(_5.reposition.position,_5.reposition.target):this.reposition();
this.element.style.visibility="";
NotificationCenter.sendNotification("Error Dialog Triggered",(_5.name)?_5.name:"");
},dontBubbleClose:function(_c){
Event.stop(_c);
},dismiss:function(){
this.events.each(function(e){
Event.stopObserving(e);
});
this.events=[];
this.element.style.display="none";
this.modal_backdrop.disable();
if(this.onClose){
this.onClose();
}
}});
}
Configurator.ErrorDialog=new Configurator._ErrorDialog();

with(Configurator){
Configurator.Tracking=Class.create({initialize:function(_1){
this.omni_queue=[];
this.vehicle=_1;
this.is_complete=false;
this.is_changed=false;
this.complete_submitted=false;
this.modelString="";
this.is_summary_page=false;
this.first_tag_fire=true;
var _2=(window.location+"").toLowerCase().toQueryParams();
if(_2.lang&&_2.lang=="es"){
this.langString="_es";
}else{
this.langString="";
}
NotificationCenter.addSubscriber("Tab Changed",this,this.onTabChange);
NotificationCenter.addSubscriber("MSRP Updated",this,this.onMSRPUpdate);
NotificationCenter.addSubscriber("Compare Popup: Trigger",this,this.onCompare);
NotificationCenter.addSubscriber("Contact Dealer Popup: Trigger Dealer List",this,this.onShowDealers);
NotificationCenter.addSubscriber("Contact Dealer Popup: Trigger Request Complete",this,this.onRequestAQuoteThankYou);
NotificationCenter.addSubscriber("Contact Dealer: Validate and Submit",this,this.onSendButtonClick);
NotificationCenter.addSubscriber("Email Summary Trigger",this,this.onEmailSummary);
NotificationCenter.addSubscriber("Email Summary Sent",this,this.onEmailSend);
NotificationCenter.addSubscriber("Summary Print",this,this.onSummaryPrint);
NotificationCenter.addSubscriber("Build Page Ready",this,this.onBuildPageReady);
NotificationCenter.addSubscriber("Summary Click Warranty",this,this.onSummaryWarranty);
NotificationCenter.addSubscriber("Summary Click Brochure",this,this.onSummaryBrochure);
NotificationCenter.addSubscriber("Summary Click Features",this,this.onSummaryFeatures);
NotificationCenter.addSubscriber("Summary Click Specs",this,this.onSummarySpecs);
NotificationCenter.addSubscriber("Summary Click Estimate Payments",this,this.onEstimatePayments);
NotificationCenter.addSubscriber("Summary Click Dealer Quote Submit",this,this.onDealerQuoteSubmit);
NotificationCenter.addSubscriber("Summary Click Close",this,this.onClose);
NotificationCenter.addSubscriber("Summary Click Continue",this,this.onContinue);
NotificationCenter.addSubscriber("Summary Click Credit Apply",this,this.onCreditApply);
NotificationCenter.addSubscriber("RAQ Sent: Click Print",this,this.onRAQThxPrint);
NotificationCenter.addSubscriber("RAQ Sent: Click Credit Apply",this,this.onRAQThxCreditApply);
NotificationCenter.addSubscriber("RAQ Sent: Click Estimate Payments",this,this.onRAQThxEstimatePayments);
NotificationCenter.addSubscriber("Error Dialog Triggered",this,this.onErrorDialog);
NotificationCenter.addSubscriber("Zip Updated",this,this.onZipUpdate);
NotificationCenter.addSubscriber("Confirm Panel Confirmed",this,this.onConfirm);
NotificationCenter.addSubscriber("Summary Page Link",this,this.onSummaryLink);
NotificationCenter.addSubscriber("Dealer List: Show More",this,this.onShowMoreDealers);
NotificationCenter.addSubscriber("Show Maps",this,this.onShowMaps);
NotificationCenter.addSubscriber("Summary Page Init",this,this.onSummaryInit);
if(this.langString=="_es"){
this.doubleClickTags={totalTraffic_es:"http://ad.doubleclick.net/activity;src=663059;type=conill;cat=traffic;ord=#{a}?",totalQualified_es:"http://ad.doubleclick.net/activity;src=663059;type=conill;cat=qualify;ord=#{a}?"};
}else{
this.doubleClickTags={totalTraffic:"http://ad.doubleclick.net/ad/N2724.deduped_spotlight/B1009212;sz=1x1;tag=total_traffic;ord=#{a}?",totalQualified:"http://ad.doubleclick.net/ad/N2724.deduped_spotlight/B1009212.2;sz=1x1;tag=total_qualified;ord=#{a}?",handraiser:"https://ad.doubleclick.net/ad/N2724.deduped_spotlight/B1009212.30;sz=1x1;TAG=Std_TCOM_Thank_You_Handraiser;ord=#{a}?",lead:"http://ad.doubleclick.net/ad/N2724.deduped_spotlight/B1009212.13;sz=1x1;TAG=Contact_Dealer_Thank_You_Lead;ord=#{a}?"};
}
this.dbleClickRegions={TDA10:["TDA10","CON10","GNY10","TRI10","UST10"],WWN10:["WWN10"]};
this.asapEvent(function(){
this.element=document.body.appendChild(document.createElement("div"));
this.element.setAttribute("id","tracking_div");
this.element.style.height="1px";
this.element.style.width="1px";
this.element.style.visibility="hidden";
this.element.style.overflow="hidden";
this.dom_is_ready=true;
this.omni_element=this.element.appendChild(document.createElement("div"));
this.xpo_element=this.element.appendChild(document.createElement("div"));
Event.observe(window,"unload",this.onUnload.bind(this),false);
Event.observe(document.body,"unload",this.onUnload.bind(this),false);
}.bind(this));
this.omni_submit_interval=setInterval(this.performOmniSubmit.bind(this),500);
},asapEvent:function(_3){
if(document.body){
_3();
}else{
Event.observe(window,"load",_3);
}
},includeExternalUrl:function(_4){
var sc=document.createElement("iframe");
sc.src=_4;
this.xpo_element.appendChild(sc);
},includeExternalScript:function(_6){
var sc=document.createElement("iframe");
sc.name="xpoframe";
this.xpo_element.appendChild(sc);
window.frames["xpoframe"].document.write("<scr"+"ipt src=\""+_6+"\" type=\"text/javascript\"></scr"+"ipt>");
},includeTrackingImg:function(_8){
try{
var _9=document.createElement("img");
_9.src=_8;
this.xpo_element.appendChild(_9);
}
catch(e){
Debug.error(e);
}
},submitDoubleClick:function(_a){
if(_a&&_a!=null&&_a!=""){
var _b=Math.random()+"";
var a=_b*10000000000000;
var t=new Template(_a);
this.includeTrackingImg(t.evaluate({a:a,tda:App.tda}));
}
},resetAllProperties:function(){
s_events="";
s.events="";
if(this.vehicle&&this.vehicle.getSelectedAccessories){
var _e=this.vehicle.series?this.vehicle.series.name:"";
if(_e.toLowerCase()=="venza"){
_e=_e.toUpperCase();
}
this.modelString=_e+"|";
this.modelString+=(this.vehicle.model&&this.vehicle.model.grade)?this.vehicle.model.grade.name.replace("Venza","VENZA")+"|":"|";
this.modelString+=(this.vehicle.model&&this.vehicle.model.transmission)?this.vehicle.model.transmission.name+"|":"|";
this.modelString+=this.vehicle.model?this.vehicle.model.engine.name+"|":"|";
this.modelString+=(this.vehicle.model&&this.vehicle.model.drive.name)?this.vehicle.model.drive.name+"|":"|";
this.modelString+=(this.vehicle.model&&this.vehicle.model.cab.name)?this.vehicle.model.cab.name+"|":"|";
this.modelString+=this.vehicle.extColor?this.vehicle.extColor.name+"|":"|";
this.modelString+=this.vehicle.intColor?this.vehicle.intColor.name+"|":"|";
this.modelString+=this.vehicle.pkg?this.vehicle.pkg.accessories.pluck("code").join(",")+"|":"|";
this.modelString+=this.vehicle.userAccessories.pluck("code").join(",");
}
if(this.vehicle){
s.pageName="";
s.channel=this.omniTemplate("#{omniMarket}:#{series_name}");
s.pageType="";
s.prop1=this.vehicle.model?this.vehicle.model.code:"";
if(s.prop1==""&&(typeof init_vehicCode=="string")){
s.prop1=init_vehicCode;
}
s_prop1=s.prop1;
s.prop2="";
s_prop2="";
s.prop3="";
s_prop3="";
s.prop4="";
s_prop4="";
s.prop5="";
s_prop5="";
s.prop6="";
s_prop6="";
s.prop7="";
s_prop7="";
s.prop8="";
s_prop8="";
s.prop9="";
s_prop9="";
s.prop10=this.omniTemplate("#{omniMarket}:BYT");
s_prop10=s.prop10;
s.prop11=this.omniTemplate("#{omniMarket}:#{series_name}:BYT");
s_prop11=s.prop11;
s.prop14="";
s_prop14="";
s.prop15="";
s_prop15="";
s.prop16="";
s_prop16="";
s.prop21="";
s_prop21="";
s.prop22="";
s_prop22="";
s.prop23="";
s_prop23="";
s.prop24="";
s_prop24="";
s.prop25="";
s_prop25="";
s.prop29="";
s_prop29="";
s.prop30="";
s_prop30="";
s.prop31="";
s_prop31="";
s.prop32="";
s_prop32="";
s.prop46="";
s_prop46="";
s.eVar1=s.prop1;
s_eVar1=s_prop1;
s.eVar3="";
s_eVar3="";
s.eVar6="";
s_eVar6="";
s.eVar7="";
s_eVar7="";
s.eVar10=this.omniTemplate("#{omniMarket}:BYT");
s_eVar10=s.eVar10;
s.eVar11=this.omniTemplate("#{omniMarket}:#{series_name}:BYT");
s_eVar11=s.eVar11;
s.eVar12="";
s_eVar12="";
s.eVar14="";
s_eVar14="";
s.eVar15="";
s_eVar15="";
s.eVar16="";
s_eVar16="";
s.eVar17="";
s_eVar17="";
s.eVar18="";
s_eVar18="";
s.eVar19="";
s_eVar19="";
s.eVar20="";
s_eVar20="";
s.eVar25="";
s_eVar25="";
s.products="";
s_products="";
s.events="";
s_events="";
s.linkName="";
s_linkName="";
}
},performOmniSubmit:function(){
try{
if(this.dom_is_ready&&this.omni_queue.length){
var _f=false;
this.resetAllProperties();
var obj=this.omni_queue.shift();
for(i in obj){
if((typeof i!="function")&&(window.s[i]!=undefined)){
window.s[i]=obj[i];
}else{
if(typeof i!="function"){
window[i]=obj[i];
}
}
if(i=="linkName"){
_f=true;
}
}
if(_f){
sendLinkEvent("",obj["linkName"],((obj["linkType"])?obj["linkType"]:"o"));
}else{
sendAnalyticsEvent("");
}
}
}
catch(e){
Debug.error(e);
}
},submitOmni:function(_11){
try{
_11=$H(_11);
_11.each(function(_12){
_11[_12.key]=this.omniTemplate(_12.value);
}.bind(this));
this.omni_queue.push(_11);
}
catch(e){
Debug.error(e);
}
},omniTemplate:function(_13){
if(typeof (_13)!="string"){
return _13;
}
if(init_vehicname){
var _14=init_vehicname;
}else{
var _14=(this.vehicle.series?this.vehicle.series.name:"");
}
if(_14.toLowerCase()=="venza"){
_14=_14.toUpperCase();
}
var _15=(this.vehicle.model&&this.vehicle.model.year)?this.vehicle.model.year:"";
if(_15==""&&pageVehicle&&pageVehicle.year){
_15=pageVehicle.year;
}
if(this.langString=="_es"){
om_market="Esp";
om_location="esp";
}else{
om_market="GM";
om_location="tcom";
}
var pn=new Template(_13||"");
return pn.evaluate({series_name:_14,omniMarket:om_market,omniLocation:om_location,model_year:_15,modelstring:this.modelString});
},onTabChange:function(msg,_18){
if(this.first_tag_fire){
NotificationCenter.addSubscriber("PanelComplete Status Change",this,this.onDeferTabChange);
}else{
this.omniTabChange(_18);
this.first_tag_fire=false;
}
this.current_tab=_18;
},onDeferTabChange:function(_19,_1a){
if(this.first_tag_fire&&_1a&&_1a.pane_name=="accessories"){
this.resetAllProperties();
this.omniTabChange(this.current_tab);
this.first_tag_fire=false;
}
},omniTabChange:function(tab){
this.resetAllProperties();
switch(tab){
case "model":
this.submitOmni({pageName:"#{omniMarket}:#{series_name}:BYT:Step 1 Select Model",events:["event3","event32"],eVar16:Math.round(App.vehicle.totalMsrp)+"",products:";;;;event32="+Math.round(App.vehicle.totalMsrp),prop32:"Lower",prop2:"#{model_year}",eVar15:App.zip_code});
break;
case "packages":
this.submitOmni({pageName:"#{omniMarket}:#{series_name}:BYT:Step 2 Select Options",prop32:"Lower",prop2:"#{model_year}"});
break;
case "colors":
this.submitOmni({pageName:"#{omniMarket}:#{series_name}:BYT:Step 3 Select Colors",prop32:"Lower",prop2:"#{model_year}",eVar15:App.zip_code});
break;
case "accessories":
this.submitOmni({pageName:"#{omniMarket}:#{series_name}:BYT:Step 4 Select Accessories",events:"",prop32:"Lower",prop2:"#{model_year}",eVar20:"#{modelstring}"});
break;
default:
break;
}
},onMSRPUpdate:function(msg){
if(this.complete_submitted){
this.is_changed=true;
}
},onBuildPageReady:function(){
this.submitDoubleClick(this.doubleClickTags["totalTraffic"]);
this.submitDoubleClick(this.doubleClickTags["totalQualified"]);
this.submitDoubleClick(this.doubleClickTags["totalTraffic_es"]);
this.submitDoubleClick(this.doubleClickTags["totalQualified_es"]);
var _1d=this.vehicle.series.name;
var _1e="";
var _1f=new Object();
_1f["Solara"]={en:"sobui333",es:""};
_1f["Venza"]={en:"vzbui279",es:"vzbui203"};
_1f["VENZA"]={en:"vzbui279",es:"vzbui203"};
_1f["Camry"]={en:"cybui385",es:"cybui784"};
_1f["Tundra"]={en:"tubui797",es:"tubui722"};
_1f["Corolla"]={en:"clbui876",es:"clbui018"};
_1f["Prius"]={en:"prbui948",es:"prbui910"};
_1f["Sequoia"]={en:"sqbui089",es:"sqbui680"};
_1f["Avalon"]={en:"avbui670",es:"avbui015"};
_1f["RAV4"]={en:"rvbui770",es:"rvbui843"};
_1f["Tacoma"]={en:"tabui498",es:"tabui760"};
_1f["Matrix"]={en:"mabui763",es:"mabui775"};
_1f["Yaris"]={en:"yrbui643",es:"yrbui253"};
_1f["FJ"]={en:"fjbui011",es:"fjbui162"};
_1f["Highlander"]={en:"hlbui102",es:"hlbui308"};
_1f["Sienna"]={en:"sibui352",es:"sibui103"};
_1f["Land Cruiser"]={en:"lcbui827",es:"lcbui191"};
_1f["4Runner"]={en:"frbui564",es:"frbui647"};
_1e=_1f[_1d];
if(this.langString=="_es"){
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=663059;type=flood187;cat="+_1e.es+";ord="+((Math.random()+"")*10000000000000)+"?");
}else{
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=621119;type=toyot994;cat="+_1e.en+";ord="+((Math.random()+"")*10000000000000)+"?");
}
try{
}
catch(e){
Debug.error(e);
}
},onSummaryLink:function(){
},onEmailSummary:function(){
this.submitOmni({prop2:"#{model_year}",eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Email Summary",eVar15:this.getSummaryPageZip(),eVar3:"#{omniLocation}_byt_emailsummary_#{series_name}",prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_emailsummary_#{series_name}",events:"event4",linkTrackVars:"prop1,prop2,prop7,prop46,eVar1,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4"});
this.submitOmni({prop2:"#{model_year}",eVar25:"#{omniMarket}:#{series_name}",prop32:"Lower",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),pageName:"#{omniMarket}:#{series_name}:BYT:Email Summary"});
this.submitDoubleClick("http://ad.doubleclick.net/ad/N2724.deduped_spotlight/B1869940.5;sz=1x1;tag=Config_Email_eBrochure_#{tda};ord=#{a}?");
},onEmailSend:function(){
this.submitOmni({prop2:"#{model_year}",pageName:"#{omniMarket}:#{series_name}:BYT:Email Summary Confirmation",events:"event10",prop32:"Lower",eVar15:this.getSummaryPageZip()});
},onSummaryPrint:function(){
this.submitOmni({prop2:"#{model_year}",eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Print Summary",events:"event4,event9",eVar3:"#{omniLocation}_byt_printsummary_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_printsummary_#{series_name}",linkTrackVars:"prop1,prop2,prop7,prop36,prop46,eVar1,eVar3,eVar15,eVar25,eVar36,events",linkTrackEvents:"event4,event9"});
},onRAQThxPrint:function(){
this.submitOmni({prop2:"#{model_year}",eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:RAQ Confirmation:Print Summary",events:"event4,event9",eVar3:"#{omniLocation}_byt_raqconfirm_printpage_#{series_name}",eVar15:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),prop7:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_raqconfirm_printpage_#{series_name}",linkTrackVars:"prop1,prop2,prop7,prop36,prop46,eVar1,eVar3,eVar15,eVar25,eVar36,events",linkTrackEvents:"event4,event9"});
},onSummaryWarranty:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:View Warranty",events:"event4",eVar3:"#{omniLocation}_byt_warranty_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_warranty_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4"});
},onSummaryBrochure:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:View Brochure",events:"event4,event17",eVar3:"#{omniLocation}_byt_ebro_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_ebro_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4,event17",linkType:"d"});
},onEstimatePayments:function(){
this.submitOmni({eVar3:"Tcom_BYT_PayCalc_#{series_name}",prop22:"Tcom_BYT_PayCalc",pev2:"Tcom_BYT_PayCalc_#{series_name}",linkName:"Tcom_BYT_PayCalc_#{series_name}",linkTrackVars:"prop22,eVar3",linkType:"o"});
},onDealerQuoteSubmit:function(){
this.submitOmni({prop46:"GM:Survey:Site:Dealer Quote:Submit:Intercept",pev2:"tcom_survey_site_dealerquote_submit_intercept",linkName:"tcom_survey_site_dealerquote_submit_intercept",linkTrackVars:"prop46",linkType:"o"});
},onClose:function(){
this.submitOmni({prop46:"GM:Survey:Site:Calculator:#{series_name}:Close:Intercept",linkTrackVars:"prop46",linkName:"tcom_survey_site_calculator_#{series_name}_close_intercept",linkType:"o"});
},onContinue:function(){
this.submitOmni({prop46:"GM:Survey:Site:Calculator:#{series_name}:Continue:Intercept",linkName:"tcom_survey_site_calculator_#{series_name}_continue_intercept",linkTrackVars:"prop46",linkType:"o"});
},onRAQThxEstimatePayments:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:RAQ Confirmation:Estimate Payments",events:"event4,event14",eVar3:"#{omniLocation}_byt_raqconfirm_tfs_pymtcalc_#{series_name}",eVar15:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),prop7:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_raqconfirm_tfs_pymtcalc_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4,event14",linkType:"e"});
},onCreditApply:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Apply for Credit",events:"event4",eVar3:"#{omniLocation}_byt_tfs_OCA_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_tfs_OCA_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4",linkType:"e"});
},onRAQThxCreditApply:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:RAQ Confirmation:Apply for Credit",events:"event4",eVar3:"#{omniLocation}_byt_raqconfirm_tfs_OCA_#{series_name}",eVar15:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),prop7:(App.zip_code)?App.zip_code:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_raqconfirm_tfs_OCA_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4",linkType:"e"});
},onSummaryFeatures:function(){
this.submitOmni({pageName:"GM : Next Gen Configurator : #{series_name} : Standard Features"});
},onSummarySpecs:function(){
this.submitOmni({pageName:"GM : Next Gen Configurator : #{series_name} :  Specifications"});
},getSummaryPageZip:function(){
var _20=window.location+"";
var _21=_20.toLowerCase().toQueryParams();
var _22="";
if(_21.zipcode){
_22=_21.zipcode;
}
return _22;
},onSendButtonClick:function(_23,_24){
this.submitDoubleClick(this.doubleClickTags["totalTraffic"]);
this.submitDoubleClick(this.doubleClickTags["totalQualified"]);
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=621119;type=bat30482;cat=resea250;ord="+((Math.random()+"")*10000000000000)+"?");
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=621119;type=bat30392;cat=bat30425;ord="+((Math.random()+"")*10000000000000)+"?");
if(_24!=null&&_24!=""){
this.submitOmni({prop29:"#{omniMarket}:#{series_name}:BYT:Quote Request",prop30:_24,linkName:"#{omniLocation}_byt_raq_errors",linkTrackVars:"prop29,prop30"});
}else{
this.submitOmni({prop46:"#{omniMarket}:#{series_name}:BYT:RAQ:Get A Quote",events:"event4",eVar3:"#{omniLocation}_byt_raq_get_dealer_quote",linkName:"#{omniLocation}_byt_raq_get_dealer_quote",linkTrackVars:"prop7,eVar3,prop46,events",linkTrackEvents:"event4"});
}
},onRequestAQuoteThankYou:function(_25,_26,_27){
this.zip_code=(App.zip_code)?App.zip_code:App.contact_dealer.zip_code;
this.submitOmni({eVar7:(_27)?_27:"",prop7:this.zip_code,eVar15:this.zip_code,eVar14:(App.contact_dealer.selected_dealer)?parseInt(App.contact_dealer.selectedDealerIndex)+1:"",pageName:"#{omniMarket}:#{series_name}:BYT:Request a Quote Confirmation",prop2:"#{model_year}",events:"event1",products:";"+((App.contact_dealer.selected_dealer)?App.contact_dealer.selected_dealer.id:""),prop16:((App.contact_dealer.selected_dealer)?App.contact_dealer.selected_dealer.id:0),eVar6:"#{omniMarket}:BYT:Request A Quote",prop32:"Lower"});
this.submitDoubleClick(this.doubleClickTags["lead"]);
mboxDefine("dynamicElement","endRAQ");
var _28=(this.vehicle&&this.vehicle.series)?this.vehicle.series.name:"";
var _29=(this.vehicle.model&&this.vehicle.model.year)?this.vehicle.model.year:"";
if(_29==""&&pageVehicle&&pageVehicle.year){
_29=pageVehicle.year;
}
if(App.contact_dealer.ab_test_version==0){
mboxUpdate("endRAQ","page=endConfigRAQ","model="+_29+" "+_28,"raqver=configurator");
}else{
mboxUpdate("endRAQ","page=endConfigRAQ","model="+_29+" "+_28,"raqver=configurator");
}
var _2a=this.vehicle.series.name;
var _2b="";
var _2c=new Object();
_2c["Solara"]={en:"soreq548",es:""};
_2c["Venza"]={en:"vzreq354",es:"vzreq940"};
_2c["Camry"]={en:"cyreq505",es:"cyreq036"};
_2c["Tundra"]={en:"tureq340",es:"tureq881"};
_2c["Corolla"]={en:"clreq517",es:"clreq825"};
_2c["Prius"]={en:"prreq377",es:"prreq636"};
_2c["Sequoia"]={en:"sqreq034",es:"sqraq130"};
_2c["Avalon"]={en:"avreq417",es:"avreq651"};
_2c["RAV4"]={en:"rvreq968",es:"rvreq242"};
_2c["Tacoma"]={en:"tareq742",es:"tareq378"};
_2c["Matrix"]={en:"mareq776",es:"mareq451"};
_2c["Yaris"]={en:"yrreq779",es:"yrreq132"};
_2c["FJ"]={en:"fjreq355",es:"fjreq416"};
_2c["Highlander"]={en:"hlreq562",es:"hlreq281"};
_2c["Sienna"]={en:"sireq946",es:"sireq177"};
_2c["Land Cruiser"]={en:"lcreq182",es:"lcreq907"};
_2c["4Runner"]={en:"frreq210",es:"frreq205"};
_2b=_2c[_2a];
if(this.langString=="_es"){
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=621119;type=toyot994;cat="+_2b.es+";ord="+((Math.random()+"")*10000000000000)+"?");
}else{
this.includeExternalUrl("http://fls.doubleclick.net/activityi;src=621119;type=toyot994;cat="+_2b.en+";ord="+((Math.random()+"")*10000000000000)+"?");
}
try{
var _2d=new Date();
var _2e=((new Cookie("JSESSIONID_BYT")).read());
if(_2e==null){
_2e=((new Cookie("JSESSIONID")).read());
}
if((parseInt(tda_code)==102)){
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&ActivityID=22760&rnd="+(Math.random()*1000000)+"&Session="+((_2e)?_2e:""));
this.includeTrackingImg("http://altfarm.mediaplex.com/ad/bk/8292-45444-2054-6?BYO_Configurator=1&mpuid="+((_2e)?_2e:""));
this.includeTrackingImg("http://www.directnetadvertising.net/bin/site/wrappers/campresincrad.asp?AID=365&OfferID=1311&cmt3=BT&cmt2=&cmt=");
}
if((parseInt(tda_code)==71)){
this.includeTrackingImg("http://www.directnetadvertising.net/bin/site/wrappers/campresincrad.asp?AID=365&OfferID=1610&cmt3=BYO_CONFIG&cmt2=&cmt=");
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&ActivityID=24249&rnd="+(Math.random()*1000000)+"&Session="+((_2e)?_2e:""));
this.includeTrackingImg("http://adfarm.mediaplex.com/ad/bk/9497-55417-3840-0?CIN_BYO_CONFIG=1&mpuid="+((_2e)?_2e:""));
}
if((parseInt(tda_code)==8000001)){
this.includeTrackingImg("http://www.directnetadvertising.net/bin/site/wrappers/campresincrad.asp?AID=365&OfferID=1616&cmt3=BYO_CONFIG&cmt2=&cmt=");
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&ActivityID=24250&rnd="+(Math.random()*1000000)+"&Session="+((_2e)?_2e:""));
this.includeTrackingImg("http://adfarm.mediaplex.com/ad/bk/9498-55418-3840-0?WW_BYO_CONFIG=1&mpuid="+((_2e)?_2e:""));
}
try{
mboxUpdate("BuildYour"+init_vehicname,"page=RequestAQuoteThankYou");
}
catch(e){
Debug.error(e);
}
}
catch(e){
Debug.error(e);
}
},onSummaryInit:function(){
try{
}
catch(e){
Debug.error(e);
}
},onErrorDialog:function(msg,_30){
(_30==App.strings.conflict_name)?_30="Conflict:"+App.accordion.current_section.capitalize():0;
this.submitOmni({pageName:"#{omniMarket}:#{series_name}:BYT:Conflict",prop31:"Error: "+_30,prop2:"#{model_year}",eVar15:((App.zip_code)?App.zip_code:""),prop32:"Lower"});
},onZipUpdate:function(){
this.submitOmni({pageName:"",prop46:"#{omniMarket}:#{series_name}:BYT:Update Zipcode",events:"event4",eVar3:"#{omniLocation}_byt_update_zipcode",eVar15:((App.zip_code)?App.zip_code:""),prop7:((App.zip_code)?App.zip_code:""),linkName:"#{omniLocation}_byt_update_zipcode",linkTrackVars:"prop7,eVar3,eVar15,prop46,events",linkTrackEvents:"event4"});
},onConfirm:function(msg,_32){
if(_32=="clear_all_confirm"){
this.submitOmni({prop46:"#{omniMarket}:#{series_name}:BYT:Clear All",events:"event4",eVar3:"#{omniLocation}_byt_clear_all",linkName:"#{omniLocation}_byt_clear_all",linkTrackVars:"eVar3,prop46,events",linkTrackEvents:"event4"});
}
if(_32=="select_new_confirm"){
this.submitOmni({prop46:"#{omniMarket}:#{series_name}:BYT:Select New",events:"event4",eVar3:"#{omniLocation}_byt_select_new",linkName:"#{omniLocation}_byt_select_new",linkTrackVars:"eVar3,prop46,events",linkTrackEvents:"event4"});
}
},onShowDealers:function(){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Request a Quote",events:"event4",eVar3:"#{omniLocation}_byt_raq_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_raq_#{series_name}",linkTrackVars:"prop7,eVar15,prop2,eVar3,eVar25,eVar15,prop46,events",linkTrackEvents:"event4"});
if(this.completeConfigCheck()){
this.resetAllProperties();
this.submitOmni({prop32:"Lower",pageName:"#{omniMarket}:#{series_name}:BYT:Quote Request",prop2:"#{model_year}",eVar6:"#{omniMarket}:BYT:Request A Quote",eVar15:this.getSummaryPageZip(),eVar12:this.modelString,eVar17:Math.round(App.vehicle.totalMsrp),events:"event6, event31",products:";;;;event31="+Math.round(App.vehicle.totalMsrp)});
}else{
this.submitOmni({prop32:"Lower",pageName:"#{omniMarket}:#{series_name}:BYT:Quote Request",prop2:"#{model_year}",eVar6:"#{omniMarket}:BYT:Request A Quote",eVar15:this.getSummaryPageZip()});
}
this.submitDoubleClick(this.doubleClickTags["totalTraffic"]);
this.submitDoubleClick(this.doubleClickTags["totalQualified"]);
},onShowMoreDealers:function(){
this.submitOmni({prop46:"#{omniMarket}:#{series_name}:BYT:RAQ:See More Dealers",events:"event4",eVar3:"#{omniLocation}_byt_raq_see_more_dealers",linkName:"#{omniLocation}_byt_raq_see_more_dealers",linkTrackVars:"prop7,eVar3,prop46,events",linkTrackEvents:"event4"});
},onShowMaps:function(_33,_34){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop7:this.getSummaryPageZip(),eVar15:this.getSummaryPageZip(),eVar14:((_34.position)?parseInt(_34.position)+1:1),prop46:"#{omniMarket}:#{series_name}:BYT:Maps & Directions",events:"event4,event8",products:";"+((_34.id)?(_34.id):""),prop16:((_34.id)?(_34.id):""),linkName:"#{omniLocation}_byt_mapsdirections_#{series_name}",eVar3:"#{omniLocation}_byt_mapsdirections_#{series_name}",linkTrackVars:"prop7,prop46,eVar3,eVar15,eVar25,events,eVar14,prop16,products",linkTrackEvents:"event4,event8"});
},onCompare:function(_35,_36){
this.submitOmni({prop46:"#{omniMarket}:#{series_name}:BYT:Step 1:Compare:"+_36.replace(/s$/,""),linkName:"#{omniLocation}_byt_step 1_compare_"+_36.replace(/s$/,"").toLowerCase()+"_#{series_name}",linkTrackVars:"prop7,prop46"});
},onUnload:function(){
return false;
},completeConfigCheck:function(){
if(!this.is_complete){
if(App.saved_session&&App.saved_session.is_ready){
this.is_complete=(App.saved_session.exterior_id!=App.vehicle.extColor.id)||(App.saved_session.interior_id!=App.vehicle.intColor.id)||(App.saved_session.package_id!=App.vehicle.pkg.id)||(App.saved_session.model_id!=App.vehicle.model.id)||(App.saved_session.accessory_ids.sort().toString()!=App.vehicle.userAccessories.pluck("id").sort().toString());
}else{
this.is_complete=["accessories","colors","packages","model"].findAll(function(_37){
return App.panes&&App.panes[_37].is_complete;
}).length>0;
}
}
return this.is_complete;
}});
}
function sendAnalyticsEvent(str){
ns=s_account;
if(str!=null&&str!=""){
ns+=","+str;
}
void (s.tl(null,"o",null));
}
function sendLinkEvent(str,_3a,_3b){
ns=s_account;
if(str!=""&&str!=null){
ns+=","+str;
}
s_linkType=((_3b)?_3b:"o");
s_linkName=_3a;
void (s.tl((new Object),((_3b)?_3b:"o"),_3a));
}
s.pageName="";
s.server=document.location.host;
s.channel="";
s.pageType="";
s.prop1="";
s.prop2="";
s.prop3="";
s.prop4="";
s.prop5="";
s.prop6="";
s.prop7="";
s.eVar16="";
s.campaign="";
s.state="";
s.zip="";
s.events="";
s.products="";
s.purchaseID="";

with(Configurator){
Configurator.DisclaimerPanel=Class.create(ControllerCommon,{initialize:function(_1,_2){
this.pane=_1;
this.vehicle=_2;
this.previous_pane=null;
this.loadTemplate("/configurator/includes/disclaimers.html");
NotificationCenter.addSubscriber("Tab Changed",this,this.handleTabChange);
},showDisclaimers:function(_3){
this.pane.style.display="";
if(!$("summary_page_disclaimers")){
if((!App.model_disclaimers)||(!this.vehicle.pkg)||(!this.vehicle.userAccessories)){
return false;
}
var _4=App.model_disclaimers;
var _5=this.vehicle.pkg.accessories.pluck("disclaimers").flatten().uniq();
var _6=this.vehicle.userAccessories.pluck("disclaimers").flatten().uniq();
this.disclaimers=_4.concat(_5).concat(_6).uniq().findAll(function(d){
return d.usages.include(_3);
});
this.disclaimers=this.disclaimers.sortBy(function(a){
return a.usage_orders[_3];
});
}else{
this.disclaimers=$NL($("summary_page_disclaimers").childNodes).elements().map(function(_9){
var _a={};
$NL(_9.childNodes).each(function(n){
_a[n.className]=n.innerHTML;
});
return _a;
});
}
var _c=this.disclaimers.collect(function(a){
return this.templates["definition"].evaluate(a);
}.bind(this)).join("");
this.pane.innerHTML=this.templates["disclaimer_definitions"].evaluate({disclaimersLoop:_c});
this.scale_nine=new ScaleNine(this.pane,{tl:{image:"/configurator/images/conflict_backdrop/conflict_box_01.png",width:9,height:9},tm:{image:"/configurator/images/conflict_backdrop/conflict_box_02.png",width:2,height:9},tr:{image:"/configurator/images/conflict_backdrop/conflict_box_03.png",width:9,height:9},ml:{image:"/configurator/images/conflict_backdrop/conflict_box_04.png",width:9,height:3},mm:{color:"#FFFFFF"},mr:{image:"/configurator/images/conflict_backdrop/conflict_box_06.png",width:9,height:3},bl:{image:"/configurator/images/conflict_backdrop/conflict_box_07.png",width:9,height:9},bm:{image:"/configurator/images/conflict_backdrop/conflict_box_08.png",width:2,height:9},br:{image:"/configurator/images/conflict_backdrop/conflict_box_09.png",width:9,height:9}});
this.scale_nine.render();
new ScrollBox($("disclaimers_content_container"),{auto_hide:true});
this.pane.style.visibility="visible";
try{
App.flash_pane.element.style.zIndex=0;
setTimeout(function(){
App.flash_pane.element.style.zIndex=1;
}.bind(this),10);
}
catch(e){
Debug.error(e);
}
},dismiss:function(){
this.pane.style.visibility="hidden";
this.pane.style.display="none";
try{
if(App.contact_dealer&&App.contact_dealer.modal_backdrop&&App.contact_dealer.modal_backdrop.element.style.display=="block"){
App.contact_dealer.modal_backdrop.disable();
}
App.flash_pane.element.style.zIndex=0;
}
catch(e){
Debug.error(e);
}
},handleTabChange:function(){
if(this.pane&&this.pane.style.visibility!="hidden"){
this.dismiss();
}
}});
}

with(Configurator){
Configurator._EmailSummary=Class.create(ControllerCommon,PopupCommon,{initialize:function(_1){
this.events=[];
},trigger:function(_2){
Element.show($("email_summary_popup"));
$("email_summary_popup").style.visibility="visible";
Event.observe($("email_summary_popup"),"keypress",function(_3){
if(Event.KEY_RETURN==_3.keyCode){
this.validateAndSubmit.bind(this)();
Event.stop(_3);
}
}.bindAsEventListener(this));
NotificationCenter.sendNotification("Email Summary Trigger");
},dismiss:function(){
},submit:function(){
this.submit_req=new Ajax.Request("/byt/pub/submitEmailAFriendXml.do",{method:"post",contentType:"application/x-www-form-urlencoded",parameters:((document.location.search.substring(1,document.location.search.length))+"&userName="+escape($("email_summary_name_input").value)+"&userEmail="+escape($("email_summary_email_input").value)+"&friendEmail="+escape($("email_summary_recipient_input").value)).toQueryParams(),onComplete:this.submit_onComplete.bind(this)});
},submit_onComplete:function(_4){
var _5=new Status();
$("email_summary_loading").style.display="none";
_5.initWithXML(XML.getRootNode(_4.responseXML));
if(_5.code==200){
Element.hide($("email_summary_popup"));
$("email_summary_confirm").style.visibility="visible";
Element.show($("email_summary_confirm"));
NotificationCenter.sendNotification("Email Summary Sent");
}else{
Element.hide($("email_summary_popup"));
$("email_summary_error").style.visibility="visible";
}
},validateAndSubmit:function(){
var _6=true;
$("email_summary_popup").style.visibility="hidden";
$("email_summary_popup").style.visibility="visible";
$("email_summary_name_error").innerHTML="";
$("email_summary_sender_error").innerHTML="";
$("email_summary_recipient_error").innerHTML="";
$("email_summary_name_error").style.display="none";
$("email_summary_sender_error").style.display="none";
$("email_summary_recipient_error").style.display="none";
if($("email_summary_name_input").value==""){
$("email_summary_name_error").innerHTML="<p>Please input a name.</p>";
$("email_summary_name_error").style.display="block";
_6=false;
}
if(!this.validateSingleEmail($("email_summary_email_input").value)){
$("email_summary_sender_error").innerHTML="<p>Please enter a valid email address.</p>";
$("email_summary_sender_error").style.display="block";
_6=false;
}
if(!this.validateSingleEmail($("email_summary_recipient_input").value)){
$("email_summary_recipient_error").innerHTML="<p>Please enter a valid email address.</p>";
$("email_summary_recipient_error").style.display="block";
_6=false;
}else{
if(!this.validateMultipleEmails($("email_summary_recipient_input").value)){
$("email_summary_recipient_error").innerHTML="<p>Please enter a valid email address.<br/>Please place a comma between multiple addresses.</p>";
$("email_summary_recipient_error").style.display="block";
_6=false;
}
}
if(_6){
$("email_summary_loading").style.display="block";
this.submit();
}else{
return false;
}
},validateSingleEmail:function(_7){
return _7.length&&_7.match(/^\s*[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}\s*/i);
},validateMultipleEmails:function(_8){
return _8.length&&_8.match(/^\s*[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}(?:\s*[,]\s*[A-Z0-9\._%-]+@[A-Z0-9\.-]+\.[A-Z]{2,4}\s*)*$/i);
},displayPrivacy:function(){
window.open("/help/privacy.html");
}});
}
Configurator.EmailSummary=new Configurator._EmailSummary();

with(Configurator){
Configurator.ZipEditPanel=Class.create(ControllerCommon,{initialize:function(_1){
this.zip=_1;
var _2=(window.location+"").toQueryParams();
this.langES=(_2.lang&&_2.lang=="es"&&!(_2.seriesCategory!=null));
if(this.langES){
this.loadTemplate("/configurator/includes/zip_edit_panel_es.html",{onComplete:this.init_onZipTemplate.bind(this),method:"post"});
}else{
this.loadTemplate("/configurator/includes/zip_edit_panel.html",{onComplete:this.init_onZipTemplate.bind(this),method:"post"});
}
},init_onZipTemplate:function(){
$("zipEditHolder").innerHTML=this.templates["main"].evaluate({zip:this.zip});
this.loadZipWarning();
},loadZipWarning:function(){
if(this.langES){
var _3="<div id='zipWarningIcon'><img src='/configurator/images/conflict_backdrop/icon.png' width='18' height='18' alt='' class='png' /></div><div id='zipWarningCopyBlock'>Al cambiar tu c&oacute;digo postal se podr&iacute;a cambiar tambi&eacute;n las opciones disponibles de los veh&iacute;culos.</div>";
}else{
var _3="<div id='zipWarningIcon'><img src='/configurator/images/conflict_backdrop/icon.png' width='18' height='18' alt='' class='png' /></div><div id='zipWarningCopyBlock'>Changing your zip code may change the vehicles options available.</div>";
}
this.zipWarningTooltip=new Tooltip($("editZipLink"),_3,{position_type:Tooltip.POSITION_BELOW});
},manualZipEditDisplay:function(_4){
if(_4){
Element.hide($("zipDisplayHolder"));
Element.show($("zipEditInputHolder"));
$("zipEditInputTextField").value=this.zip;
Event.observe($("zipEditInputTextField"),"keypress",function(_5){
if(Event.KEY_RETURN==_5.keyCode){
this.manualZipEditDisplay(false);
Event.stop(_5);
}
}.bindAsEventListener(this));
}else{
var _6=$F("zipEditInputTextField");
if(_6.match(/^[0-9]{5}$/)){
Element.show($("zipDisplayHolder"));
Element.hide($("zipEditInputHolder"));
$("zipEditInputTextField").style.border="1px solid #CCCCCC";
if(this.error_tooltip){
this.error_tooltip.hide();
this.error_tooltip.removeTrigger($("zipEditInputTextField"));
}
$("zipDisplay").innerHTML=_6;
App.updateZip(_6);
}else{
$("zipEditInputTextField").style.border="1px solid red";
if(this.langES){
var _7="<div>Por favor introduce un c&oacute;digo postal v&aacute;lido.</div>";
}else{
var _7="<div>Please input a valid zip code.</div>";
}
if(this.error_tooltip==null){
this.error_tooltip=new Tooltip($("zipEditInputTextField"),_7,{position_type:Tooltip.POSITION_BELOW});
}else{
this.error_tooltip.addTrigger($("zipEditInputTextField"));
}
}
}
}});
}

with(Configurator){
Configurator.GlossaryPopup=Class.create(PopupCommon,ControllerCommon,{initialize:function(_1){
this.loadTemplate("/configurator/includes/glossary_definition.html",{name:"glossary_definitions",onComplete:this.init_onpartials.bind(this)});
this.events=[];
this.element=document.createElement("div");
Element.addClassName(this.element,"glossary_definition");
Element.addClassName(this.element,"tooltip");
this.element.style.display="none";
this.scale_nine=new ScaleNine(this.element,{tl:{image:"/configurator/images/conflict_backdrop/conflict_box_01.png",width:9,height:9},tm:{image:"/configurator/images/conflict_backdrop/conflict_box_02.png",width:2,height:9},tr:{image:"/configurator/images/conflict_backdrop/conflict_box_03.png",width:9,height:9},ml:{image:"/configurator/images/conflict_backdrop/conflict_box_04.png",width:9,height:3},mm:{color:"#FFFFFF"},mr:{image:"/configurator/images/conflict_backdrop/conflict_box_06.png",width:9,height:3},bl:{image:"/configurator/images/conflict_backdrop/conflict_box_07.png",width:9,height:9},bm:{image:"/configurator/images/conflict_backdrop/conflict_box_08.png",width:2,height:9},br:{image:"/configurator/images/conflict_backdrop/conflict_box_09.png",width:9,height:9}});
if(document.body){
document.body.appendChild(this.element);
}else{
Event.observe(window,"load",function(){
document.body.appendChild(this.element);
}.bind(this));
}
},init_onpartials:function(){
this.partials_loaded=true;
},reposition:function(_2){
this.positionBelowElement(this.element,_2);
},showDefinition:function(_3,_4){
var _5=App.glossary_terms.find(function(g){
return g.id==_4;
});
this.element.update(this.templates["glossary_definitions"].evaluate(_5));
this.element.style.visibility="hidden";
this.element.style.display="";
this.scale_nine.render();
this.reposition(_3);
this.element.style.visibility="";
Element.extend(_3).addClassName("tooltip_trigger");
Event.observe(_3,"mouseout",this.dismiss.bindAsEventListener(this));
},dismiss:function(){
this.events.each(function(e){
Event.stopObserving(e);
});
this.events=[];
this.element.style.display="none";
}});
}
var Glossary=new Configurator.GlossaryPopup();


