var SlidingTabs=new Class({options:{startingSide:false,activeButtonClass:"active",activationEvent:"click",wrap:true,slideEffect:{duration:400}},current:null,buttons:false,outerSlidesBox:null,innerSlidesBox:null,panes:null,fx:null,initialize:function(B,C,A){if(B){this.buttons=$(B).getChildren()}this.outerSlidesBox=$(C);this.innerSlidesBox=this.outerSlidesBox.getFirst();this.panes=this.innerSlidesBox.getChildren();this.setOptions(A);this.fx=new Fx.Scroll(this.outerSlidesBox,this.options.effect);this.current=this.options.startingSlide?this.panes.indexOf($(this.options.startingSlide)):0;if(this.buttons){this.buttons[this.current].addClass(this.options.activeButtonClass)}this.outerSlidesBox.setStyle("overflow","hidden");this.panes.each(function(E,D){E.setStyle("float","left");E.setStyle("width",this.outerSlidesBox.getStyle("width"))}.bind(this));this.innerSlidesBox.setStyle("float","left");this.innerSlidesBox.setStyle("width",(this.outerSlidesBox.offsetWidth.toInt()*this.panes.length)+"px");this.innerSlidesBox.setStyle("overflow","hidden");this.fx.toElement(this.options.startingSlide);if(this.buttons){this.buttons.each(function(D){D.addEvent(this.options.activationEvent,this.buttonEventHandler.bindWithEvent(this,D))}.bind(this))}},changeTo:function(A){var B={cancel:false,target:$(A)};this.fireEvent("change",B);if(B.cancel==true){return }if(this.buttons){this.buttons[this.current].removeClass(this.options.activeButtonClass)}this.current=this.panes.indexOf($(B.target));if(this.buttons){this.buttons[this.current].addClass(this.options.activeButtonClass)}this.fx.stop();this.fx.toElement(B.target)},buttonEventHandler:function(B,A){if(B.target==this.buttons[this.current]){return }this.changeTo(this.panes[this.buttons.indexOf($(A))])},next:function(){var A=this.current+1;if(A==this.panes.length){if(this.options.wrap==true){A=0}else{return }}this.changeTo(this.panes[A])},previous:function(){var A=this.current-1;if(A<0){if(this.options.wrap==true){A=this.panes.length-1}else{return }}this.changeTo(this.panes[A])}});SlidingTabs.implement(new Options,new Events)