// JavaScript Document
var alertTimerId;

$(window).load(function(){ 
	$.unblockUI();
});

$(document).ready(function(){ 
	
	$(document).pngFix();

	$(".testo").mouseover(function(){
		//$(this).parent().prev(".rollover").fadeIn(500);	
		
		$(this).prev(".rollover").stop(true,true).show();
		$(this).prev(".rollover").show();
		$(this).prev(".rollover").css("backgroundColor","#ffffff");
	});	


	$(".testo").mouseout(function(){
		//$(this).prev(".rollover").css("backgroundColor","#f2f2f2");
		$(this).prev(".rollover").fadeOut(500);	
	});	
	
						   
	$(".model_item").mouseover(function(){

		$(this).parent().prev(".rollover").stop(true,true).show();
		title = $(this).attr("name");
		if (alertTimerId) { clearTimeout ( alertTimerId ); }
		alertTimerId = setTimeout ("showmodel('"+title+"')", 500);
	}).mouseout(function(){
		clearTimeout ( alertTimerId );
	});
});

function showmodel(title) {
	$(".model_img").fadeOut(750,function() { $(".model_img").attr("src","images/home/"+title+".jpg"); $(".model_img").fadeIn(750);})
}


function chiamaBlockUI() {
	var str;
	str = '<div style="position:relative;"><img src="images/loader.gif"><div>';
	
	$.blockUI({ 
		css: { 
			border: 'none', 
			padding: '15px', 
			backgroundColor: 'transparent', 
			margin:'auto',
			top: '290px',
			width: '28%'			
		},

		message: str,
		overlayCSS: {
			cursor: 'default',
			backgroundColor:'#000', 
			opacity:'0.8' 
			/*sfondo*/
		}
	});
};