/*function popup(url, width, height)
{
settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}

function popup_image(chemin)
{
    i1 = new Image;
    i1.src = chemin;
    html = '<HTML>\n<HEAD>\n<TITLE>Image</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER>\n</BODY>\n</HTML>';
    popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
    popupImage.document.open();
    popupImage.document.write(html);
    popupImage.document.close()

}*/

function ChangeLang(combo, file, query_string) {
if (combo.options[combo.selectedIndex].value!="null") { 
window.location.href = file + '?lang=' +combo.options[combo.selectedIndex].value + query_string;
}
}


function popup(url, width, height)
{
settings="toolbar=no,location=no,directories=no,"+"status=no,menubar=no,scrollbars=yes,resizable=yes,width="+width+",height="+height;
MyNewWindow=window.open(url,name,settings);
}

function apri(theurl,thexsize,theysize,scrolls,name){
    k=0;
    w=screen.width;
    h=screen.height;
    l=(w-thexsize)/2;
    t=(h-theysize)/2;
    setting="width="+thexsize+",height="+theysize+",resizable=yes,scrollbars="+scrolls;
    finestra=window.open(theurl,name,setting);
    /*name=window.open(theurl,"f"+k,);*/
    finestra.moveTo(l,t);
    finestra.focus();
}

function apriName(theurl,thexsize,theysize,scrolls,name){
    k=0;
    w=screen.width;
    h=screen.height;
    l=(w-thexsize)/2;
    t=(h-theysize)/2;
    setting="width="+thexsize+",height="+theysize+",resizable=yes,location=no,scrollbars="+scrolls;
    finestra=window.open(theurl,name,setting);
    /*name=window.open(theurl,"f"+k,);*/
    finestra.moveTo(l,t);
    finestra.focus();
}


function afficheVignette(cheminVignette,cheminMaxi)
    {
    document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=1 ALT="Clicca qui per ingrandire la foto"></A>');
    }
function afficheMaxi(chemin)
    {
    i1 = new Image;
    i1.src = chemin;
    html = '<HTML>\n<HEAD>\n<TITLE>Image</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER>\n</BODY>\n</HTML>';
    popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
    popupImage.document.open();
    popupImage.document.write(html);
    popupImage.document.close()
    };
    
function trim(x) 
        {
            return x.toString().replace(/^[ \t\r\n]+/,'').replace(/[ \t\r\n]+$/,'');
        }

        

function AbilitaDisabilita(id) {
    id_img = document.getElementById("img_"+id);
    id_div = document.getElementById(id);
    if (id_div.style.display=='block') {
        id_img.src = '../../common/img/albero_piu.png';
        id_div.style.display='none';
    } else {
        id_img.src = '../../common/img/albero_meno.png';
        id_div.style.display='block';
    }
}
