function Images()
{
	this.images = new Array();
	this.position = 0;
	this.add = addImage;
	this.write = writeCurrentImage;
}

	function addImage(Image)
	{
		this.images[this.images.length] = Image;
	}
	
	function writeCurrentImage(Direction)
	{	
		switch (this.images.length)
		{	
			case 0:
			{	
				document.getElementById('lnkPrevImage').style.display = 'none';
				document.getElementById('lnkNextImage').style.display = 'none';
				break;
			}
			case 1:
			{
				this.images[this.position].write();
				document.getElementById('lnkPrevImage').style.display = 'none';
				document.getElementById('lnkNextImage').style.display = 'none';
				break;
			}
			default:
			{		
				this.position += Direction;
				
				if (this.position > (this.images.length -1))
				{
					this.position = 0
				}
				else
				{
					if (this.position < 0 )
					{
						this.position = this.images.length -1
					}
				}
				this.images[this.position].write();
				break;
			}
		}
	}
	
function Image(caption, image)
{
	this.caption = caption;
	this.image = image;
	this.write = writeImage;
}
	function writeImage()
	{		
		document.getElementById('LabelCaption').innerHTML = this.caption;
		document.Form.imgEventImage.src = this.image;
	}