NAV=0;
IE=0;
UFO=false;
VER = parseInt(navigator.appVersion);
LAST_SEL=0;
WIN = 0;
PREC = 0;

 MN_X = 190;
 MN_Y = 90;


debby = 'Non funziona o non è il browser giusto';
//alert (navigator.appVersion);
var n = navigator.appName;
var n2 = navigator.userAgent;

if (n.indexOf("Microsoft")>=0 || n2.indexOf("Firefox")>=0) IE=VER;
else { if (n.indexOf("Netscape")>=0) NAV=VER;

}


n = navigator.platform;

if (n.indexOf("Win")>=0) WIN=1;

if ((NAV==0)&&(IE==0)) UFO=true;

function indice(e) {
	for (f=0; f<document.layers.length; f++) {
		if (document.layers[f].name == e) {
			return f;
		}
	}
	return null;
}

function posiziona_X() {
	X = MN_X;
	Y = MN_Y;
	a = 0;
	for (i=IN1; i<document.layers.length; i++) {
		e = document.layers[i];
		
	if (e.id.indexOf("p") == 0) {
	
	if (i>IN1) {
			X = X + document.layers[i-2].clip.width+2;
			}
			if (e.visibility != "hide") {
			e.bd='1px';
			e.bgColor="#FF9900";
			e.bdColor="#FF9900";
				
				e.pageX = X;
				e.pageY = MN_Y;
		
				
			}	
		}
		if (e.id.indexOf("c") == 0){
	if (i == IN1) e.top = MN_Y + 1;
	else 
 {a = a + 1;
  e.top = MN_Y + (a * 20);
			
			}
	 		e.pageX = MN_X ;
		
		}
	}
}




function startup(n){
	
	if (NAV==4) {
		IN1 = indice("c1");	
		for (i=IN1; i<document.layers.length; i++) {
			e = document.layers[i];
			
			if (e.id.indexOf("c") == 0) { 
			e.visibility = "hide";
						e.bgColor="#8C8A82"
}
		if (e.id.indexOf("p") == 0) {
			e.visibility = "show";
			
	
		}
	}
		posiziona_X();
	
		if (NAV>4)  {
		debby = "Questo Funziona";
	t = document.tags.getElementById("DIV");
		
		for (i=0; i<t.length; i++) {
			if (t(i).className == "child") {
			
			t(i).style.display = "none";
			
			}
			if (t(i).className == "lastchild") 
		{	
		
		t(i).style.display = "inline";
		
		}
		}
	}}
		else {
		
		if (IE>=4) {
		
		//espandi(1);
		//espandi(2);
		//espandi(3);
		
		//LAST_SEL=0;
		t = document.all.tags("DIV");
		for (i=0; i<t.length; i++) {
					if (t(i).className == "child") {
			//alert(i);
			t(i).style.display = "none";
			t(i).style.visibility = "hidden";
			
			}
			if (t(i).className == "lastchild") 
		{	
		
		t(i).style.display = "inline";
		
		}
		}
		
	}}
if (n>0) espandi(n);
}

function espandi(e) {
//alert(LAST_SEL);
	if (LAST_SEL==e) LAST_SEL=0;
	if (IE>=4) {
		if (LAST_SEL>0) MSespandi(LAST_SEL);
		   MSespandi(e);
	} else if (NAV>=4) {
		if (LAST_SEL>0) NSespandi(LAST_SEL);
		  NSespandi(e);
	}
	//alert(LAST_SEL);
}

function MSespandi(e) {

	ele = eval("c" + e);
	if (!ele.style.display) ele.style.display = "none";
	if (!ele.style.visibility) ele.style.visibility = "hidden";
	//alert(ele.style.visibility);
	if ((ele.style.display == "none") ) {
			ele.style.display = "inline";
		ele.style.visibility = "visible";
		LAST_SEL=e;
	} else {
			ele.style.display = "none";
			ele.style.visibility = "hidden";
		if (e==LAST_SEL) LAST_SEL=0;
		
	}
	}
	

function NSespandi(e) {
	
	if (NAV==4) {
	ele = eval("document.c" + e);
	if (ele.visibility == "hide") {
		
		LAST_SEL=e;
		ele.visibility = "show";
	} else {
		ele.visibility = "hide"; 
		if (e==LAST_SEL) LAST_SEL=0;	
	}
	posiziona_X();
}
else {if (NAV>4) {
ele = eval("c" + e);
	if (ele.style.visibility == "hidden") {
		ele.style.visibility = "visible";
		LAST_SEL=e;
	} else {
			ele.style.visibility = "hidden";
		if (e==LAST_SEL) LAST_SEL=0;
		
	}
	posizionaNS6_X()
	}
}}



