if(typeof Meetup==="undefined"){Meetup={}}Meetup.DiscreteBackButton=function(willKeep){return this.initialize(Meetup.DiscreteBackButton,this,arguments)};Meetup.DiscreteBackButton.prototype=new Meetup.DiscreteBase();Meetup.DiscreteBackButton.prototype.init=function(copy){var tmp,parent=this.parent,G1=MochiKit.DOM.getFirstElementByTagAndClassName,MSG=MochiKit.Style.getStyle,ELMS=this.elements,root=ELMS.root;ELMS.bg=G1("div","bg",root);ELMS.bgLeft=G1("div","left",ELMS.bg);ELMS.bgCenter=G1("div","center",ELMS.bg);ELMS.bgRight=G1("div","right",ELMS.bg);ELMS.display=G1("div","display",root);ELMS.interact=G1("div","interact",root);tmp=this.parent.getNumeric(MSG(ELMS.bgLeft,"width"));if(tmp!==null){this.pixWidthLeft=Math.round(tmp)}else{throw new Error("You have to set width on bgLeft")}tmp=this.parent.getNumeric(MSG(ELMS.bgRight,"width"));if(tmp!==null){this.pixWidthRight=Math.round(tmp)}else{throw new Error("You have to set width on bgRight")}tmp=this.parent.getNumeric(MSG(root,"height"));if(tmp!==null){this.h=Math.round(tmp)}else{throw new Error("You have to set height on root element")}this.setCopy(copy);this.bindEvents();this.evPointers.onRootClick=MochiKit.Signal.connect(this.elements.interact,"onclick",this.bindedFunctions.onRootClick);this.parent.swapElementsBackgroundToFilter(ELMS.bgLeft,ELMS.bgRight);this.parent.swapElementsBackgroundToFilterScaled(ELMS.bgCenter);return this.publicMethods()};Meetup.DiscreteBackButton.ROOT_CLASS_NAME="J_discreteBackButton";Meetup.DiscreteBackButton.EVENT_NAMES=["onRootClick","onBeforeShow","onAfterShow","onBeforeHide","onAfterHide"];Meetup.DiscreteBackButton.SERIALIZED_HTML='<div class="bg"><div class="left"></div><div class="center"></div><div class="right"></div></div><div class="display"></div><div class="interact"></div>';Meetup.DiscreteBackButton.prototype.pixWidthLeft=0;Meetup.DiscreteBackButton.prototype.pixWidthRight=0;Meetup.DiscreteBackButton.prototype.setBodyWidth=function(w){w=w+1;this.w=this.pixWidthLeft+w+this.pixWidthRight;this.elements.root.style.width=this.w+"px";this.elements.bgCenter.style.width=w+"px";this.elements.display.style.width=w+"px"};Meetup.DiscreteBackButton.prototype.setCopy=function(copy){var obj=this.parent.getTextDimension(copy,this.elements.display);this.setBodyWidth(obj.w);this.elements.display.innerHTML=copy};Meetup.DiscreteBackButton.prototype.onRootClick=function(ev){ev.stop();var i,len,click=this.events.onRootClick;if(click){for(i=0,len=click.length;i<len;++i){click[i](ev)}}};Meetup.DiscreteBackButton.translateCoordinate=function(x,y,w,h,offsetX,offsetY){var left,top;if(offsetX===true){left=x}else{left=x+offsetX}if(offsetY===true){top=y-h}else{top=y+offsetY}return{x:left,y:top}};