var mooSlideShow=new Class({Implements:[Events,Options],options:{effect:"fade",duration:2000,transition:Fx.Transitions.linear,direction:"right",wait:5000,loop:false},initialize:function(b,a,c){this.setOptions(c);this.container=$(b);this.container.setStyles({position:"relative",overflow:"hidden"});if($type(a)=="string"){var d=[];$$("."+a).each(function(e){e.setStyles({position:"absolute",display:"block",zIndex:0,top:0,left:0,opacity:0});d.push(e)},this);this.images=d}else{this.images=a}this.timer=0;this.image=-1;this.oldImage=-1;this.stopped=true;this.started=false;this.animating=false;this.play()},load:function(){$clear(this.timer);this.oldImage=this.image;if(this.image<this.images.length-1){this.image++}else{if(this.options.loop){this.image=0}}this.show()},show:function(){this.images[this.image].setStyle("zIndex",1);this.effect()},wait:function(){this.timer=this.load.delay(this.options.wait,this)},play:function(){if(this.stopped){if(this.image<this.images.length){this.stopped=false;if(this.started){this.next()}else{this.load()}this.started=true}}},stop:function(){$clear(this.timer);this.stopped=true},next:function(a){var b=true;if(a&&this.stopped){b=false}if(this.animating){b=false}if(b){if(this.oldImage>=0){this.images[this.oldImage].setStyle("zIndex",0)}$clear(this.timer);if(this.image==this.images.length-1&&!this.options.loop){this.stopped=true}else{if(a){this.wait()}else{this.load()}}}},effect:function(){this.animating=true;this.effectNewObj=new Fx.Morph(this.images[this.image],{duration:this.options.duration,transition:this.options.transition});if(this.oldImage>=0){this.effectOldObj=new Fx.Morph(this.images[this.oldImage],{duration:this.options.duration,transition:Fx.Transitions.Quad.easeIn})}this.fade()},fade:function(){this.effectNewObj.start({opacity:[0,1]});if(this.oldImage>=0){this.effectOldObj.start({opacity:[1,0]})}this.resetAnimation.delay(this.options.duration+90,this);if(!this.stopped){this.next.delay(this.options.duration+100,this,true)}},resetAnimation:function(){this.animating=false}});