﻿// Funzione per la gestione della comparsa-scomparsa della finestra popup delle news.
function openPopupNews(id,data,titolo,img)
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML=data + " - " + titolo;
    document.getElementById("testoDesc").innerHTML = document.getElementById("descNews" + id).innerHTML;//.replace("%br%","<br/>");
    
    //Sistemo l'immagine.
    if(img!="")
    {
        document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;width:490px;height:490px;' src='news/" + id + "/" + img + "' alt=''/>";
    }
    else
    {
        document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;width:490px;height:490px;' src='grafica/news.jpg' alt=''/>";
    }
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda212()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100BC212";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa212").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/212_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupSchedaFR()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100FR07";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisaFR").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/fuorirotta_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
        
    }
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda650()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100BM06";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa650").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03650_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda652()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100AD07";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa652").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03652_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda670()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100BS08";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa670").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03670_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda680()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100RT07";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa680").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03680_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda630()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100CSP081";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa630").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03630_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda620()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100CSP082";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa620").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03620_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda610()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100FT07";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa610").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03610_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function openPopupScheda600()
{
    nascondiSelect(); //per risolvere bug IE6.
    //Sistemo i testi.
    document.getElementById("titoloNews").innerHTML="<span style='color:#db0029;'>ARTICOLO</span> _ 100CSP083";
    document.getElementById("testoDesc").innerHTML = document.getElementById("descDivisa600").innerHTML;
    
    //Sistemo l'immagine.
    document.getElementById("bigImgPopup").innerHTML="<img style='border:1px solid #8d8d8d;' src='divise/DSC03600_popup.jpg' alt=''/>";
    document.getElementById("print").innerHTML=""
    document.getElementById("sendTo").innerHTML=""
    //Visualizzo il popup.
    document.getElementById("popup").style.display="block";
    
    //Sistemo la dimensione dello sfondo popup.
    if(document.all)
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"
    }
    else
    {
        document.getElementById("sfondo").style.height = document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight + 55 : document.body.offsetHeight + 55 + "px"
    }
    
    document.getElementById("sfondo").style.display="block";
    window.scrollTo(0, 0);
}

function nascondiSelect()
{
    var lista_div = document.getElementsByTagName("select");
    var contatore=0;
    //scansiono la lista dei div.
    for(i=0; i < lista_div.length; i++)
    {
      selezione=lista_div.item(i);
      selezione.style.visibility="hidden";
    }
}

function mostraSelect()
{
    var lista_div = document.getElementsByTagName("select");
    var contatore=0;
    //scansiono la lista dei div.
    for(i=0; i < lista_div.length; i++)
    {
      selezione=lista_div.item(i);
      selezione.style.visibility="visible";
    }
}


