var CoreFader=Class.create({initialize:function(a,b){this.element=$(a);if(typeof b!="undefined"){this.duration=b}else{this.duration=0.5}},fadeTo:function(a){a=$(a);if(typeof this.effect=="object"&&this.effect.state!="finished"){this.effect.cancel()}this.effect=new Effect.Opacity(this.element,{from:1,to:0,duration:this.duration,queue:"end",limit:1,afterFinish:function(){this.element.update(a.innerHTML);this.effect=new Effect.Opacity(this.element,{from:0,to:1,duration:this.duration,queue:"end",limit:1})}.bind(this)})},fadeBetween:function(b,c){if(typeof c=="undefined"){c=10}var a=(this.duration*2)+c;b.next=function(){if(typeof this.currentIndex=="undefined"){this.currentIndex=0}if(this.currentIndex>=b.length){this.currentIndex=0}this.currentElement=this[this.currentIndex];this.currentIndex++;return this.currentElement}.bind(b);new PeriodicalExecuter(function(d){this.frequency=a;this.fadeTo(b.next())}.bind(this),c)}});
