/**
 * DO NOT EDIT THIS FILE!
 * This is a generated file.  Your changes will be overwritten.
 */
var Configurator=new Object();
Configurator.Queue=new Ajax.Queue(Ajax.Queue.FIFO);

with(Configurator){
Configurator.Accordian=Class.create();
Object.extend(Accordian.prototype,{initialize:function(_1,_2){
this.element=_1;
this.current_section=null;
this.options=_2||{};
this.sections=document.getElementsByClassName("section",_1).map(function(el){
return new AccordianSection(el,this,(!["accessories_section","colors_section"].include(el.id)));
}.bind(this));
var _4=null;
if(match=window.location.href.match(/tabname=([^&]+)/i)){
if(this.sections.find(function(s){
return s.name==match[1];
})){
_4=match[1];
}
}
this.showSection(_4||this.sections[0].name);
NotificationCenter.addSubscriber("PanelComplete Status Change",this,"handleStatusChange");
},showSection:function(_6){
if(_6!=this.current_section){
var _7=new Effect.Parallel(this.sections.map(function(_8){
return (_8.name==_6)?_8.expand():_8.collapse();
}).reduce().flatten(),{duration:0.5});
NotificationCenter.sendNotification("Tab Changed",[_6,this.current_section]);
this.current_section=_6;
}
},panelForName:function(_9){
var _a=this.sections.find(function(_b){
return _b.name==_9;
});
if(_a){
return _a.content_pane;
}else{
return null;
}
},handleStatusChange:function(_c,_d){
try{
this.sections.findByProperty("name",_d.pane_name).setComplete(_d.is_complete);
}
catch(e){
Debug.error(e);
}
}});
Configurator.AccordianSection=Class.create();
Configurator.AccordianSection.OPEN=1;
Configurator.AccordianSection.CLOSED=2;
Configurator.AccordianSection.OPENING=3;
Configurator.AccordianSection.CLOSING=4;
Object.extend(AccordianSection.prototype,{initialize:function(_e,_f,_10){
if(_10!==false){
_10=true;
}
this.element=_e;
this.accordian=_f;
this.name=_e.id.match(/(.*)_section/i)[1];
this.header=document.getElementsByClassName("section_header",_e)[0];
this.header_title=this.element.getElementsByTagName("h3")[0];
this.body=document.getElementsByClassName("section_body",_e)[0];
this.footer=document.getElementsByClassName("section_foot",_e)[0];
this.is_complete=false;
this.open_color="#000000";
this.closed_color="#888888";
this.complete_color="#FFFFFF";
if(_10){
this.scrollbox=new ScrollBox(this.body,{auto_hide:true});
this.content_pane=this.scrollbox.content_div;
}else{
this.content_pane=this.body;
}
this.state=AccordianSection.CLOSED;
Element.addClassName(this.element,"closed");
Event.observe(this.header_title,"click",this.header_clicked.bindAsEventListener(this));
},setComplete:function(_11){
this.is_complete=_11;
if(this.state==AccordianSection.CLOSED||this.state==AccordianSection.CLOSING){
new Effect.FontColor(this.header_title,{endColor:this.is_complete?this.complete_color:this.closed_color});
}
var _12=document.getElementsByClassName("section_editlink",this.header)[0];
if(_11){
Element.addClassName(this.element,"complete");
if(this.state==AccordianSection.CLOSED||this.state==AccordianSection.CLOSING){
_12.style.visibility="visible";
}
}else{
Element.removeClassName(this.element,"complete");
}
},calculateCellHeight:function(){
return this.accordian.element.clientHeight-this.accordian.sections.sum(function(_13){
return _13.header.offsetHeight+(_13.footer?_13.footer.offsetHeight:0);
});
},expand:function(){
if(this.state==AccordianSection.CLOSED){
this.state=AccordianSection.OPENING;
Element.addClassName(this.element,"open");
Element.removeClassName(this.element,"closed");
var _14=document.getElementsByClassName("section_editlink",this.header)[0];
if(_14){
_14.style.visibility="hidden";
}
return [new Effect.Scale(this.body,100,{sync:true,scaleY:true,scaleX:false,scaleContent:false,scaleFrom:0,scaleMode:{originalHeight:this.calculateCellHeight()},afterFinish:this.expand_onComplete.bind(this)}),new Effect.FontColor(this.header_title,{sync:true,endColor:this.open_color}),new Effect.FontSize(this.header_title,{sync:true,endSize:"17px"})];
}
},expand_onComplete:function(){
this.state=AccordianSection.OPEN;
var _15=document.getElementsByClassName("section_editlink",this.header)[0];
if(_15){
_15.style.visibility="hidden";
}
},collapse:function(){
if(this.state==AccordianSection.OPEN){
this.state=AccordianSection.CLOSING;
var _16=document.getElementsByClassName("section_editlink",this.header)[0];
if(_16){
_16.style.visibility="visible";
new Effect.Opacity(_16,{duration:0.5,from:0,to:1});
}
return [new Effect.Scale(this.body,0,{sync:true,scaleY:true,scaleX:false,scaleContent:false,scaleMode:{originalHeight:this.calculateCellHeight()},afterFinish:this.collapse_onComplete.bind(this)}),new Effect.FontColor(this.header_title,{sync:true,endColor:this.complete_color}),new Effect.FontSize(this.header_title,{sync:true,endSize:"11px"})];
}
},collapse_onComplete:function(){
this.state=AccordianSection.CLOSED;
Element.addClassName(this.element,"closed");
Element.removeClassName(this.element,"open");
},header_clicked:function(_17){
var _18=!!this.accordian.sections.find(function(_19){
return _19.state!=AccordianSection.OPEN&&_19.state!=AccordianSection.CLOSED;
});
if(!_18&&(!this.accordian.options.header_onClick||this.accordian.options.header_onClick(this))){
this.accordian.showSection(this.name);
}
}});
}

