// JavaScript Document
function getPageSizeWithScroll(){
	if( window.innerHeight && window.scrollMaxY ) // Firefox 
		{
			pageWidth = window.innerWidth + window.scrollMaxX;
			pageHeight = window.innerHeight + window.scrollMaxY;
		}
	else if( document.body.scrollHeight > document.body.offsetHeight ) // all but Explorer Mac
		{
			pageWidth = document.body.scrollWidth;
			pageHeight = document.body.scrollHeight;
		}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		{ 
			pageWidth = document.body.offsetWidth + document.body.offsetLeft; 
			pageHeight = document.body.offsetHeight + document.body.offsetTop; 
		}
	arrayPageSizeWithScroll = new Array(pageWidth,pageHeight);
	//alert( 'The height is ' + pageWidth + ' and the width is ' + pageHeight );
	return arrayPageSizeWithScroll;
}


function openPopUpNews(data,ora,immagine,testo)
{
	var altezza = getPageSizeWithScroll();

	var trgScheda = document.getElementById("popUpNews");
	var trgLayer =document.getElementById("backPopUpNews");

	trgScheda.style.visibility = "visible";
	trgLayer.style.visibility = "visible";
	trgLayer.style.height = altezza[1]+"px";
	document.getElementById('scheda-ph-data').innerHTML = data;
	document.getElementById('scheda-ph-ora').innerHTML = ora;
	document.getElementById('scheda-ph-foto').src = immagine;
//	document.getElementById('scheda-ph-foto').src = 'uploads/foto/loading.jpg';
	document.getElementById('scheda-ph-testo').innerHTML = testo;
}

function closePopUpNews()
{
	var trgScheda = document.getElementById("popUpNews");
	var trgLayer = document.getElementById("backPopUpNews");
	trgScheda.style.visibility = "hidden";
	trgLayer.style.visibility = "hidden";
	document.getElementById('scheda-ph-foto').src = "uploads/foto/loading.gif";
}