var AutomateClass=new Class({mootools:1.2,options:{timeout:5000,maxpause:10000,startindex:0},initialize:function(slideshow,thumbnail,menu,taille,options){if($defined(options)){this.setOptions(options);}this.slideshow=slideshow;this.thumbnail=thumbnail;this.menu=menu;this.taille=taille;this.index=this.options.startindex-1;this.starttimer();},switchTo:function(index){this.stoptimer();this.index=this.checkAndRotateIndex(index);try{slideshow.switchTo(this.index);menu.switchTo(this.index);thumbnail.switchTo(this.index);}catch(e){}this.starttimer(this.options.maxpause);},stoptimer:function(){try{$clear(this.timerid);}catch(e){}finally{this.timerid=null;}},starttimer:function(timeout){this.timerid=(function(){this.stoptimer();this.index=this.checkAndRotateIndex(this.index+1);try{slideshow.switchTo(this.index);menu.switchTo(this.index);thumbnail.switchTo(this.index);}catch(e){}this.starttimer(this.options.timeout);}.bind(this)).delay(timeout);},checkAndRotateIndex:function(index){index=index>=0?index:this.taille-1;index=index>=this.taille?0:index;return index;}});AutomateClass.implement(new Events,new Options);