/**
 * DO NOT EDIT THIS FILE!
 * This is a generated file.  Your changes will be overwritten.
 */
Configurator.ConfirmationPanel=Class.create();
Object.extend(Configurator.ConfirmationPanel.prototype,{initialize:function(){
},confirmPanel:function(_1,_2){
$(_1).style.visibility="visible";
this.observer={cancelConfirmWatcher:function(e){
var _4=$(e.target||e.srcElement);
if(!_4.descendantOf($(_1))&&_4!=$(_1)&&_4!=$(_2)){
this.cancelConfirm($(_1));
}
}};
this.observer.closer=this.observer.cancelConfirmWatcher.bindAsEventListener(this);
setTimeout(function(){
Event.observe(document,"click",this.observer.closer);
}.bind(this),10);
},cancelConfirm:function(_5){
$(_5).style.visibility="hidden";
Event.stopObserving(document,"click",this.observer.closer);
},confirmPanelSelection:function(_6,_7){
NotificationCenter.sendNotification("Confirm Panel Confirmed",_6);
if(_6=="clear_all_confirm"){
var _8=(new Cookie("saved_configuration","/byt")).erase();
}
this.changeURL(_7);
$(_6).style.visibility="hidden";
},changeURL:function(_9){
setTimeout(function(){
window.location.href=_9;
}.bind(this),500);
}});

function DebugDefault(){
}
DebugDefault.info=function(){
};
DebugDefault.log=function(){
};
DebugDefault.debug=function(){
};
DebugDefault.warn=function(){
};
DebugDefault.error=function(){
};
DebugDefault.profile=function(){
};
DebugDefault.profileEnd=function(){
};
DebugDefault.timer=function(){
};
DebugDefault.timerEnd=function(){
};
function DebugWebKit(){
}
DebugWebKit.info=function(_1,_2){
DebugWebKit.console("INFO",_1,_2);
};
DebugWebKit.log=DebugWebKit.info;
DebugWebKit.debug=function(_3,_4){
DebugWebKit.console("DEBUG",_3,_4);
};
DebugWebKit.warn=function(_5,_6){
DebugWebKit.console("WARN",_5,_6);
};
DebugWebKit.error=function(_7,_8){
DebugWebKit.console("ERROR",_7,_8);
};
DebugWebKit.console=function(_9,_a,_b){
var _c=[_9,": ",_a].join("");
if(_b){
_c=[_c," Object ",_b.toString()].join("");
}
window.console.log(_c);
};
DebugWebKit.profile=function(){
};
DebugWebKit.profileEnd=function(){
};
DebugWebKit.timer=function(){
};
DebugWebKit.timerEnd=function(){
};
if(window.console&&window.console.debug){
Debug=console;
Debug.log=console.debug;
}else{
if(window.console&&navigator.userAgent.toLowerCase().indexOf("webkit")>-1){
Debug=DebugWebKit;
}else{
Debug=DebugDefault;
}
}

with(Configurator){
Configurator._FlashBridge=Class.create();
Object.extend(_FlashBridge.prototype,{initialize:function(){
this.load_complete=false;
},swfLoadComplete:function(_1){
this.load_complete=true;
App.flash_pane.sendVehicleToFlash();
},rttLoadComplete:function(){
},setSeries:function(_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c){
if(document["configurator_byt"]&&document["configurator_byt"].setSeries){
document["configurator_byt"].setSeries(_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c);
}
},setRegister:function(_d,_e){
if(document["configurator_byt"]&&document["configurator_byt"].setRegister){
document["configurator_byt"].setRegister(_d,_e);
}
}});
}
Configurator.FlashBridge=new Configurator._FlashBridge();


