// File JScript


function aperturan(a,b,c) {
var idnor = a;
        window.open('normativad.aspx?id='+idnor, '_blank');

}
function apridettaglio(a) {
var idnor = a;
        window.open('normativad.aspx?id='+idnor, '_blank');

}

function hl(id) {
var idgo = id;

if (id == 1)
	{
	window.location.href = "attualita.aspx";
	}
else if (id == 2)
	{
	window.location.href = "approfondimenti.aspx";
	}
else if (id == 3)
	{
	window.location.href = "efsa.aspx";
	}
else if (id == 4)
	{
	window.location.href = "eventi.aspx";
	}
else if (id == 5)
	{
	window.location.href = "prodotti.aspx";
	}
}

function sidemenuon(id) {
    var idsidemenu = id;
    document.getElementById(idsidemenu).style.color = '#f49401';
    document.getElementById(idsidemenu).style.backgroundPosition = "0 25px";
    document.getElementById(idsidemenu).style.cursor = 'pointer';
}

function sidemenuoff(id) {
    var idsidemenu = id;
    document.getElementById(idsidemenu).style.color = '#767676';
    document.getElementById(idsidemenu).style.backgroundPosition = "0 0";
}

function showhiddenmenu() {
    document.getElementById('menuover').style.display = "block";
    document.getElementById('menuover').style.backgroundPosition = "0 0";    
}
function hidehiddenmenu() {
    document.getElementById('menuover').style.display = "none";
}

function showhidden() {
    document.getElementById('menuover').style.display = "block";
}
function hidehidden() {
    document.getElementById('menuover').style.display = "none";
}

function cb(id) {
    document.getElementById('menuover').style.visibility = "visible";
    document.getElementById('menuover').style.cursor = 'pointer';
    if (id == "mo1") {
    document.getElementById('menuover').style.backgroundPosition = "0 -100px";
    }
    if (id == "mo2") {
    document.getElementById('menuover').style.backgroundPosition = "0 -200px";
    }
    if (id == "mo3") {
    document.getElementById('menuover').style.backgroundPosition = "0 -300px";
    }
    if (id == "mo4") {
        document.getElementById('menuover').style.backgroundPosition = "0 -400px";
    }
}
function cbclick(id) {
    if (id == "mo4") {
        window.location.href = "prodotti.aspx";
    }
    if (id == "mo1") {
        window.location.href = "aziende.aspx";
    }
    if (id == "mo3") {
        window.location.href = "consulenti.aspx";
    }
    if (id == "mo2") {
        window.location.href = "cases.aspx";
    }
}
function sidemenuclick(id) {
    var idsidemenu = id;
    if (idsidemenu == "ml1") {
        window.open('http://www.epc.it/dettaglioArticoli.aspx?id=1385', '_blank');
    }
    else if (idsidemenu == "ml2") {
        window.open('http://www.epc.it/archivionewsletter.aspx?id=1401', '_blank');
    }
    else if (idsidemenu == "ml3") {
            window.open('http://www.epc.it/HomeLibri.aspx', '_blank');
    }
    else if (idsidemenu == "ml4") {
        window.location.href = "";
    }
    else if (idsidemenu == "ml5") {
            window.open('http://www.epc.it/dettaglioArticoli.aspx?id=1645&t=5&p=1&n=1', '_blank');
    }
    else if (idsidemenu == "ml6") {
            window.open('http://www.epc.it/articoliLav.aspx?t=13&p=2', '_blank');
    }
}
function layeron(id) {
    var idlayer = id;
    document.getElementById(idlayer).style.background = '#00B1E6';
    document.getElementById(idlayer).style.color = '#ffffff';
    //document.getElementById('ml8').style.backgroundPosition = '0 25px';
    //document.getElementById('ml8').color = '#ffffff';
    document.getElementById('sidepop').style.cursor = "pointer";
}
function layeroff(id) {
    var idlayer = id;
    document.getElementById(idlayer).style.backgroundImage="url('img/sfondocolsx.jpg')";
    //document.getElementById(idlayer).style.backgroundImage = "img/sfondocolsx.jpg";
    document.getElementById(idlayer).style.color = '#00B1E6';    
    //document.getElementById('ml8').style.backgroundPosition = '0 0px';
    //document.getElementById('ml8').color = '#00B1E6';
}
function dison() {
    document.getElementById('sidepop').style.display = "block";
    if (document.getElementById('spcell1').innerHTML == "Tvcc 2009") {
        document.getElementById('ml8').style.color = '#FFFFFF';
        document.getElementById('ml8').style.backgroundPosition = "0 25px";
    }
}
function disoff() {
    document.getElementById('sidepop').style.display = "none";
    if (document.getElementById('spcell1').innerHTML == "Tvcc 2009") {
        document.getElementById('ml8').style.color = '#00B1E6';
        document.getElementById('ml8').style.backgroundPosition = "0 0";
    }
}

function vaia(id) {
    var idvar = id;
    if (idvar == "sp1") {
        if (document.getElementById('spcell1').innerHTML == "Tvcc 2009") 
        {
            window.open('http://www.insic.it/eventi/tvcc2009/index.htm', '_blank');
        }
    }
    else if (idvar == "sp2") {
        if (document.getElementById('spcell2').innerHTML == "Tvcc 2008") 
        {
            window.open('http://www.insic.it/eventi/tvcc2008/index.htm', '_blank');
        }
    }
    else if (idvar == "sp3") {
        if (document.getElementById('spcell3').innerHTML == "Tvcc 2007") 
        {
            window.open('http://www.insic.it/speciali/tvcc2007/index.htm', '_blank');
        }
    }
}


function fixheight() {
    var maxH = 0;
    var ids = ["sinistra","centro","destra"];
    //find the highest column
    for (var i=0;i<ids.length;i++) {
        var d = document.getElementById(ids[i]);
        if (d.offsetHeight > maxH) maxH = d.offsetHeight;
    }
    //set them all to be that height
    for (var i=0;i<ids.length;i++) {
        var d=document.getElementById(ids[i]);
        d.style.height = maxH+"px";
    }
}

function gohome() {
        window.location.href = "index.aspx";
}

function logodown() 
{
            window.open('logoantifurto.zip', '_blank');
}

function abbonati() 
{
            window.open('alibe.rtf', '_blank');
}
function apribanner(link,id) {
    window.open("bannerstat.aspx?idb=" + id + "&link=" + link, "_blank");
}
function apribanner1(link,id) {
    window.open("http://www.epc.it/ArchivioRivisteOnline.aspx?id=08");
}
function validareg() {
    if (document.getElementById('ctl00_ContentPlaceHolder1_check1').checked == true) {
        return true;
    }
    else 
    {
        alert("Per registrarti devi accettare il trattamento dei tuoi dati secondo il decreto sulla Privacy");
        return false;
    }
    return false;
}
function printSelection(node)
{

  var content=node.innerHTML
  var pwin=window.open('','print_content','width=400,height=600');

  pwin.document.open();
  pwin.document.write('<html><body onload="window.print()">'+content+'</body></html>');
  pwin.document.close();
 
  setTimeout(function(){pwin.close();},1000);

}

