/**
 * 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;
}};

with(Configurator){
Configurator.ContactDealer=Class.create();
Object.extend(ContactDealer.prototype,ControllerCommon);
Object.extend(ContactDealer.prototype,PopupCommon);
Object.extend(ContactDealer.prototype,{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="";
this.element=$("wrapper_holder").appendChild(document.createElement("div"));
this.element.className="contact_dealer 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;
var _3=(window.location+"").toQueryParams();
if(_3.lang&&_3.lang=="es"){
this.langString="es";
}
this.loadTemplate("/configurator/includes/contact_dealer.html",{oncomplete:this.init_ontemplate.bind(this)});
new Ajax.Request("/byt/pub/showDealers.do",{onComplete:this.init_ondata.bind(this)});
},init_ontemplate:function(){
this.template_loaded=true;
},init_ondata:function(_4){
var _5=XML.getRootNode(_4.responseXML);
this.dealers=[];
$NL(_5.getElementsByTagName("dealer")).each(function(_6){
var d=new Dealer();
d.initWithXML(_6);
this.dealers.push(d);
}.bind(this));
this.data_loaded=true;
NotificationCenter.sendNotification("Dealers List Loaded",[this.dealers]);
},triggerMapRequest:function(_8){
var _9=this.dealers.find(function(d){
return d.id==_8;
});
_9.popupMap(_9.position);
},triggerDealerList:function(){
this.current_view="DEALERLIST";
this.element.innerHTML=this.templates["contact_dealer_list"].evaluate();
this.currentDealerPage=0;
this.firstDealerPageIsPma=false;
this.dealersPages=[];
var _b=this.dealers.findAll(function(d){
return d.pma;
});
if(_b.length<6&&_b.length>0){
this.firstDealerPageIsPma=true;
this.dealersPages.push(_b);
}
this.dealers.eachSlice(6).each(function(s){
this.dealersPages.push(s);
}.bind(this));
this.dealers.each(function(_e,_f){
_e.position=_f;
}.bind(this));
this.dealersPages.each(function(_10,_11){
var _12=_10.collect(function(_13){
return this.templates["contact_dealer_item"].evaluate(_13);
}.bind(this)).join("");
var _14=document.createElement("div");
var _15="dealersPage"+_11;
_14.setAttribute("id",_15);
_14.innerHTML=_12;
_14.className="dealerPage";
$("contact_dealer_list").appendChild(_14);
}.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;
var _16=document.getElementsByClassName("dealer");
$$(".dealerPage").each(function(d){
var _18=d.getElementsByClassName("dealer");
for(i=0;i<_18.length;i++){
if(i%2!=0){
_18[i].style.background="#e8e8e8";
}
}
}.bind(this));
var _19=window.location+"";
var _1a=_19.toLowerCase().toQueryParams();
if(this.zip_code==undefined){
this.zip_code=_1a.zipcode;
}
$("cd_zip").value=this.zip_code;
Element.hide(this.covered_content);
Element.show(this.element);
this.element.style.visibility="visible";
NotificationCenter.sendNotification("Contact Dealer Popup: Trigger Dealer List");
},triggerEBrochure:function(_1b){
return window.open("/byt/pub/generateEBrochure.do?"+(App.vehicle.getParamList?App.vehicle.getParamList():justParams)+"&dealerCode="+_1b);
},selectDealer:function(_1c,_1d){
this.selected_dealer={};
this.selected_dealer=this.dealers.findByProperty("id",_1c+"");
this.selectedDealerIndex=_1d;
},validateAndSubmit:function(){
if(this.submitting){
return false;
}
var _1e=this.getFormData();
var _1f=this.validate(_1e);
if(_1f.is_valid){
this.submit(_1e);
}
NotificationCenter.sendNotification("Contact Dealer: Validate and Submit",_1f.errs);
},getFormData:function(){
var _20={firstName:$("cd_first_name").value,lastName:$("cd_last_name").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,optIn:$("cd_get_info").checked?"true":"false",lang:this.langString?this.langString:""};
if(this.selected_dealer){
_20.dealerCode=this.selected_dealer.id;
}
return _20;
},validate:function(_21){
var _22=true;
var _23=[];
this.validation_events.each(function(e){
Event.stopObserving(e);
});
if(!_21.firstName||!_21.firstName.match(/^[a-z0-9 \-\,]+$/i)){
$("cd_first_name_error").style.display="block";
_22=false;
_23[_23.length]="firstName";
}else{
$("cd_first_name_error").style.display="none";
}
if(!_21.lastName||!_21.lastName.match(/^[a-z0-9 \-\,]+$/i)){
$("cd_last_name_error").style.display="block";
_22=false;
_23[_23.length]="lastName";
}else{
$("cd_last_name_error").style.display="none";
}
if(!_21.zip||!_21.zip.match(/^[0-9]{5}$/)){
$("cd_zip_error").style.display="block";
_22=false;
_23[_23.length]="zip";
}else{
$("cd_zip_error").style.display="none";
}
if(!_21.email||!_21.email.match(/^[a-z0-9\-\._+]+@[a-z0-9-_\.]+\.[a-z0-9]{2,}$/i)){
$("cd_email_error").style.display="block";
_23[_23.length]="email";
_22=false;
}else{
$("cd_email_error").style.display="none";
}
if(!_21.homePhone||!_21.homePhone.match(/^([0-9 .()\-x+]|(ext\.?)){10,}$/i)||_21.homePhone.replace(/\D/g,"").length>10||parseInt(_21.homePhoneA)<201||parseInt(_21.homePhoneB)<200){
$("cd_phone_error").style.display="block";
_22=false;
_23[_23.length]="homePhone";
}else{
$("cd_phone_error").style.display="none";
}
if(!_21.dealerCode||_21.dealerCode==null){
$("cd_select_dealer_error").style.display="block";
_22=false;
_23[_23.length]="dealerCode";
}else{
$("cd_select_dealer_error").style.display="none";
}
if(_22==false){
this.displayRequired();
}else{
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:_22,errs:_23.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");
},submit:function(_25){
this.submitting=true;
this.submitting_pane.enable();
var _26=[];
for(key in _25){
_26.push(escape(key)+"="+escape(_25[key]));
}
try{
params=App.vehicle.getParamList()+"&"+_26.join("&");
}
catch(e){
params=justParams+"&"+_26.join("&");
}
new Ajax.Request("/byt/pub/contactDealerSubmitXml.do",{method:"post",parameters:params,onComplete:this.onSubmitComplete.bind(this)});
},onSubmitComplete:function(_27){
this.submitting=false;
this.submitting_pane.disable();
try{
var _28=new Status();
_28.initWithXML(XML.getRootNode(_27.responseXML));
}
catch(e){
Debug.error(e);
}
if(_28.code=="200"){
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]);
}
catch(e){
}
}else{
if(_28.code=="510"&&App&&App.fatalError){
this.dismiss();
App.fatalError(_28);
}else{
$("cd_error_message").innerHTML="There was an error submitting your request.  Please try again later.";
}
}
},paginateDealersNext:function(){
var _29="dealersPage"+this.currentDealerPage;
$(_29).style.visibility="hidden";
this.currentDealerPage+=1;
var _2a="dealersPage"+this.currentDealerPage;
$(_2a).style.visibility="visible";
if((this.currentDealerPage+1)==this.dealersPages.length){
$("dealer_pagination_next").style.visibility="hidden";
}
if(!((this.firstDealerPageIsPma==true)&&(this.currentDealerPage==1))){
$("dealer_pagination_back").style.visibility="visible";
}
NotificationCenter.sendNotification("Dealer List: Show More");
},paginateDealersBack:function(){
var _2b="dealersPage"+this.currentDealerPage;
$(_2b).style.visibility="hidden";
this.currentDealerPage-=1;
var _2c="dealersPage"+this.currentDealerPage;
$(_2c).style.visibility="visible";
if((this.currentDealerPage==0)||(this.firstDealerPageIsPma==true&&this.currentDealerPage==1)){
$("dealer_pagination_back").style.visibility="hidden";
}
$("dealer_pagination_next").style.visibility="visible";
},attachCloseEvent:function(){
document.getElementsByClassName("close_button",this.element).each(function(btn){
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.DealerList=Class.create();
Object.extend(DealerList.prototype,ControllerCommon);
Object.extend(DealerList.prototype,{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.DisclaimerPanel=Class.create();
Object.extend(DisclaimerPanel.prototype,ControllerCommon);
Object.extend(DisclaimerPanel.prototype,{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{
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();
Object.extend(_EmailSummary.prototype,ControllerCommon);
Object.extend(_EmailSummary.prototype,PopupCommon);
Object.extend(_EmailSummary.prototype,{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",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),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._ErrorDialog=Class.create();
Object.extend(_ErrorDialog.prototype,ControllerCommon);
Object.extend(_ErrorDialog.prototype,PopupCommon);
Object.extend(_ErrorDialog.prototype,{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.observe(window,"load",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.GlossaryPopup=Class.create();
Object.extend(GlossaryPopup.prototype,PopupCommon);
Object.extend(GlossaryPopup.prototype,ControllerCommon);
Object.extend(GlossaryPopup.prototype,{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();

with(Configurator){
Configurator.Tracking=Class.create();
Object.extend(Configurator.Tracking.prototype,{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 Credit Apply",this,this.onCreditApply);
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);
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);
}
},includeExternalScript:function(_4){
var sc=document.createElement("iframe");
sc.src=_4;
this.xpo_element.appendChild(sc);
},includeTrackingImg:function(_6){
try{
var _7=document.createElement("img");
_7.src=_6;
this.xpo_element.appendChild(_7);
}
catch(e){
Debug.error(e);
}
},submitDoubleClick:function(_8){
if(_8&&_8!=null&&_8!=""){
var _9=Math.random()+"";
var a=_9*10000000000000;
var t=new Template(_8);
this.includeTrackingImg(t.evaluate({a:a,tda:App.tda}));
}
},resetAllProperties:function(){
s_events="";
s.events="";
if(this.vehicle&&this.vehicle.getSelectedAccessories){
this.modelString=this.vehicle.series?this.vehicle.series.name+"|":"|";
this.modelString+=this.vehicle.model?this.vehicle.model.grade.name+"|":"|";
this.modelString+=this.vehicle.model?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.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 _c=false;
this.resetAllProperties();
var _d=this.omni_queue.shift();
for(i in _d){
if((typeof i!="function")&&(window.s[i]!=undefined)){
window.s[i]=_d[i];
}else{
if(typeof i!="function"){
window[i]=_d[i];
}
}
if(i=="linkName"){
_c=true;
}
}
if(_c){
sendLinkEvent("",_d["linkName"],((_d["linkType"])?_d["linkType"]:"o"));
}else{
sendAnalyticsEvent("");
}
}
}
catch(e){
Debug.error(e);
}
},submitOmni:function(_e){
try{
_e=$H(_e);
_e.each(function(_f){
_e[_f.key]=this.omniTemplate(_f.value);
}.bind(this));
this.omni_queue.push(_e);
}
catch(e){
Debug.error(e);
}
},omniTemplate:function(_10){
if(typeof (_10)!="string"){
return _10;
}
if(init_vehicname){
var _11=init_vehicname;
}else{
var _11=(this.vehicle.series?this.vehicle.series.name:"");
}
if(_11.toLowerCase()=="venza"){
_11=_11.toUpperCase();
}
var _12=(this.vehicle.model&&this.vehicle.model.year)?this.vehicle.model.year:"";
if(_12==""&&pageVehicle&&pageVehicle.year){
_12=pageVehicle.year;
}
if(this.langString=="_es"){
om_market="Esp";
om_location="esp";
}else{
om_market="GM";
om_location="tcom";
}
var pn=new Template(_10||"");
return pn.evaluate({series_name:_11,omniMarket:om_market,omniLocation:om_location,model_year:_12,modelstring:this.modelString});
},onTabChange:function(msg,_15){
if(this.first_tag_fire){
NotificationCenter.addSubscriber("PanelComplete Status Change",this,this.onDeferTabChange);
}else{
this.omniTabChange(_15);
this.first_tag_fire=false;
}
this.current_tab=_15;
},onDeferTabChange:function(_16,_17){
if(this.first_tag_fire&&_17&&_17.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:App.vehicle.totalMsrp,products:";;;;event32="+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 _1a=this.vehicle.series.name;
var _1b="";
var _1c=new Object();
_1c["Solara"]="sobui333";
_1c["Venza"]="vzbui279";
_1c["VENZA"]="vzbui279";
_1c["Camry"]="cybui385";
_1c["Tundra"]="tubui797";
_1c["Corolla"]="clbui876";
_1c["Prius"]="prbui948";
_1c["Sequoia"]="sqbui089";
_1c["Avalon"]="avbui670";
_1c["RAV4"]="rvbui770";
_1c["Tacoma"]="tabui498";
_1c["Matrix"]="mabui763";
_1c["Yaris"]="yrbui643";
_1c["FJ"]="fjbui011";
_1c["Highlander"]="hlbui102";
_1c["Sienna"]="sibui352";
_1c["Land Cruiser"]="lcbui827";
_1c["4Runner"]="frbui564";
_1b=_1c[_1a];
if(this.langString!="_es"){
this.includeExternalScript("http://fls.doubleclick.net/activityi;src=621119;type=toyot994;cat="+_1b+";ord="+((Math.random()+"")*10000000000000)+"?");
}
},onSummaryLink:function(){
},onEmailSummary:function(){
this.submitOmni({prop2:"#{model_year}",eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Email Summary",events:"event4,event10",eVar3:"#{omniLocation}_byt_emailsummary_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_emailsummary_#{series_name}",linkTrackVars:"prop1,prop2,prop7,prop46,eVar1,eVar3,eVar15,eVar25,events",linkTrackEvents:"event4,event10"});
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({pageName:"GM : Next Gen Configurator : #{series_name} : Email Summary : Confirm",events:"event10"});
},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"});
},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({eVar25:"#{omniMarket}:#{series_name}",prop46:"#{omniMarket}:#{series_name}:BYT:Estimate Payments",events:"event4,event14",eVar3:"#{omniLocation}_byt_tfs_pymtcalc_#{series_name}",eVar15:this.getSummaryPageZip(),prop7:this.getSummaryPageZip(),linkName:"#{omniLocation}_byt_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"});
},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 _1d=window.location+"";
var _1e=_1d.toLowerCase().toQueryParams();
var _1f="";
if(_1e.zipcode){
_1f=_1e.zipcode;
}
return _1f;
},onSendButtonClick:function(_20,_21){
this.submitDoubleClick(this.doubleClickTags["totalTraffic"]);
this.submitDoubleClick(this.doubleClickTags["totalQualified"]);
this.includeExternalScript("http://fls.doubleclick.net/activityi;src=621119;type=bat30482;cat=resea250;ord="+((Math.random()+"")*10000000000000)+"?");
this.includeExternalScript("http://fls.doubleclick.net/activityi;src=621119;type=bat30392;cat=bat30425;ord="+((Math.random()+"")*10000000000000)+"?");
if(_21!=null&&_21!=""){
this.submitOmni({prop29:"#{omniMarket}:#{series_name}:BYT:Quote Request",prop30:_21,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(_22,_23){
this.zip_code=(App.zip_code)?App.zip_code:App.contact_dealer.zip_code;
this.submitOmni({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"]);
var _24=this.vehicle.series.name;
var _25="";
var _26=new Object();
_26["Solara"]="soreq548";
_26["Venza"]="vzreq354";
_26["Camry"]="cyreq505";
_26["Tundra"]="tureq340";
_26["Corolla"]="clreq517";
_26["Prius"]="prreq377";
_26["Sequoia"]="sqreq034";
_26["Avalon"]="avreq417";
_26["RAV4"]="rvreq968";
_26["Tacoma"]="tareq742";
_26["Matrix"]="mareq776";
_26["Yaris"]="yrreq779";
_26["FJ"]="fjreq355";
_26["Highlander"]="hlreq562";
_26["Sienna"]="sireq946";
_26["Land Cruiser"]="lcreq182";
_26["4Runner"]="frreq210";
_25=_26[_24];
this.includeExternalScript("http://fls.doubleclick.net/activityi;src=621119;type=toyot994;cat="+_25+";ord="+((Math.random()+"")*10000000000000)+"?");
try{
var _27=new Date();
if((parseInt(tda_code)==102)){
var _28=(new Cookie("JSESSIONID").read());
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&amp;ActivityID=22760&amp;rnd="+(Math.random()*1000000)+"&amp;Session="+((_28)?_28:""));
this.includeTrackingImg("http://altfarm.mediaplex.com/ad/bk/8292-45444-2054-6?BYO_Configurator=1&mpuid="+((_28)?_28:""));
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=");
var _28=(new Cookie("JSESSIONID").read());
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&amp;ActivityID=24249&amp;rnd="+(Math.random()*1000000)+"&amp;Session="+((_28)?_28:""));
this.includeTrackingImg("http://adfarm.mediaplex.com/ad/bk/9497-55417-3840-0?CIN_BYO_CONFIG=1&mpuid="+((_28)?_28:""));
}
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=");
var _28=(new Cookie("JSESSIONID").read());
this.includeExternalScript("http://bs.serving-sys.com/BurstingPipe/ActivityServer.bs?cn=as&amp;ActivityID=24250&amp;rnd="+(Math.random()*1000000)+"&amp;Session="+((_28)?_28:""));
this.includeTrackingImg("http://adfarm.mediaplex.com/ad/bk/9498-55418-3840-0?WW_BYO_CONFIG=1&mpuid="+((_28)?_28:""));
}
try{
if(init_vehicname=="Camry"){
mboxUpdate("BuildYourCamry","page=RequestAQuoteThankYou");
}
}
catch(e){
Debug.error(e);
}
}
catch(e){
Debug.error(e);
}
},onErrorDialog:function(msg,_2a){
(_2a==App.strings.conflict_name)?_2a="Conflict: "+App.accordion.current_section:0;
this.submitOmni({pageName:"GM : Next Gen Configurator : #{series_name} : Conflict",prop31:"Error: "+_2a,prop1:" ",eVar1:" "});
},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,_2c){
if(_2c=="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(_2c=="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(){
if(this.is_summary_page){
this.submitOmni({prop2:"#{model_year}",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"});
}else{
if(this.completeConfigCheck()){
this.resetAllProperties();
this.submitOmni({prop32:"Lower",pageName:"#{omniMarket}:#{series_name}:BYT:Quote Request",eVar6:"#{omniMarket}:BYT:Request A Quote",eVar12:this.modelString,eVar17:App.vehicle.totalMsrp,events:"event6, event31",products:";;;;event31="+App.vehicle.totalMsrp});
}else{
this.submitOmni({prop2:"#{model_year}",eVar15:this.getSummaryPageZip(),prop32:"Lower",pageName:"#{omniMarket}:#{series_name}:BYT:Quote Request",eVar6:"#{omniMarket}:BYT:Request A Quote"});
}
}
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(_2d,_2e){
this.submitOmni({eVar25:"#{omniMarket}:#{series_name}",prop7:this.getSummaryPageZip(),eVar15:this.getSummaryPageZip(),eVar14:((_2e.position)?parseInt(_2e.position)+1:1),prop46:"#{omniMarket}:#{series_name}:BYT:Maps & Directions",events:"event4,event8",products:";"+((_2e.id)?(_2e.id):""),prop16:((_2e.id)?(_2e.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(){
this.submitOmni({pageName:"GM : Next Gen Configurator : #{series_name} : Compare"});
},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(_2f){
return App.panes&&App.panes[_2f].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,_32,_33){
ns=s_account;
if(str!=""&&str!=null){
ns+=","+str;
}
s_linkType=((_33)?_33:"o");
s_linkName=_32;
void (s.tl((new Object),((_33)?_33:"o"),_32));
}
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._Warranty=Class.create();
Object.extend(_Warranty.prototype,ControllerCommon);
Object.extend(_Warranty.prototype,PopupCommon);
Object.extend(_Warranty.prototype,{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(){
$("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.ZipEditPanel=Class.create();
Object.extend(ZipEditPanel.prototype,ControllerCommon);
Object.extend(ZipEditPanel.prototype,{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"));
}
}
}
}});
}