Configurator.LoadingPanel=Class.create();
Object.extend(Configurator.LoadingPanel.prototype,{initialize:function(_1){
this.container_element=_1;
this.modal_backdrop=new Configurator.ModalBackdrop(_1);
this.isEnabled=false;
this.resize_interval=false;
Configurator.Event.asap(function(){
this.element=document.createElement("div");
this.element.className="loading";
this.element.style.display="none";
this.element.appendChild(Configurator.createImageNode("/configurator/images/loading.gif"));
this.element.appendChild(document.createTextNode(" Loading..."));
this.attach();
}.bind(this));
NotificationCenter.addSubscriber("Tab Changed",this,this.resize);
},attach:function(){
this.container_element.appendChild(this.element);
this.modal_backdrop.attach();
this.resize();
},detach:function(){
this.container_element.removeChild(this.element);
},resize:function(){
this.modal_backdrop.resize();
this.modal_backdrop.element.style.top="2px";
this.element.style.top=(Math.floor(this.container_element.offsetHeight/2)-this.element.offsetHeight)+"px";
this.element.style.left=(Math.floor((this.container_element.offsetWidth-this.element.offsetWidth)/2))+"px";
},enable:function(){
this.isEnabled=true;
this.element.style.display="block";
this.modal_backdrop.enable();
this.resize_interval=setInterval(this.resize.bind(this),100);
},disable:function(){
this.isEnabled=false;
this.element.style.display="none";
this.modal_backdrop.disable();
if(this.resize_interval){
clearInterval(this.resize_interval);
this.resize_interval=false;
}
}});

Configurator.ModalBackdrop=Class.create();
Object.extend(Configurator.ModalBackdrop.prototype,{initialize:function(_1){
this.isFlashHidden=false;
this.scrollers=[];
if($("modalBackdrop")&&!_1){
this.element=$("modalBackdrop");
}else{
this.container_element=_1;
this.element=document.createElement("div");
this.element.style.zIndex=1001;
if(!this.container_element){
this.element.id="modalBackdrop";
}
if(document.all){
this.element.className="modalBackdropIE";
}else{
this.element.className="modalBackdrop";
}
this.element.style.display="none";
Event.observe(window,"resize",this.resize.bind(this));
Event.observe(window,"scroll",this.resize.bind(this));
Event.observe(this.element,"click",this.handleClick.bindAsEventListener(this));
this.attach();
}
},attach:function(){
if(document.body){
if(this.container_element){
this.container_element.appendChild(this.element);
}else{
document.body.appendChild(this.element);
}
}else{
Event.observe(window,"load",function(){
if(this.container_element){
this.container_element.appendChild(this.element);
}else{
document.body.appendChild(this.element);
}
}.bind(this));
}
},resize:function(){
if(this.container_element){
this.element.style.height=this.container_element.offsetHeight+"px";
this.element.style.width=this.container_element.offsetWidth+"px";
}else{
this.element.style.width=document.documentElement.offsetWidth+"px";
this.element.style.width=document.documentElement.scrollWidth+"px";
if(document.documentElement.scrollHeight){
this.element.style.height=document.documentElement.offsetHeight+"px";
var ps=this.getPageSize();
var _3=ps[1]>document.documentElement.scrollHeight?ps[1]:document.documentElement.scrollHeight;
if(this.isIE6()){
var _4=document.documentElement.clientWidth;
_4-=1;
this.element.style.width=_4+"px";
_3=document.documentElement.clientHeight;
}
this.element.style.height=_3+"px";
}else{
this.element.style.height=window.innerHeight+window.scrollY+"px";
}
}
},getPageSize:function(){
var _5,_6;
if(window.innerHeight&&window.scrollMaxY){
_5=document.body.scrollWidth;
_6=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_5=document.body.scrollWidth;
_6=document.body.scrollHeight;
}else{
_5=document.body.offsetWidth;
_6=document.body.offsetHeight;
}
}
var _7,_8;
if(self.innerHeight){
_7=self.innerWidth;
_8=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_7=document.documentElement.clientWidth;
_8=document.documentElement.clientHeight;
}else{
if(document.body){
_7=document.body.clientWidth;
_8=document.body.clientHeight;
}
}
}
if(_6<_8){
pageHeight=_8;
}else{
pageHeight=_6;
}
if(_5<_7){
pageWidth=_7;
}else{
pageWidth=_5;
}
arrayPageSize=new Array(pageWidth,pageHeight,_7,_8);
return arrayPageSize;
},enable:function(_9){
this.element.style.display="block";
this.resize();
if(_9){
this.callbacks=_9;
}
document.getElementsByClassName("scroller",this.container_element).each(function(e){
if(e.style.display!="none"){
e.style.display="none";
this.scrollers.push(e);
return true;
}
return false;
}.bind(this));
if(!this.container_element){
this.hideAllFlashInSafari();
}
},disable:function(){
this.callbacks=null;
this.element.style.display="none";
while(e=this.scrollers.shift()){
e.style.display="";
}
if(!this.container_element){
this.showAllFlashInSafari();
}
},handleClick:function(_b){
if(this.callbacks&&this.callbacks.onClick){
this.callbacks.onClick(_b);
}
},hideAllFlashInSafari:function(){
try{
if(!this.isFlashHidden&&(App&&App.is_3d)){
var _c=$A(document.getElementsByTagName("OBJECT")).concat($A(document.getElementsByTagName("EMBED")));
_c.each(function(_d){
_d.parentNode.style.visibility="hidden";
});
this.isFlashHidden=true;
}
}
catch(e){
}
},showAllFlashInSafari:function(){
try{
if(this.isFlashHidden&&(App&&App.is_3d)){
var _e=$A(document.getElementsByTagName("OBJECT")).concat($A(document.getElementsByTagName("EMBED")));
_e.each(function(_f){
_f.parentNode.style.visibility="visible";
});
this.isFlashHidden=false;
}
}
catch(e){
}
},isMacBrowser:function(){
if(navigator.userAgent.toLowerCase().indexOf("mac")>-1){
return true;
}
return false;
},isIE6:function(){
var rv=0;
if(navigator.appName=="Microsoft Internet Explorer"){
var ua=navigator.userAgent;
var re=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
if(re.exec(ua)!=null){
rv=parseFloat(RegExp.$1);
}
}
if(rv==6){
return true;
}else{
return false;
}
}});

