Fx.MooCarousel=new Class({options:{wrapperId:"demo-wrapper",innerId:"demo-inner",contentClass:"scrolling-content",hasNavigator:false,navigatorId:"demo-bar",nameUsed:"scroll",duration:500},initialize:function(opt){if(opt){if(opt.wrapperId){this.options.wrapperId=opt.wrapperId}if(opt.innerId){this.options.innerId=opt.innerId}if(opt.contentClass){this.options.contentClass=opt.contentClass}if(opt.hasNavigator){this.options.hasNavigator=opt.hasNavigator}if(opt.navigatorId){this.options.navigatorId=opt.navigatorId}if(opt.nameUsed){this.options.nameUsed=opt.nameUsed}if(opt.duration){this.options.duration=opt.duration}}this.scroll=new Fx.Scroll(this.options.wrapperId,{wait:false,duration:this.options.duration,transition:Fx.Transitions.linear});this.currentContent=0;var list=$(this.options.innerId).getElementsByTagName("div");this.maxContents=list.length;if(this.options.hasNavigator){var listed=$(this.options.navigatorId).getElementsByTagName("a");for(i=0;i<listed.length;i++){eval('$("'+listed[i].id+"\").addEvent('click', function(event){ event = new Event(event).stop(); "+this.options.nameUsed+".goToIndex("+i+");})")}}},nextContent:function(){nextCont=this.currentContent<this.maxContents-1?this.currentContent+1:0;this.currentContent=nextCont;var A="div."+this.options.contentClass;var B=$(this.options.innerId).getElementsByTagName("div");this.scroll.toElement(B[this.currentContent].id)},prevContent:function(){prevCont=this.currentContent>0?this.currentContent-1:this.maxContents-1;this.currentContent=prevCont;var A=$(this.options.innerId).getElementsByTagName("div");this.scroll.toElement(A[this.currentContent].id)},goToIndex:function(C){var B=$(this.options.navigatorId).getElementsByTagName("li");if(B.length){for(i=0;i<B.length;i++){$(B[i]).removeClass("selected")}$(B[C]).addClass("selected")}this.currentContent=C;var A=$(this.options.innerId).getElementsByTagName("div");this.scroll.toElement(A[this.currentContent].id)}});