function slideShow ( viewerImageName, secsPerImage )
{
	this.viewerImageName	= viewerImageName;
	this.msPerImage			= secsPerImage * 1000;
	
	this.viewerImage		= cbeGetElementById ( viewerImageName );
	
	this.images				= new Array();
	this.currentImage		= -1;
	
	this.timer				= setTimeout("", 0);
}

slideShow.prototype.addImage = function ( imageUrl )
{	
	var whichImage = this.images.length;
	
	this.images [ whichImage ] = new Image ( );
	this.images [ whichImage ].src = imageUrl;
}

slideShow.prototype.nextImage = function ( )
{	
	clearTimeout (this.timer);

	this.currentImage++;
	
	if (this.currentImage == this.images.length)
	{
		this.currentImage = 0;
	}
	
	this.viewerImage.src = this.images [ this.currentImage ].src;
	
	this.timer = setTimeout("slideShow.nextImage()",this.msPerImage);
}
