/**********************************************
*	Scott Ladyman 2008
*	scott@ballyhoos.com.au
*
***********************************************/
/* needs dom.js library */
var pizzuto = {
	
	initGallery : function(e)
	{
		var thumbs = dom.byClass("aimg", dom.byId("gallery"));
		for(i = 0; i < thumbs.length; i++){
			thumbs[i].onclick = function(e){
				
				var el = dom.getEventElement(e);
				if( el.tagName == "IMG"){
					el = el.parentNode;
				}
				
				//	reset border of current thumb
				dom.byClass("on", dom.byId("gallery"))[0].className = "thumb";
				//	add border to new img
				el.className = "thumb on";
				
				var id = dom.hasAttr(el, "rel", true);
				//	load image from preloaded object id
				//	display new image
				var img = eval("img"+ id);
				dom.byId("dis_img").src = img.src;
				dom.byId("dis_img").alt = img.alt;
				dom.byId("dis_img").title = img.title;
				
				//	get item details
				var item = ajax.decodeJson(eval("item"+ id));
				
				//	change HTML values
				dom.byId("item_code").innerHTML = item.code; 
				dom.byId("item_name").innerHTML = item.name; 
				dom.byId("item_size").innerHTML = item.size; 
				dom.byId("item_price").innerHTML = item.price; 
				dom.byId("item_desc").innerHTML  = item.desc; 
								
				dom.stopProp(e);
				dom.cancel(e);
			}
		}
	},
	
	initThumbs : function()
	{
		
		
	}
	
		
};

	 