//GALLERY CLIENTI

$(document).ready(function(){
//$(".contenitori").fadeTo(0,0);
//$("#cont_1").fadeTo(0,1);
$(".contenitori").css({'z-index' : '0'});
//Larger thumbnail preview
$("ul.thumb li").css({'z-index' : '0'});
$("ul.thumb li").hover(function() {
		$(this).css({'z-index' : '10'});
		
		$(this).find('span').addClass("hover").stop()
		.animate({
			marginTop: '-85px',
			marginLeft: '-90px',
			top: '50%',
			left: '50%',
			width: '157px',
			height: '120px',
			padding: '2px'
		}
		, 0);

		$(this).find('img').addClass("hover").stop()
		.animate({
			width: '157px',
			height: '120px'
		}, 0);
		
		$(this).find('img').fadeTo(0, 0);
		
	} , function() {
		$(this).css({'z-index' : '0'});
		$(this).find('img').removeClass("hover").stop()
		.animate({
			marginTop: '0px',
			marginLeft: '0px',
			top: '0px',
			left: '0px',
			width: '125px',
			height: '94px',
			padding: '2px'
		}, 0);
		
		$(this).find('span').removeClass("hover").stop()
		.animate({
			marginTop: '0',
			marginLeft: '0',
			top: '0px',
			left: '0px',
			width: '125px',
			height: '94px',
			padding: '2px'
		}, 0);
		
		$(this).find('img').fadeTo(0, 1);
});
//Swap Image on Click
$("ul.thumb li a").click(function() {
var mainImage = $(this).attr("href"); //Find Image Name
$("#main_view img").attr({ src: mainImage });
return false;
});
}); 
