// Script di apertura per ogni finestra popup (centrata automaticamente)
function Popup(url, larghFin, lunghFin) {
var posX = Math.round((screen.width -larghFin)/2);
var posY = Math.round((screen.height-lunghFin)/2);
window.open(url, "", "scrollbars=no, status=no, menubar=no, toolbar=no, resizable=no,width=" + larghFin + ",height=" + lunghFin + ",left=" + posX +",top=" + posY);
}

function PopUpCentroBrowser(pagina,nome,w,h){ 
	if(document.all){
		var ax = window.screenLeft;
		var ay = window.screenTop;
		var aw = window.document.body.offsetWidth;
		var ah = window.document.body.offsetHeight;
	}
	else{
		var ax = window.screenX;
		var ay = window.screenY;
		var aw = window.outerWidth;
		var ah = window.outerHeight;
	}
	x=ax+Math.round((aw-w)/2);
	y=ay+Math.round((ah-h)/2);
	var tl='top='+y+',left='+x+',';
	window. open(pagina,nome,tl+'toolbar=no,status=no,scrollbars=no,width='+w+',height='+h);

}

function Popup_Scroll(url1, larghFin1, lunghFin1) {
var posX1 = Math.round((screen.width -larghFin1)/2);
var posY1 = Math.round((screen.height-lunghFin1)/2);
window.open(url1, "", "scrollbars=yes, status=no, menubar=no, toolbar=no, resizable=yes,width=" + larghFin1 + ",height=" + lunghFin1 + ",left=" + posX1 +",top=" + posY1);
}

function PopUpCentroBrowser_Scroll(pagina,nome,w,h){ 
	if(document.all){
		var ax = window.screenLeft;
		var ay = window.screenTop;
		var aw = window.document.body.offsetWidth;
		var ah = window.document.body.offsetHeight;
	}
	else{
		var ax = window.screenX;
		var ay = window.screenY;
		var aw = window.outerWidth;
		var ah = window.outerHeight;
	}
	x=ax+Math.round((aw-w)/2);
	y=ay+Math.round((ah-h)/2);
	var tl='top='+y+',left='+x+',';
	window. open(pagina,nome,tl+'toolbar=no,status=no,scrollbars=yes,width='+w+',height='+h);

}

<!--
// ---- Sezione personalizzabile (v. scheda nel sito: http://www.jsdir.com/staffscripts/script063.asp)
var AltezzaLinee=24;
var Velocita = 20;
var Intervallo = 4000
var Step=2;
// ---- Fine sezione personalizzabile

var nn = document.layers?true:false;
var N6 = navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false;
var LayText=null;
var AltezzaLivello=0;
var LarghezzaLivello=0;
var Limite =0;
var texTop=0;
var DeltaTop = 0;
var timsc=null;

function news_reader()
	{
	LayText=nn?document.layers.news:N6?document.getElementById("news").style:document.all.news.style;
	DeltaTop=nn?LayText.top:N6?document.getElementById("news").offsetTop:document.all.news.offsetTop;
	AltezzaLivello=parseInt(nn?LayText.clip.height:N6?LayText.height:LayText.height);
	LarghezzaLivello=parseInt(nn?LayText.clip.width:N6?LayText.width:LayText.width);
	Limite=-AltezzaLivello+(nn?LayText.document.height:N6?document.getElementById("divN6").offsetHeight:document.all.news.clientHeight);
	setTimeout("Move()",Intervallo);
	}

function Move(where)
	{
	pos=texTop+3
	LayText.top=-pos+DeltaTop;
	if (nn)
		{
		LayText.clip.top=pos;
		LayText.clip.bottom=eval(pos+AltezzaLivello);
		}
		else
		LayText.clip = "rect(" + pos + ", " + LarghezzaLivello + ", " +eval(pos+AltezzaLivello) + ", 0)";
	texTop>=Limite?texTop=0:texTop+=Step;

	if (texTop % AltezzaLinee != 0 )
		setTimeout("Move()",Velocita);
	else
		setTimeout("Move()",Intervallo);

	if (texTop==Limite)
			texTop=0;

	}

function posizionaLayer(titolo, l, h, bgcol){
	var wdt = screen.width; 
	var hgt = screen.height; 
	var lar = l;
	var alt = h;
	var x = Math.round((wdt / 2) - (lar / 2)); 
	var y = Math.round((hgt / 2) - (alt / 2))-100; 
	
	//alert(titolo);

	if(titolo != '#'){
		document.getElementById('root').style.display = 'block';
		document.getElementById('hdTitolo').innerHTML = titolo;
		document.getElementById('root').style.top = y;
		document.getElementById('root').style.left = x;
		document.getElementById('handle').style.width = l;
		document.getElementById('tabHD').style.width = l;
		document.getElementById('root').style.width = l;
		document.getElementById('root').style.height = h;
		document.getElementById('root').style.background = bgcol;
	}else{
		document.getElementById('root').style.display = 'none';
	}
}

function chiudiLayer(){
	document.getElementById('root').style.display = 'none';
}
