var ImgGallery = 
{
	init : function()
	{
		this.currentActiveIndex = 0;
		this.currentActiveThumb = document.getElementById('GalleryWrapper').getElementsByTagName('a')[0];
		this.fullImgWrapper = document.getElementById('GalleryFullImg');
		this.galleryTextWrapper = document.getElementById('GalleryText');

		this.fullImg = this.fullImgWrapper.getElementsByTagName('img')[0];
		this.fullImg.removeAttribute('height');
	},
	
	switchImg : function(index,obj)
	{
		if (this.currentActiveThumb)
		{
			this.currentActiveThumb.className = '';
		}
		
		if (!obj)
		{
			index = this.currentActiveIndex + 1;
			if (index > ImgGallery.images.length - 1)
			{
				index = 0;
			}
			this.currentActiveIndex = index;
			obj = document.getElementById('GT' + this.currentActiveIndex)
		}
		else
		{
			this.currentActiveIndex = index;
		}
		
		obj.className = 'active';
		this.currentActiveThumb = obj;
	
		this.fullImg.src = this.images[index];
		this.fullImg.alt = this.title[index];
		this.fullImg.title = this.title[index];
		
		this.galleryTextWrapper.innerHTML = this.title[index];
		
		return false;
	}
};
