imgout=new Image(9,9);
imgin=new Image(9,9);

////////INSERISCI QUI IL PERCORSO PER LE DUE IMMAGINI///////////
    imgin.src="images/legenda_label_open.png";
    imgout.src="images/legenda_label_closed.png";
///////////////////////////////////////////////////////////////

//questo e' lo switch tra le due icone aperto e chiuso
function filter(imagename,objectsrc){
    if (document.images){
        document.images[imagename].src=eval(objectsrc+".src");
    }
}

//ora in base al browser utilizzo le proprieta' corrette di visibilita'
function show(id) { 
    
    if (document.getElementById) { // DOM3 = IE5+, NS6+, FF
        if (document.getElementById(id).style.display == "none"){
            document.getElementById(id).style.display = 'block';
            filter(("img"+id),'imgin');            
        } else {
            filter(("img"+id),'imgout');
            document.getElementById(id).style.display = 'none';            
        }    
    } else { 
        if (document.layers) { // NS4.7  
            if (document.id.display == "none"){
                document.id.display = 'block';
                filter(("img"+id),'imgin');
            } else {
                filter(("img"+id),'imgout');    
                document.id.display = 'none';
            }
        } else { //IE 4
            if (document.all.id.style.visibility == "none"){
                document.all.id.style.display = 'block';
            } else {
                filter(("img"+id),'imgout');
                document.all.id.style.display = 'none';
            }
        }
    }
}
