RotatorFade=function(strId,numEl,delay,colorStart,colorEnd,colorStartSpan,colorEndSpan){this.id=strId;this.numEl=numEl;this.delay=delay;this.n=1;this.rotatorCounter=null;this.colorStart=colorStart;this.colorEnd=colorEnd;this.colorStartSpan=colorStartSpan;this.colorEndSpan=colorEndSpan;this.startRotate();}
RotatorFade.prototype={changeRot:function(){var nOld=this.n;this.n=this.n+1;if(this.n>this.numEl){this.n=1};try{document.getElementById(this.id+"_"+nOld).style.display="none";}catch(e){};try{var objFade=new Fade(this.id+"Fade",this.colorStart,this.colorEnd,this.colorStartSpan,this.colorEndSpan);objFade.colorfade(1);document.getElementById(this.id+"_"+this.n).style.display="block";}catch(e){};this.startRotate();},startRotate:function(){var objRotatorTimeout=this;var returns=function(){return objRotatorTimeout.changeRot();};this.rotatorCounter=setTimeout(returns,this.delay);}}

Fade=function(idDiv1,colorStart,colorEnd,colorStartSpan,colorEndSpan)
{this.idDiv1=document.getElementById(idDiv1);this.maxsteps=30;this.stepdelay=40;if(colorStart!=null){this.startcolor=colorStart;}else{this.startcolor=new Array(0,0,0)}
if(colorEnd!=null){this.endcolor=colorEnd;}else{this.endcolor=new Array(255,255,255)}
if(colorStartSpan!=null){this.startcolorSpan=colorStartSpan;}else{this.startcolorSpan=new Array(0,0,0)}
if(colorEndSpan!=null){this.endcolorSpan=colorEndSpan;}else{this.endcolorSpan=new Array(255,255,255)}

this.fadelinks=1;this.fadecounter;}
Fade.prototype={linkcolorchange:function(step)
{if(this.idDiv1!=null)
{var obj=this.idDiv1.getElementsByTagName("A");if(obj.length>0)
{for(i=0;i<obj.length;i++)
{obj[i].style.color=this.getstepcolor(step);}}
var objSpan=this.idDiv1.getElementsByTagName("SPAN");if(objSpan.length>0)
{for(iS=0;iS<objSpan.length;iS++)
{
	if (objSpan[iS].className!="data"){objSpan[iS].style.color=this.getstepcolorSpan(step);}
		}}
	}},colorfade:function(step)
{if(step<=this.maxsteps)
{if(this.idDiv1!=null)
{this.idDiv1.style.color=this.getstepcolor(step);if(this.fadelinks)
{this.linkcolorchange(step);}}
step++;var objFadeTimeout=this;var returns=function(){return objFadeTimeout.colorfade(step);};this.fadecounter=setTimeout(returns,this.stepdelay);}
else
{clearTimeout(this.fadecounter);if(this.idDiv1!=null)
{this.idDiv1.style.color="rgb("+this.endcolor[0]+", "+this.endcolor[1]+", "+this.endcolor[2]+")";}}},getstepcolor:function(step)
{var diff;var newcolor=new Array(3);for(var i=0;i<3;i++)
{diff=(this.startcolor[i]-this.endcolor[i]);if(diff>0)
{newcolor[i]=this.startcolor[i]-(Math.round((diff/this.maxsteps))*step);}
else
{newcolor[i]=this.startcolor[i]+(Math.round((Math.abs(diff)/this.maxsteps))*step);}}
return("rgb("+newcolor[0]+", "+newcolor[1]+", "+newcolor[2]+")");},getstepcolorSpan:function(step)
{var diff;var newcolor=new Array(3);for(var i=0;i<3;i++)
{diff=(this.startcolorSpan[i]-this.endcolorSpan[i]);if(diff>0)
{newcolor[i]=this.startcolorSpan[i]-(Math.round((diff/this.maxsteps))*step);}
else
{newcolor[i]=this.startcolorSpan[i]+(Math.round((Math.abs(diff)/this.maxsteps))*step);}}
return("rgb("+newcolor[0]+", "+newcolor[1]+", "+newcolor[2]+")");}







}
