Carousel.Extra=new Class({Extends:Carousel,Binds:["update","start","stop"],initialize:function(options){this.parent($merge({interval:10,delay:10},options));["previous","next"].each(function(val){if($(this.options[val])){$(this.options[val]).addEvent("click",function(e){e.stop();if(this.running){this.stop().start.delay(this.options.delay*1000);}}.bind(this));}},this);this.reverse=!!this.options.reverse;this.running=false;this.timer=new PeriodicalExecuter(this.update,this.options.interval);return this;
},update:function(){return this[this.reverse?"previous":"next"]();},start:function(){this.timer.registerCallback();this.running=true;return this;},stop:function(){this.timer.stop();this.running=false;return this;}});