Configurator.DOM={};
Configurator.DOM.createRadioButton=function(_1){
if(document.all){
return document.createElement("<input type=\"radio\" name=\""+_1+"\">");
}else{
var _2=document.createElement("input");
_2.type="radio";
_2.name=_1;
return _2;
}
};
Configurator.DOM.IEPNG=function(_3,_4,_5,_6,_7){
if((document.all)&&(!window.XMLHttpRequest)){
if(_3.src.match(/\.png(\?.*)?$/i)||_4){
try{
if(_6&&_7){
Configurator.Event.asap(function(){
var _8=_3.src;
_3.src="/configurator/images/shim.gif";
_3.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_8+"', sizingMethod='scale')";
(_5)?0:_3.style.height=_7+"px";
(_5)?0:_3.style.width=_6+"px";
});
}else{
new Ajax.ImageLoader(_3.src,{onComplete:function(_9){
Configurator.Event.asap(function(){
_3.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_9.src+"', sizingMethod='scale')";
(_5)?0:_3.style.height=_9.height+"px";
(_5)?0:_3.style.width=_9.width+"px";
});
}});
Configurator.Event.asap(function(){
_3.src="/configurator/images/shim.gif";
});
}
}
catch(e){
Debug.error(e,e.description);
}
}
}
return _3;
};
Configurator.DOM.getLeftX=function(id,_b){
var _c=$(id);
_b=(_b)?$(_b):_b;
var _d=0;
if(_c.offsetParent){
while(_c.offsetParent){
_d+=_c.offsetLeft;
_c=_c.offsetParent;
if(_b&&_c==_b){
break;
}
}
}else{
if(_c.x){
_d+=_c.x;
}
}
return _d;
};
Configurator.DOM.getLeftXAsPx=function(id,_f){
return Configurator.DOM.getLeftX(id,_f)+"px";
};
Configurator.DOM.getRightX=function(id,_11){
var obj=$(id);
return Configurator.DOM.getLeftX(obj,_11)+obj.offsetWidth;
};
Configurator.DOM.getRightXAsPx=function(id,_14){
return Configurator.DOM.getRightX(id,_14)+"px";
};
Configurator.DOM.getBottomY=function(id,_16){
var obj=$(id);
return Configurator.DOM.getTopY(obj,_16)+obj.offsetHeight;
};
Configurator.DOM.getBottomYAsPx=function(id,_19){
return Configurator.DOM.getBottomY(id,_19)+"px";
};
Configurator.DOM.getTopY=function(id,_1b){
var obj=$(id);
_1b=$(_1b);
var _1d=0;
var _1e=0;
if(obj.offsetParent){
while(obj.offsetParent){
_1e++;
_1d+=obj.offsetTop;
obj=obj.offsetParent;
if(_1b&&obj==_1b){
break;
}
}
}else{
if(obj.y){
_1d+=obj.y;
}
}
return _1d;
};
Configurator.DOM.getTopYAsPx=function(id,_20){
return Configurator.DOM.getTopY(id,_20)+"px";
};
Configurator.DOM.getBoundries=function(id,_22){
var _23={leftX:Configurator.DOM.getLeftX(id,_22),rightX:Configurator.DOM.getRightX(id,_22),topY:Configurator.DOM.getTopY(id,_22),bottomY:Configurator.DOM.getBottomY(id,_22),width:Configurator.DOM.getRightX(id,_22)-Configurator.DOM.getLeftX(id,_22),height:Configurator.DOM.getBottomY(id,_22)-Configurator.DOM.getTopY(id,_22)};
return _23;
};
Configurator.DOM.isInBounds=function(id,x,y){
var _27=DOM.getBoundries(id);
if(x<=_27.leftX||x>=_27.rightX){
return false;
}
if(y<=_27.topY||y>=_27.bottomY){
return false;
}
return true;
};

