Effect.Wait=Class.create();
	Object.extend(Object.extend(Effect.Wait.prototype,Effect.Base.prototype),{
	initialize:function(P){
	this.element=$(P);
	if(!this.element){
	throw (Effect._elementDoesNotExistError);
	}
	
	var M=Object.extend({
	}
	
	,arguments[1]||{
	}
	
	);
	this.start(M);
	}
	
	}
	
	);
	if(typeof (AC)=="undefined"){
	AC={
	}
	
	;
	}
	
	AC.CrossfadeQueue=Class.create();
	AC.CrossfadeQueue.prototype={
	nextIndex:0,queue:null,container:null,scope:null,safetyDiv:null,delay:6,fadeInTime:0.5,fadeOutTime:0.5,defaultQueueName:"defaultXFadeQueue",currentNode:null,stopped:false,pauseTimeStamp:null,initialize:function(P,M,d,V,L,o){
	this.container=$(M);
	this.scope=M.toString();
	this.queue=$A(P);
	if(d!=null){
	this.delay=d;
	}
	
	if(V!=null){
	this.defaultQueueName=V;
	}
	
	if(L!=null){
	this.fadeInTime=L;
	}
	
	if(o!=null){
	this.fadeOutTime=o;
	}
	
	if(typeof (this.queue[0])=="string"){
	this.container.innerHTML="";
	}
	
	else{
	for(var g=0;
	g<this.queue.length;
	g++){
	$(this.queue[g]).remove();
	}
	
	}
	
	this.next();
	}
	
	,pause:function(){
	this.pauseTimeStamp=new Date().getTime();
	var M=Effect.Queues.get(this.defaultQueueName);
	if(M.interval){
	clearInterval(M.interval);
	}
	
	this.currentNode.setStyle({
	opacity:1}
	
	);
	setTimeout(this.resume.bind(this),2000);
	}
	
	,stop:function(){
	this.stopped=true;
	this.pause();
	}
	
	,play:function(){
	this.stopped=false;
	this.resume();
	}
	
	,resume:function(){
	if(this.stopped||!this.pauseTimeStamp){
	return ;
	}
	
	var P=new Date().getTime()-this.pauseTimeStamp;
	this.pauseTimeStamp=null;
	var M=Effect.Queues.get(this.defaultQueueName);
	M.each(function(d){
	d.startOn+=P;
	d.finishOn+=P;
	}
	
	);
	M.interval=setInterval(M.loop.bind(M),40);
	}
	
	,next:function(){
	if(this.nextIndex>this.queue.length-1){
	this.nextIndex=0;
	}
	
	if(this.currentNode){
	this.currentNode.setStyle({
	zIndex:"2"}
	
	);
	var M=this.createNode();
	var P=function(){
	this.currentNode.remove();
	this.currentNode=M;
	this.nextIndex++;
	new Effect.Wait(this.currentNode,{
	duration:this.delay,queue:{
	position:"end",scope:this.defaultQueueName}
	
	,afterFinish:this.next.bind(this)}
	
	);
	}
	
	;
	new Effect.Opacity(this.currentNode,{
	duration:this.fadeOutTime,transition:Effect.Transitions.linear,from:1,to:0,afterFinish:P.bind(this)}
	
	);
	}
	
	else{
	this.currentNode=this.createNode();
	this.nextIndex++;
	new Effect.Wait(this.currentNode,{
	duration:this.delay,queue:{
	position:"end",scope:this.defaultQueueName}
	
	,afterFinish:this.next.bind(this)}
	
	);
	}
	
	}
	
	,createNode:function(){
	var M=this.queue[this.nextIndex];
	if(typeof (M)=="string"){
	M=document.createElement("div");
	M.innerHTML=this.queue[this.nextIndex];
	this.queue[this.nextIndex]=M;
	}
	
	M=$(M);
	M.setStyle({
	position:"absolute",opacity:1,zIndex:1}
	
	);
	M.addClassName("ACCrossfadeQueueElement");
	M.onmouseover=this.pause.bind(this);
	M.onmouseout=this.resume.bind(this);
	this.container.appendChild(M);
	return M;
	}
	
	}
	
	;
	function InitCrossFade(){
	if(arguments.length>0){
	var M=$A(InitCrossFade.arguments);
	var d=M.shift();
	var P=(typeof (M[M.length-1])=="number")?M.pop():Math.floor(Math.random()*5)+3;
	new AC.CrossfadeQueue(M,d,P);
	}
	
	}
	
	
