var PhotoGalleryImage = function(thumbnail, title)
{
	this.Thumbnail = thumbnail;
	this.Title = title;
}

var RHPhotoGalleryImageList = function()
{
	this.Images			= new Array();
	this.CurrentIndex	= 0;
	this.Thumb1			= document.getElementById('RoundHousePhoto1');
	this.Thumb2			= document.getElementById('RoundHousePhoto2');
	this.Thumb3			= document.getElementById('RoundHousePhoto3');
}

RHPhotoGalleryImageList.prototype.AddImage = function(photogalleryImage)
{
	this.Images[this.Images.length] = photogalleryImage;
}

RHPhotoGalleryImageList.prototype.Initialize = function(startIndex)
{
	this.CurrentIndex = startIndex;
	this.ChangeThumbnail(this.Thumb1, this.Images[startIndex]);
	this.ChangeThumbnail(this.Thumb2, this.Images[startIndex + 1]);
	this.ChangeThumbnail(this.Thumb3, this.Images[startIndex + 2]);
}

RHPhotoGalleryImageList.prototype.ChangeThumbnail = function(imageElement, photogalleryImage)
{
	if (photogalleryImage)
	{
		imageElement.src = photogalleryImage.Thumbnail;
		imageElement.title = photogalleryImage.Title;
		imageElement.onclick = function(){OpenPhotoGalleryPopup(imageElement);}
	}
}

RHPhotoGalleryImageList.prototype.GetStartIndex = function()
{
	return this.CurrentIndex;
}

RHPhotoGalleryImageList.prototype.GetEndIndex = function()
{
	return this.GetStartIndex() + 2;
}

RHPhotoGalleryImageList.prototype.HasMoreImages = function()
{
	return this.Images.length >= this.GetEndIndex() + 2;
}

RHPhotoGalleryImageList.prototype.ShiftRight = function()
{	
	if (this.HasMoreImages())
		this.Initialize(this.GetStartIndex() + 1);
}

RHPhotoGalleryImageList.prototype.ShiftLeft = function()
{
	if (this.GetStartIndex() > 0)
		this.Initialize(this.GetStartIndex() - 1);
}