Configurator.Element=Class.create();
Object.extend(Configurator.Element,Element);
Object.extend(Configurator.Element,{setConfiguratorOpacity:function(_1,_2){
if(_2==100){
_1.style.opacity="";
_1.style.filter="";
}else{
_1.style.opacity=_2/100;
_1.style.filter="alpha(opacity="+_2+")";
}
return _1;
},setOpacity:function(_3,_4){
if(_4==100){
_3.style.opacity="";
_3.style.filter="";
}else{
_3.style.opacity=_4/100;
_3.style.filter="alpha(opacity="+_4+")";
}
return _3;
},emptyElement:function(_5){
while(_5.childNodes.length){
_5.removeChild(_5.firstChild);
}
},getComputedStyle:function(el,_7){
var x=document.getElementById(el);
if(x.currentStyle){
var y=x.currentStyle[_7];
}else{
if(window.getComputedStyle){
var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(_7);
}
}
return y;
}});

Configurator.Event=Class.create();
Object.extend(Configurator.Event,Event);
Configurator.Event.asap=function(_1){
if(document.body){
_1();
}else{
Configurator.Event.observe(window,"onload",_1);
}
};
Object.extend(Configurator.Event,{_domReady:function(){
if(arguments.callee.done){
return;
}
arguments.callee.done=true;
if(this._timer){
clearInterval(this._timer);
}
this._readyCallbacks.each(function(f){
f();
});
this._readyCallbacks=null;
},onDOMReady:function(f){
if(!this._readyCallbacks){
var _4=this._domReady.bind(this);
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",_4,false);
}
if(/WebKit/i.test(navigator.userAgent)){
this._timer=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
_4();
}
},10);
}
Configurator.Event.observe(window,"load",_4);
Configurator.Event._readyCallbacks=[];
}
Configurator.Event._readyCallbacks.push(f);
},getMousePos:function(_5){
if(document.all){
var _6=_5.clientX;
var _7=_5.clientY;
}else{
var _6=_5.pageX;
var _7=_5.pageY;
}
if(_6<0){
_6=0;
}
if(_7<0){
_7=0;
}
try{
if(window.Configurator&&Configurator.Event){
Configurator.Event.mouse_x=_6;
Configurator.Event.mouse_y=_7;
}
}
catch(e){
}
}});
Configurator.Event.onDOMReady(function(){
Event.observe(document.body,"mousemove",Configurator.Event.getMousePos.bindAsEventListener(this));
});

Configurator.createImageNode=function(_1,_2,_3){
var _4=document.createElement("img");
if(_1){
_4.src=_1;
}
if(_2&&_3){
return Configurator.DOM.IEPNG(_4,false,false,_2,_3);
}
return Configurator.DOM.IEPNG(_4);
};
Configurator.precache_image_cache=[];
Configurator.precache_image=function(_5){
var _6=new Ajax.ImageLoader(_5,{wait:true});
Configurator.Queue.addAction(_6,{priority:2});
Configurator.precache_image_cache.push(_6);
return _6.node;
};

Configurator.NumberFormatters={moneyFormat:function(_1){
var _2=(this+"").replace("-","");
var _3=_2.split(".");
var _4=_3[0];
if(_3.length>1){
var _5=_3[1];
}else{
var _5="00";
}
if(_4.length>3){
_4=(_4.length%3?_4.substring(0,_4.length%3)+",":"")+_4.substring(_4.length%3).chunkSplit(3).join(",");
}
return (parseInt(this)<0?"-":"")+_4+(_5.length&&_1?"."+_5:"");
}};
Object.extend(String.prototype,Configurator.NumberFormatters);
Object.extend(Number.prototype,Configurator.NumberFormatters);

