//window.onload = setLinks;


function hideLayer() {
    for (var i = 0; i < arguments.length; i++) {
        var e = document.getElementById(arguments[i]);
        e.style.display = 'none';
    }
}

function showLayer() {
    for (var i = 0; i < arguments.length; i++) {
        var e = document.getElementById(arguments[i]);
        e.style.display = 'block';
    }
}


	var topMenu;
		function changeBkg(ID){
			document.getElementById(ID).className="boxS_on";
		}
//
//
		function changeBkgSelezionato(ID){
				i=7;
				for (i=0 ; i<=7; i++) {
					document.getElementById(i).className="boxS";
				}

				document.getElementById(ID).className="boxS_on";
				topMenu = ID;
		}
//
//
		function changeBkg_off(ID){
			if(topMenu!=ID) document.getElementById(ID).className="boxS";
		}

// popup div homepage
	x = 260;
	y = 41;
function setVisible(obj)
{
	obj = document.getElementById(obj);
	//obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	obj.style.display = (obj.style.display == 'block') ? 'none' : 'block';
}
function placeIt(obj)
{
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	if(obj!=null){
		obj.style.left = theLeft + 'px' ;
		obj.style.top = theTop + 'px' ;
	}
	setTimeout("placeIt('layer1')",500);
}
try { window.onscroll = setTimeout("placeIt('layer1')", 500); }catch (error){}
//vecchi script

function raccomandazioni() {
	window.open("/raccomandazioni.html","racco","menubar=no,location=1,toolbar=no,status=no,scrollbars=no,resizable=no,width=620,height=400");
}

function setLinks() {
	if (document.getElementsByTagName) {
		var links = document.getElementsByTagName("a");
		for (var i=0;i<links.length; i++) {
			if (links[i].getAttribute("href") && links[i].getAttribute("rel") == "menu") {
				links[i].onmouseover = function() {
					f6ActiveFlash(this.id);
				};
				links[i].onmouseout = function() {
					f6DeActiveFlash(this.id);
				};
			}
		}
	}
}

function f6ActiveFlash(id) {
	thisMovie("f6HomeFlash").f6ActiveMenu(id);
}

function f6DeActiveFlash(id) {
	thisMovie("f6HomeFlash").f6DeActiveMenu(id);
}

function thisMovie(movieName) {
    var isIE = navigator.appName.indexOf("Microsoft") != -1;
    return (isIE) ? window[movieName] : document[movieName];
}


function credits() {
window.open("/credits.html","credits",'menubar=no,location=1,toolbar=no,status=no,scrollbars=no,resizable=no,width=334,height=333');}

function noteprivacy() {
window.open("/informativa_contatti.html","credits",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=550');}

function noteregistr() {
window.open("/informativa_registrazione.html","credits",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=550');}

function noteprivacy2() {
window.open("/note_privacy.html","credits",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=550');}

function indicazioniuso() {
window.open("/indicazioni_uso.html","indicazioni_uso",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=450');}

function pop_studi() {
window.open("/pop_studi.html","pop_studi",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=550');}


function showPrivacy(url) {
    window.open(url, '_blank', 'width=620,height=600,scrollbars=yes,resizable=no');
}

function showPrivacyContatti(url) {
    window.open(url, '_blank', 'width=620,height=600,scrollbars=yes,resizable=no');
}

function showPrivacyDCL(url) {
    window.open(url, '_blank', 'width=620,height=600,scrollbars=yes,resizable=no');
}

function showDati(url) {
    window.open(url, '_blank', 'width=610,height=370,scrollbars=no,resizable=no');
}



function nutrizionista() {
window.open("/nutrizionista.html","nutrizionista",'menubar=no,location=1,toolbar=no,status=no,scrollbars=yes,resizable=no,width=620,height=550');}

function showMenu(menuId) {

    if (menuId != currentOpenMenu){
        if (currentOpenMenu != ''){
            document.getElementById("smemu" + currentOpenMenu).style.display = "none";
         }
        currentOpenMenu = menuId;
        document.getElementById("smemu" + currentOpenMenu).style.display = "block";
    }
}

function showSubMenu(menuId) {

    if (menuId != currentOpenSubMenu)
    {
        if (currentOpenSubMenu != '')
        {
            document.getElementById("stmemu" + currentOpenSubMenu).style.display = "none";
        }
        currentOpenSubMenu = menuId;
        document.getElementById("stmemu" + currentOpenSubMenu).style.display = "block";
    }
}

