// JavaScript Document
function BlockUI(titolo,testo, other) {
	var str = "";
	str += "<img src='img/blockui_top.png'><div style='background:#00224a; width:350px; overflow:hidden;'><div style='text-align:right; padding-right:10px;'><img src='img/blockui_chiudi.jpg' alt='chiudi' title='chiudi' id='chiudiBlickUI'></div><div style='padding:6px 0 6px 0;'>"+titolo+"</div>";
	str += "<div style='padding:0px 7px 0px 7px;'>"+testo+"</div><br><br></div><img src='img/blockui_bottom.png'>";
	$.blockUI({ 
		message: str, 
		fadeIn: 500, 
		fadeOut: 500,
		centerY: true, 
		
		showOverlay: true, 
		overlayCSS: { 
			cursor: 'default'
		},
		
		css: { 
			width: '350px', 
			border: 'none', 
			backgroundColor: 'transparent', 
			color: '#fff' ,
			cursor: 'auto',
			fontSize: '13px'
		} 
	}); 
	$(".blockMsg img[src$=.png]").ifixpng();

	if (other == "home") {
		$("#chiudiBlickUI").css("cursor","pointer").click(function() { document.location.href = "it/"; });	
	} else {
		$("#chiudiBlickUI").css("cursor","pointer").click(function() { $.unblockUI(); });
	}
}

function LoadingBlockUI() {
	var str = "";
	str += "<div>Caricamento in corso</div>";
	$.blockUI({ 
		message: str, 
		fadeIn: 500, 
		fadeOut: 500,
		centerY: true, 
		showOverlay: true, 
		overlayCSS: { 
			cursor: 'default'
		},
		css: { 
			width: '350px', 
			border: 'none', 
			padding: '5px', 
			backgroundColor: '#000', 
			opacity: .6, 
			color: '#fff',
			cursor: 'auto'
		} 
	}); 
}

function BlockUIWhiteBG(content, width, height) {
	var str = "";
	str += content;
	marginLeft = - Math.round((width / 2)) + "px";
	marginTop = - Math.round((height / 2)) + "px";
	$.blockUI({ 
		message: str, 
		fadeIn: 500, 
		fadeOut: 500,
		centerY: true, 
		showOverlay: true, 
		overlayCSS: { 
			cursor: 'default',
			background: '#757575'
		},
		css: { 
			border: 'none', 
			padding: '5px', 
			backgroundColor: 'transparent',
			left: '50%',
			top: '50%',
			marginTop: marginTop,
			marginLeft: marginLeft,
			color: '#fff',
			cursor: 'auto'
		} 
	}); 
	$(".blockMsg img[src$=.png]").ifixpng();
	$("#messaggioBG").ifixpng();
	$('form').jqTransform({imgPath:'js/jqtransformplugin/img/'});
	$("#chiudiBlickUI").css("cursor","pointer").click(function() { $.unblockUI(); });
}