Configurator.Tooltip=Class.create();
with(Configurator){
Tooltip.POSITION_MOUSE="POSITION_MOUSE";
Tooltip.POSITION_BELOW="POSITION_BELOW";
Tooltip.POSITION_ABOVE="POSITION_ABOVE";
Tooltip.POSITION_RIGHT="POSITION_RIGHT";
Object.extend(Tooltip.prototype,Configurator.ControllerCommon);
Object.extend(Tooltip.prototype,{initialize:function(_1,_2,_3){
this.element=_1;
this.default_text=_2;
this.current_content="";
this.triggers=[];
this.closeTimer=null;
this.opts=Object.extend({delay:0,enabled:true,position_type:Tooltip.POSITION_MOUSE},_3||{});
this.enabled_events=[];
this.tt_element=document.createElement("div");
Element.addClassName(this.tt_element,"tooltip");
this.tt_element.style.visibility="hidden";
document.body.appendChild(this.tt_element);
this.scale_nine=new ScaleNine(this.tt_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}});
this.addTrigger(_1);
},display:function(_4,_5){
if(!_5){
_5=this.element;
}
this.tt_element.style.display="block";
this.updateText(_4||this.default_text);
this.reposition(_5);
if(this.opts.position_type==Tooltip.POSITION_MOUSE){
this.enabled_events.push(Event.observe(_5,"mousemove",function(){
this.reposition(_5);
}.bind(this)));
}
this.tt_element.style.visibility="";
},hide:function(){
this.tt_element.style.visibility="hidden";
this.tt_element.style.display="none";
var e;
while(e=this.enabled_events.pop()){
Event.stopObserving(e);
}
},updateText:function(_7){
if(this.current_content!=_7){
this.tt_element.innerHTML=_7;
this.scale_nine.render();
this.current_content=_7;
}
},addTrigger:function(_8){
if(!this.triggers.findByProperty("element",_8)){
this.triggers.push({element:_8,onEvent:Event.observe(_8,"mouseover",function(_9){
this.handle_mouseover(_9,_8);
}.bindAsEventListener(this)),offEvent:Event.observe(_8,"mouseout",this.handle_mouseout.bindAsEventListener(this))});
}
},removeTrigger:function(_a){
this.triggers=this.triggers.findAll(function(_b){
if(_b.element==_a){
Element.stopObserving(_b.onEvent);
Element.stopObserving(_b.offEvent);
return false;
}else{
return true;
}
});
},reposition:function(_c){
switch(this.opts.position_type){
case Tooltip.POSITION_MOUSE:
var _d=Event.mouse_y-(this.scale_nine.background_div.offsetHeight+10);
if(_d<document.documentElement.scrollTop){
_d=Event.mouse_y+10;
}
var _e=Event.mouse_x+5;
this.tt_element.style.top=_d+"px";
this.tt_element.style.left=_e+"px";
break;
case Tooltip.POSITION_BELOW:
var _f=Configurator.PopupCommon.positionBelowElement(this.scale_nine.background_div,_c,{return_only:true});
this.tt_element.style.top=(_f.top+3)+"px";
this.tt_element.style.left=(_f.left)+"px";
break;
case Tooltip.POSITION_ABOVE:
var _f=Configurator.PopupCommon.positionAboveElement(this.scale_nine.background_div,_c,{return_only:true});
this.tt_element.style.top=(_f.top-3)+"px";
this.tt_element.style.left=(_f.left)+"px";
break;
case Tooltip.POSITION_RIGHT:
Configurator.PopupCommon.positionRightOfElement(this.tt_element,_c);
break;
}
},setText:function(_10){
this.default_text=_10;
},enable:function(){
this.opts.enabled=true;
},disable:function(){
this.opts.enabled=false;
},handle_mouseover:function(_11,_12){
clearTimeout(this.closeTimer);
if(this.opts.enabled){
this.display(null,_12);
}
},handle_mouseout:function(_13){
this.closeTimer=setTimeout(function(){
this.hide();
}.bind(this),50);
}});
}

Configurator.XML={};
Configurator.XML.getRootNode=function(_1){
switch(_1.childNodes.length){
case 1:
return _1.childNodes[0];
break;
case 2:
return _1.childNodes[1];
break;
default:
return false;
break;
}
};

document.getElementsByClassName=function(_1,_2,_3){
var _4;
if(_3){
_4=$NL(($(_2)||document.body).getElementsByTagName(_3));
}else{
if(document.all){
_4=$NL(($(_2)||document.body).all);
}else{
_4=$NL(($(_2)||document.body).getElementsByTagName("*"));
}
}
_1=_1.toUpperCase();
return _4.inject([],function(_5,_6){
var _7=$A(_6.className.toUpperCase().split(" "));
_7.each(function(_8){
if(_8==_1){
_5.push(_6);
}
});
return _5;
});
};

