dw_Rotator.restartDelay = 500; 
dw_Rotator.col=[];
function dw_Rotator(name,speed,path,tgt)
{
	this.name=name;
	this.speed=speed||4500;
	this.path=path||"";
	this.tgt=tgt;
	this.ctr=0;
	this.timer=0;
	this.imgs=[];
	this.actions=[];
	this.index=dw_Rotator.col.length;
	dw_Rotator.col[this.index]=this;
	this.animString="dw_Rotator.col["+this.index+"]";
};
dw_Rotator.prototype.addImages=function()
{
	var img;
	for(var i=0;arguments[i];i++)
	{
		img=new Image();
		img.src=arguments[i];
		this.imgs[this.imgs.length]=img;
	}
};
dw_Rotator.prototype.addActions=function()
{
	var len=arguments.length;
	for(var i=0;i<len;i++)
		this.actions[this.actions.length]=arguments[i];
};
dw_Rotator.prototype.rotate=function()
{
	this.ctr++;
	
	if(this.ctr>= this.imgs.length)
		this.ctr=0;
	
	var imgObj=document.getElementById(this.name);
	if(imgObj) imgObj.src=this.imgs[this.ctr].src;
};
dw_Rotator.start=function()
{
	var len=dw_Rotator.col.length,obj;
	for(var i=0;i<len;i++)
	{
		obj=dw_Rotator.col[i];
		if(obj&&obj.name)
			obj.timer=setInterval(obj.animString+".rotate()",obj.speed);
	}
};
dw_Rotator.doClick=function(n)
{
	var obj=dw_Rotator.col[n];
	if(!document.images||!obj)
		return true;
	if(obj.actions&&obj.actions[obj.ctr])
	{
		if(typeof obj.actions[obj.ctr]=="string")
		{
			if(obj.tgt)
			{
				var win=window.open(obj.actions[obj.ctr],obj.tgt);
				if(win&&!win.closed)
					win.focus();
			}
			else
			{
				window.location=obj.actions[obj.ctr];
			}
		}
		else
		{
			obj.actions[obj.ctr]();
		}
	}
	return false;
};
dw_Rotator.pause=function(n)
{
	dw_Rotator.clearTimers(n);
};
dw_Rotator.clearTimers=function(n)
{
	var obj=dw_Rotator.col[n];
	if(obj)
	{
		clearInterval(obj.timer);
	}
};
dw_Rotator.resume=function(n)
{
	dw_Rotator.clearTimers(n);
	var obj=dw_Rotator.col[n];
	if(obj)
	{
		obj.timer = setInterval(obj.animString+".rotate()",obj.speed);
	}
};
dw_Rotator.ready=true;



