var imageChanger = {


	toString : function()
	{
		return "imageChanger class";
	},

	init : function()
	{
		var shopDiv = getID("shopPlace");
		if(!shopDiv)
			return displayErrorMsg("Unable to locate ID: shopPlace");

		var allImages = shopDiv.getElementsByTagName("img");
		if(!allImages)
			return displayErrorMsg("Unable to locate IMGs in ID: shopPlace");

		var item;
		
		for(var x = 0; x < allImages.length; x++)
		{
			item = allImages[x];
			if(item.getAttribute("rel") != "thumb")
				continue;

			item.onclick=function()
			{
				imageChanger.displayBig(this);
			}
		}
	},

	displayBig : function(target)
	{
		//alert(target.getAttribute("alt"));
		var theBig = target.parentNode.previousSibling.parentNode.getElementsByTagName("img")[0];
		//alert(theBig);
		if(!theBig)
			return false;
	
		theBig.src=target.src;
	}




};

window.onload=function()
{
	imageChanger.init();
}
