function chiamaBlockUI(src, video, condividi, testo) {
	var text = '';
	if (!section) { section = "home"; }
	
	text += "<img src='images/popup_close.png' id='chiudi_blockui'><div style='width:599px; margin:auto; background:#FFF;'>";
	if (video == true) {
		text += '<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/'+src+'&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+src+'&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
		text += "</div><a href='http://www.facebook.com/sharer.php?u=http://www.youtube.com/watch?v="+src+"' target='_blank'><img src='images/popup_sharefacebook.png'></a>";
	}
	if ((video != true) && (testo != true)) {
		text += "<img src='"+src+"' height='398' width='599'>";
		text += "</div>";
		if (condividi != false) {
			text += "<a href='http://www.facebook.com/sharer.php?u=http://www.sulmarefilm.it/"+section+".php?foto="+src+"' target='_blank'><img src='images/popup_sharefacebook.png'></a>";
		} else {
			text += "<img src='images/popup_sharefacebook_noshare.png'>";
		}
	}
	
	if (testo == true) {
			text += src;
			text += "</div><img src='images/popup_sharefacebook_noshare.png'>";
	}
	text += "<img src='images/popup_bottom.png'>";
	
	$.blockUI({ 
		message: text, 
		css: { 
			cursor: 'default',
			top:  "50%", 
			left: "50%",
			marginTop: "-239px",
			marginLeft: "-303px",
			width: '607px',
			height: '478px',
			border: 'none',
			background: 'transparent'
		},
		overlayCSS: { 
			cursor: 'default'
		}
	}); 
	
	$("#chiudi_blockui").click(function() {
		$.unblockUI();
	});
	$(".chiudi_blockui").click(function() {
		$.unblockUI();
	});
}

function chiamaBlockUIsimple(testo, inserisci, chiudi) {
	var str;
	str = '<div style="position:relative;"><div></div><br />';
	str += '<div><p class="titolo"><b>Attenzione</b></p>';
	str += '<p>'+testo+'</p></div>';
	if (chiudi != false) {
		if (inserisci) {
			str = str + '<div><span id="avanti" style="cursor:pointer;">SI</span>&nbsp;&nbsp;&nbsp;<span id="chiudi_blockui" style="cursor:pointer;">NO</span><br /><br /></div></div>';
		} else {
			str = str + '<div><span id="chiudi_blockui" style="cursor:pointer;" onclick="$.unblockUI();">chiudi</span><br /><br /></div></div>';
		}
	}
	
	$.blockUI({ 
		css: { 
			border: 'none', 
			padding: '15px', 
			backgroundColor: '#000', 
			color: '#C7C7C7',
			cursor: 'default',
			margin:'auto',
			top: '200px',
			width: '28%',
			fontFamily: 'Arial, Helvetica, sans-serif'
		},

		message: str,
		overlayCSS: {
			cursor: 'default',
			backgroundColor:'#000', 
			opacity:'0.8' 
		}
	});
	
	$("#chiudi_blockui").click(function() {
		$.unblockUI();
	});
	$("#avanti").click(function() {
		$.unblockUI();
		inserisciStoria();
	});
}
