// Funzione che apre un div e chiude tutti gli altri //

function THISonTHAToff(code) {

    ff = document.getElementsByTagName("div");
    for (i = 0; i < ff.length; i++) {
        if (ff[i].id.substr(0,5)=="onOff") {
            ff[i].style.display = "none";
        }
    }   
    for (i = 0; i < ff.length; i++) {
        if (ff[i].id == code) {
            if (ff[i].style.display == "none") {
                ff[i].style.display = "";
            }
        }
    }
}

// Funzione che apre e chiude un div cliccando sul link //

function THISonTHISoff(code) {
    var x = code.split("_");
    x = x[0];
    ff = document.getElementsByTagName(x);
    for (i = 0; i < ff.length; i++) {
        if (ff[i].id == code) {
            if (ff[i].style.display == "") {
                ff[i].style.display = "none";
            } else
            if (ff[i].style.display == "none") {
                ff[i].style.display = "";
            }
        }
    }
}

// Funzione che apre la popup //

function Popup(url, stile) {
	window.open(url, "", stile);
	}
	
// Funzione che sposta il background delle immagini //

function bgChange(bg01,bg01pos,bg02,bg02pos,bg03,bg03pos) {
	biggi01 = document.getElementById(bg01);
	biggi02 = document.getElementById(bg02);
	biggi03 = document.getElementById(bg03);
	biggi01.style.backgroundPosition = bg01pos;
	biggi02.style.backgroundPosition = bg02pos;
	biggi03.style.backgroundPosition = bg03pos;
}

function resizablePopup(myUrl,myWinName,myWidth,myHeight,myPars) {
	var winl = (screen.width - myWidth) / 2;
	var wint = (screen.height - myHeight) / 2;
	parameters = myPars + '';
	if (parameters == '') parameters = ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
	gwin=window.open(myUrl,myWinName,'width='+myWidth+',height='+myHeight+',left='+winl+',top='+wint+parameters);
	if (gwin) gwin.focus();
}

function position(){
	//imgPosition.
	posx=document.getElementById("imgPosition").x;
	posy=document.getElementById("imgPosition").y;
	divVideoStreaming=document.getElementById("videoStreaming");
	divBoxUserDataExpander=document.getElementById("boxUserDataExpanderDiv");
	if (divBoxUserDataExpander==null) alert("layer non trovato");
}

function switchMenu(stat){
	if(navigator.appName.indexOf("Netscape") != -1){
		if(stat=="ON"){
			document.getElementById('menuHeaderDiv').style.height = 400;
		}else{
			document.getElementById('menuHeaderDiv').style.height = 25;
		}
	}
}