<!--
var divH = 555;
var divW = 620;
var imgW = 600;
var imgH = 450;

function restoreVisibility()
{
	screenWidth = document.body.clientWidth;
	screenHeight = document.body.clientHeight;
		
	calcLeft = parseInt((screenWidth-divW)*0.5);
	calcTop = parseInt((screenHeight-divH)*0.5)+document.body.scrollTop;
	
	imgDiv = document.getElementById("imgDiv");
	imgDiv.style.left = calcLeft+"px";
	imgDiv.style.top = calcTop+"px";
	imgDiv.style.visibility = "visible";
	imgDiv.style.width = divW+"px";
	imgDiv.style.height = divH+"px";
}

function hide()
{
	if(imgDiv = document.getElementById("imgDiv"))
	{
		imgDiv.style.visibility = "hidden";
		imgDiv.style.width = "0px";
		imgDiv.style.height = "0px";
	}
}

function showHigh(url,didascalia)
{
	if(!document.getElementById("imgDiv"))
		createElements();
	document.getElementById("imgAuto").src = url;
	document.getElementById("didascaliaDiv").innerHTML = didascalia;
	restoreVisibility();
}


function createElements()
{
	//ottengo informazioni utili
	screenWidth = document.body.clientWidth;
	screenHeight = document.body.clientHeight;
	calcLeft = parseInt((screenWidth-divW)*0.5);
	calcTop = parseInt((screenHeight-divH)*0.5)+document.body.scrollTop;
	
	//div contenente l'immagine
	imgDiv = document.createElement("div");
	imgDiv.id = "imgDiv";
	imgDiv.style.position = "absolute";
	imgDiv.style.background = "#FFF";
	imgDiv.style.left = calcLeft+"px";
	imgDiv.style.top = calcTop+"px";
	imgDiv.style.width = divW+"px";
	imgDiv.style.height = divH+"px";
	imgDiv.align = "center";
	
	//img
	imgAuto = document.createElement("img");
	imgAuto.id = "imgAuto";
	imgAuto.style.position = "relative";
	imgAuto.style.top = "10px";
	/*imgAuto.width = imgW;
	imgAuto.height = imgH;*/

	//br
	brImg1 = document.createElement("br");
	brImg2 = document.createElement("br");

	//div con didascalia
	didascaliaDiv = document.createElement("div");
	didascaliaDiv.id = "didascaliaDiv";
	didascaliaDiv.style.fontSize = "12px";
	didascaliaDiv.style.color = "#000000";
	didascaliaDiv.style.margin = "5px";

	//href con chiusura
	closeText = document.createElement("a");
	closeText.innerHTML = "Chiudi immagine";
	closeText.style.fontWeight = "bold";
	closeText.style.color = "#000000";
	closeText.style.cursor = "pointer";
	closeText.style.marginBottom = "5px";
	closeText.onclick = hide;
	
	imgDiv.appendChild(imgAuto);
	imgDiv.appendChild(brImg1);
	imgDiv.appendChild(brImg2);
	imgDiv.appendChild(didascaliaDiv);
	imgDiv.appendChild(closeText);
	
	document.body.appendChild(imgDiv);
}
//-->
