<!--
// SPE_menu version 3.0
// 18/11/2003
// Developed by:  Esperia - www.esperia.com
// For info about this script contact massimo.altafini@esperia.com


//---Inizio codice popup fastbreaking
var windowW=300
var windowH=370  
var Yoffset=100   
var moveSpeed=20 
var Xmode="right";
var Xoffset=50;
var autoclose = false
var windowX = (screen.width/2)-(windowW/2);
if (Xmode=="left") windowX=0+Xoffset;
if (Xmode=="right") windowX=screen.availWidth-Xoffset-windowW;
var windowY = (screen.availHeight);
var windowYstop = windowY-windowH-Yoffset;
var windowYnow = windowY;
var windowStep = 50;
var windowYnow = ((windowStep+1)*windowStep/2)+ windowYstop;
s = "width="+windowW+",height="+windowH;

function SPE_ApriPopupBreakingNews(){
	popup=window.open('Popup_FastBreaking.aspx',"FastBreakingNews","top=5000, left=5000,"+s)
	if(popup){
		popup.blur()
		window.focus() 
		popup.moveTo(windowX,windowY)
		popup.focus()   
		if (autoclose){
			window.onunload = function(){popup.close()}
		}
		SPE_movePopup();
	}
}

function SPE_movePopup(){
  	if (windowYnow!=windowYstop){
      popup.moveTo(windowX,windowYnow);
      popup.focus();
      windowYnow=windowYnow-windowStep;
	  windowStep--;
      timer=setTimeout("SPE_movePopup()",moveSpeed);
    }else{
      clearTimeout(timer);
      popup.moveTo(windowX,windowYstop);
      popup.focus();
    }
}
//---Fine codice popup fastbreaking

//--- nuova finestra

function newWindow(url) {
window.open(url,"externalLink");
}

//--- nuova finestra

//---Inizio codice menu
var ultimo=""
function VisualizzaMenu(cella,quale){
	var menu = document.getElementById(quale);
	var parentela = "";
	var coorY = 0;
	var coorX = 0;
	if(ultimo){
		clearTimeout(timerMENU)
		document.getElementById(ultimo).style.visibility='hidden';
	}
	while(eval("cella." + parentela + "tagName") != "BODY")
	{
		coorY = coorY + eval("cella." + parentela + "offsetTop");
		coorX = coorX + eval("cella." + parentela + "offsetLeft");
		parentela = parentela + "offsetParent."	;
	}

	if(navigator.product != 'Gecko') {
		menu.style.width = cella.offsetWidth + "px";
	} else {
		menu.style.width = -2 + cella.offsetWidth + "px";
	}
	menu.style.top=coorY + cella.offsetHeight;
	menu.style.left=coorX;
	timerMENU=setTimeout("document.getElementById("+quale+").style.visibility='hidden'",1000);
	menu.style.visibility='visible';
	ultimo=quale;
}
function spegniTimer(){
	clearTimeout(timerMENU);
}
function riaccendiTimer(quale){
	var daSpegnere=quale.parentNode.id;
	timerMENU=setTimeout("document.getElementById("+daSpegnere+").style.visibility='hidden'",1000);
}
function setta(){
	var contenitorMenu=document.getElementById('Header');
	var linkMenu=contenitorMenu.getElementsByTagName('a');
	for(i=0;i<linkMenu.length;i++){
		if(linkMenu[i].parentNode.nodeName=='DIV' && linkMenu[i].parentNode.id!='Header'){
			linkMenu[i].onmouseover = function(){spegniTimer()}
			linkMenu[i].onmouseout = function(){riaccendiTimer(this)}
		}
	}
	if(document.getElementById('MenuSezione')){
		var contenitorMenuSezione=document.getElementById('MenuSezione');
		var linkMenuSezione=contenitorMenuSezione.getElementsByTagName('a');
		for(i=0;i<linkMenuSezione.length;i++){
			if(linkMenuSezione[i].parentNode.nodeName=='DIV'){
				linkMenuSezione[i].onmouseover = function(){spegniTimer()}
				linkMenuSezione[i].onmouseout = function(){riaccendiTimer(this)}
			}
		}
	}
}

/*Inizio codice per evitare gli onload conflicts*/
if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", setta, false );
else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", setta );
}
else {
    if ( window.onload != null ) {
        var oldOnload = window.onload;
        window.onload = function ( e ) {
            oldOnload( e );
            setta();
        };
    }
    else
        window.onload = setta;
}
/*Fine codice per evitare gli onload conflicts*/
window.onresize=function(){if(ultimo) document.getElementById(ultimo).style.visibility='hidden'}
//---Fine codice menu
//-->