var eff;
var eff1;
var thumbAttiva="thumb3";
var commentoAttivo="3";


window.onload=function(){
	
	zoom();
	loadPicture();

	$(thumbAttiva).fade(0.5);
	$("img"+commentoAttivo).style.display="block";

}
	

function zoom() {
	
	$$('img.imgBig').each(function(img) {
	
		img.onmouseover=function() {
			
			document.getElementById("zoomImg"+this.id.substring(4)).style.display="block";
		
		}
		
		img.onmouseout=function() {
		
			document.getElementById("zoomImg"+this.id.substring(4)).style.display="none";
	
		}
	});

}

function loadPicture(){


	$$('img.thumbs').each(function(img) {
								   
	img.style.cursor="pointer";

	img.onclick=function() {

		
		if ($(thumbAttiva)){

			$(thumbAttiva).fade(1.0);
	
		
		} 

		if ($(this.id)) { 
	
			$(this.id).fade(0.5);
			
			$("imgGrande").src='../imm/museum/xl/art_diamonds_museum'+this.id.substring(5)+'.jpg';
			thumbAttiva=this.id;
		
			if (commentoAttivo != thumbAttiva.substring(5)){
				$("img"+commentoAttivo).style.display="none";
			} 

			$("img"+thumbAttiva.substring(5)).style.display="block";
			commentoAttivo = thumbAttiva.substring(5);
	

		}
	}
	});
	
}