with (document) {
	write("<STYLE TYPE='text/css'><!--");
	if (NAV>=4){
	if (NAV==4) {
		write(".wait { position:absolute; visibility:show;  z-index:1; top: 20; left: 18; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #000000; text-decoration: none;}");
		write(".parent { position:absolute; visibility:show;   width: 200px; height: 18px; }");
		write(".lastparent { position:absolute; visibility:show; width:200px; height:18px;  }");
		write(".bottone {  visibility:show; width:85px; height:15px;  float: none; background-color:  #8C8A82; }");
		write(".bottone2 { width: 80px; height: 15px; background-color: #8C8A82; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none;  }");
		write(".bottone2:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");
		write(".alwayson { position:absolute; visibility:hidden;}");
		write(".child { position:absolute; visibility:hidden; }");
		write(".lastchild { position:absolute; visibility:hidden; }");
		write(".regular { position:absolute; visibility:hidden border: 1px; background-color:  #FFFFFF;}");
		write(".header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #ffffff; text-decoration: none; }");
		write(".opt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;  font-weight:normal; color: #ffffff; text-decoration: none}");
		write(".opt:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #ffffff; text-decoration: underline}");
	} 
	else  {
		write(".wait { display:none; }");
		write(".parent { width:160px; height:15px;  pageBreakAfter: always; float: none; background-color: #8C8A82; border-top: 1px solid #FF9900; border-bottom: 1px solid #FF9900; border-left: 1px solid #FF9900; border-right: 1px solid #FF9900;}");
		write(".bottone { width:160px; height:15px;  pageBreakAfter: always; float: none; background-color: #8C8A82; }");
		write(".bottone2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none; width: 160px; height: 15px;}");
		write(".bottone2:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");
		write(".lastparent { width:160px; height:15px; pageBreakAfter: always;float: none; background-color: #CCCDB4;}");
		write(".alwayson { position:absolute; pageBreakAfter: always; float: none;}");
		write(".child { display:none; z-index:1; pageBreakAfter: always; float: none; noborder-top: 1px solid #FFFFFF; width:160px; background-color: #8C8A82}");
		write(".lastchild { display:none; pageBreakAfter: always; float: none;}")
		write(".header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none; width: 160px; height: 15px;}");
		write(".header:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");
		write(".opt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:normal; color: #FFFFFF; text-decoration: none}");
		write(".opt:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:normal; color: #FFFFFF; text-decoration: underline;}");
	}
	}
	else 	if (IE>=4) {
		write(".wait { display:none; }");
		write(".parent { width:160px; height:15px;  pageBreakAfter: always; float: none; background-color: #8C8A82; border-top: 1px solid #FF9900; border-bottom: 1px solid #FF9900; border-left: 1px solid #FF9900; border-right: 1px solid #FF9900;}");
		write(".bottone { width:160px; height:15px;  pageBreakAfter: always; float: none; background-color: #8C8A82; }");
		write(".bottone2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none; width: 160px; height: 15px;}");
		write(".bottone2:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");
		write(".lastparent { width:160px; height:15px; pageBreakAfter: always;float: none; background-color: #CCCDB4;}");
		write(".alwayson { position:absolute; pageBreakAfter: always; float: none;}");
		write(".child { display:none; z-index:1; pageBreakAfter: always; float: none; noborder-top: 1px solid #FFFFFF; width:160px; background-color: #8C8A82}");
		write(".lastchild { display:none; pageBreakAfter: always; float: none;}")
		write(".header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none; width: 160px; height: 15px;}");
		write(".header:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");
		write(".opt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:normal; color: #FFFFFF; text-decoration: none}");
		write(".opt:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:normal; color: #FFFFFF; text-decoration: underline;}");
	} 
	else {
		write(".parent { background-color: #8C8A82; border-top: 1px solid #FF9900;  border-left: 1px solid #FF9900; border-right: 1px solid #FF9900;}");
		write(".child {  background-color: #CCCDB4; border-bottom: 1px solid #FF9900; border-left: 1px solid #FF9900; border-right: 1px solid #FF9900;}");
		write(".header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:bold; color: #FFFFFF; text-decoration: none; }");
		write(".opt { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;  font-weight:normal; color: #FF0000; text-decoration: none}");
			write(".bottone { width:80px; height:15px;  pageBreakAfter: always; float: none; background-color: #8C8A82; border-top: 1px solid #FF9900; border-bottom: 1px solid #FF9900; border-left: 1px solid #FF9900; border-right: 1px solid #FF9900;}");
		write(".bottone2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FFFFFF; text-decoration: none; width: 80px; height: 15px;}");
		write(".bottone2:hover { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;  font-weight:normal; color: #FF9900; text-decoration: none; background-color: #CCCDB4}");

	
	}
	write("//--></STYLE>");
}