Configurator.ScaleNine=Class.create();
Object.extend(Configurator.ScaleNine.prototype,{initialize:function(_1,_2){
this.root_element=_1;
this.parts=_2;
this.renderable=false;
this.image_sizes_specified=true;
this.background_div=document.createElement("div");
this.precache_images=[];
$H(this.parts).each(function(kv){
var _4=$H(kv[1]);
if(_4.image){
this.parts[kv[0]]["image_node"]=document.createElement("img");
if((_4.width)&&(_4.height)){
this.parts[kv[0]]["image_node"].src=_4.image;
this.parts[kv[0]]["image_node"].width=_4.width;
this.parts[kv[0]]["image_node"].height=_4.height;
}else{
this.image_sizes_specified=false;
var _5=new Ajax.ImageLoader(_4.image,{wait:true,onComplete:function(){
this.parts[kv[0]]["image_node"].src=_4.image;
if(!this.precache_images.find(function(l){
return !l.loaded;
})){
this.renderable=true;
if(this.needs_render){
this.render();
}
}
}.bind(this)});
this.precache_images.push(_5);
}
}
}.bind(this));
if(this.image_sizes_specified){
this.renderable=true;
}
this.precache_images.each(function(pi){
Configurator.Queue.addAction(pi,{priority:2});
});
this.render();
},render:function(){
if(!this.renderable){
this.needs_render=true;
return false;
}
if(!$NL(this.root_element.childNodes).include(this.content_div)){
this.content_div=document.createElement("div");
Element.addClassName(this.content_div,"content");
while(this.root_element.childNodes.length){
this.content_div.appendChild(this.root_element.childNodes[0]);
}
this.background_div.style.zIndex="1";
this.root_element.appendChild(this.background_div);
this.root_element.appendChild(this.content_div);
this.content_div.style.zIndex="2";
this.content_div.style.position="absolute";
[this.background_div].each(function(e){
e.style.width="100%";
e.style.height="100%";
e.style.position="absolute";
});
}
Configurator.Element.emptyElement(this.background_div);
this.top_row=document.createElement("div");
this.background_div.appendChild(this.top_row);
this.setBackground(this.top_row,this.parts.tm.image,"top","left");
this.top_row.style.marginLeft=this.parts.tl.image_node.width+"px";
this.top_row.style.marginRight=this.parts.tr.image_node.width+"px";
this.top_left=Configurator.createImageNode(this.parts.tl.image,this.parts.tl.image_node.width,this.parts.tl.image_node.height);
this.top_row.appendChild(this.top_left);
this.top_left.style.position="absolute";
this.top_left.style.top="0px";
this.top_left.style.left="0px";
this.top_right=Configurator.createImageNode(this.parts.tr.image,this.parts.tr.image_node.width,this.parts.tr.image_node.height);
this.top_row.appendChild(this.top_right);
this.top_right.style.position="absolute";
this.top_right.style.top="0px";
this.top_right.style.right="0px";
this.middle_row=document.createElement("div");
this.background_div.appendChild(this.middle_row);
(this.parts.mm.bg)?this.setBackground(this.middle_row,this.parts.mm.bg,"top","repeat-x"):0;
(this.parts.mm.color)?this.middle_row.style.backgroundColor=this.parts.mm.color:0;
this.middle_row.style.marginLeft=this.parts.ml.image_node.width+"px";
this.middle_row.style.marginRight=this.parts.mr.image_node.width+"px";
this.middle_left=document.createElement("img");
this.middle_left.src=this.parts.ml.image;
this.middle_row.appendChild(this.middle_left);
this.middle_left.style.position="absolute";
this.middle_left.style.left="0px";
this.middle_right=document.createElement("img");
this.middle_right.src=this.parts.mr.image;
this.middle_row.appendChild(this.middle_right);
this.middle_right.style.position="absolute";
this.middle_right.style.right="0px";
this.bottom_row=document.createElement("div");
this.background_div.appendChild(this.bottom_row);
this.setBackground(this.bottom_row,this.parts.bm.image,"bottom","left");
this.bottom_row.style.marginLeft=this.parts.tl.image_node.width+"px";
this.bottom_row.style.marginRight=this.parts.tr.image_node.width+"px";
this.bottom_left=Configurator.createImageNode(this.parts.bl.image,this.parts.bl.image_node.width,this.parts.bl.image_node.height);
this.bottom_row.appendChild(this.bottom_left);
this.bottom_left.style.position="absolute";
this.bottom_left.style.bottom="0px";
this.bottom_left.style.left="0px";
this.bottom_right=Configurator.createImageNode(this.parts.br.image,this.parts.br.image_node.width,this.parts.br.image_node.height);
this.bottom_row.appendChild(this.bottom_right);
this.bottom_right.style.position="absolute";
this.bottom_right.style.bottom="0px";
this.bottom_right.style.right="0px";
this.resize();
$NL(this.content_div.getElementsByTagName("img")).each(function(_9){
if(_9.src){
Configurator.DOM.IEPNG(_9);
}
});
},resize:function(){
this.background_div.style.width=this.content_div.offsetWidth+"px";
this.background_div.style.height=this.content_div.offsetHeight+"px";
this.top_row.style.height=this.parts.tm.image_node.height+"px";
this.bottom_row.style.height=this.parts.tm.image_node.height+"px";
var _a=(this.background_div.offsetHeight-(this.top_row.offsetHeight+this.bottom_row.offsetHeight));
if(_a>0){
this.middle_row.style.height=(this.background_div.offsetHeight-(this.top_row.offsetHeight+this.bottom_row.offsetHeight))+"px";
}
this.middle_left.style.top=this.top_row.offsetHeight+"px";
this.middle_left.style.height=this.middle_row.style.height;
this.middle_left.style.width=this.parts.ml.image_node.width+"px";
Configurator.DOM.IEPNG(this.middle_left,false,true,this.parts.ml.image_node.width,this.middle_row.style.height);
this.middle_right.style.top=this.top_row.offsetHeight+"px";
this.middle_right.style.height=this.middle_row.style.height;
this.middle_right.style.width=this.parts.mr.image_node.width+"px";
Configurator.DOM.IEPNG(this.middle_right,false,true,this.parts.mr.image_node.width,this.middle_row.style.height);
},setBackground:function(_b,_c,_d,_e){
if((document.all)&&(!window.XMLHttpRequest)&&(_c.match(/\.png(\?.*)?$/i))){
_b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+_c+"\", sizingMethod=\"scale\")";
}else{
_b.style.background="transparent url(\""+_c+"\") "+_d+" "+_e;
}
}});

