var Gallery = Class.create();

Gallery.prototype = 
{
	images: new Array(),
	position: 0,
	
	initialize: function()
	{
	},
	
	addImage: function(image)
	{
		this.images.push(image);
	},
	
	nextImage: function()
	{
		this.position++;
		if(this.position > this.images.length - 1)
		{
			this.position = 0;
		}
		
		this.displayImage(this.position);
	},
	
	previousImage: function()
	{
		this.position--;
		if(this.position < 0)
		{
			this.position = this.images.length - 1;
		}
		this.displayImage(this.position);
	},
	
	displayImage: function(index)
	{
		$("gallery_link").hide();
		$("gallery_link").innerHTML = "";
		$("gallery_link").href = this.images[index].imageFile;
		$("gallery_link").appendChild(this.images[index].element);
		Effect.Appear("gallery_link");				
	}	
	
}