function AdRotate(imgId)
{
	this.ImageList = new Array();
	this.Index = 0;
	this.PreLoad = new Image();
	this.ImageId = imgId;
	this.Url;
	this.id = 'AdRotate' + imgId;
	window[this.id] = this;
}

AdRotate.prototype.Add = function(src, url, txt)
{
	this.ImageList.push(new Array(src, url, txt));

	if (this.ImageList.length == 1)
		this.PreLoad.src = src;
};

AdRotate.prototype.Start = function()
{
	// Load the new image for viewing
	document.getElementById(this.ImageId + '_img').src = this.PreLoad.src;
	document.getElementById(this.ImageId + '_link').href = this.ImageList[this.Index][1];
	document.getElementById(this.ImageId + '_txt').innerHTML = this.ImageList[this.Index][2];

	// Move the index forward
	if (this.Index < (this.ImageList.length-1))
		this.Index++;
	else
		this.Index = 0;

	// Preload the next image
	this.PreLoad.src = this.ImageList[this.Index][0];

	setTimeout('window.' + this.id + '.Start()', 4000);
};
