function Slider(idOfImageToSlide)
{
	this.slidingImageList = new Array();
	this.imageDisplayTimesList = new Array();
	this.id = idOfImageToSlide;
	this.currentImageIndex = 0;
	
	this.isSliding = false;

	this.startTime = (new Date()).getTime();
	this.refreshTimeMilliseconds = 50;
}

Slider.prototype.addImage = function(imagePath, displayTimeSeconds)
{
	this.slidingImageList.push(imagePath);
	this.imageDisplayTimesList.push(displayTimeSeconds);
};

Slider.prototype.slideImage = function()
{
	if(this.slidingImageList.length == 0) {
		return;
	}
	document.getElementById(this.id).src = this.slidingImageList[this.currentImageIndex];
	this.elapsedTimeMilliseconds = (new Date()).getTime() - this.startTime;
	
	if(this.elapsedTimeMilliseconds >= this.imageDisplayTimesList[this.currentImageIndex] * 1000) 
	{
		this.startTime = (new Date()).getTime();
		this.currentImageIndex = (this.currentImageIndex + 1) % this.slidingImageList.length;
	}
};
