function esplodilivello(fake)
{
// legge dalla URL il numero del layer che sara' esploso
// nel onLoad del <BODY>
var pos_inz=location.search.lastIndexOf("=")+1;
var pos_fin=location.search.length;
var id=location.search.substring(pos_inz,pos_fin)
quale_livello='';
if (id=='1') {quale_livello='Uno'; expandIE(quale_livello);};
}

var bV=parseInt(navigator.appVersion);
NS4=(document.layers)?true:false;
IE4=(document.all)?true:false;
ver4=(NS4 || IE4)?true:false;
var firstInd=1;
if (document.images) {
arImLoad=new Array 
arImList=new Array ();
for (counter in arImLoad) {
arImList[counter]=new Image();
arImList[counter].src=arImLoad[counter] + ".gif";
}}
function expandIt(){return}
function expandAll(){return}


isExpanded=false;
function reDo(){window.location.reload()}
function getIndex(el) {
ind=null;
for (i=0; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id==el) {
ind=i;
break;
}
}
return ind;
}
function arrange() {
nextY=document.layers[firstInd].pageY + document.layers[firstInd].document.height-10;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY=nextY;
nextY += whichEl.document.height-10;
}
}
}
function initIt(){
if (NS4) {scrollTo(0,pageYOffset-30)
for (i=0; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility="hide";
whichEl.isExpanded=false;
}
}
arrange();
setTimeout("window.onresize=reDo",1000)
}
else {
tempColl=document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") {
tempColl(i).style.display="none";
tempColl(i).isExpanded=false;
}
}
}
}


function closeIt(el) {
if (!ver4) return;
if (IE4) {closeIE(el)} else {closeNS(el)}
}
function closeIE(el) { 
whichEl=eval(el + "Child");
whichIm=event.srcElement;
whichEl.style.display="none";
whichEl.isExpanded=false;

//window.alert("chiudo:" + el);

}
function closeNS(el) {
whichEl=eval("document." + el + "Child");
whichIm=eval("document." + el + "Parent.document.images['imEx']");
whichEl.visibility="hide";
whichEl.isExpanded=false;
}

function expandIt(el) {
if (!ver4) return;
if (IE4) {expandIE(el)} else {expandNS(el)}
}
function expandIE(el) { 

whichEl=eval(el + "Child");
whichIm=event.srcElement;

if (whichEl.style.display == "") {whichEl.style.display = "none"}

if (whichEl.style.display == "none") {
whichEl.style.display="block";
whichEl.isExpanded=true;

//window.alert("apro:" + el);

}
else {
whichEl.style.display="none";
whichEl.isExpanded=false;

}
}
function expandNS(el) {
whichEl=eval("document." + el + "Child");
whichIm=eval("document." + el + "Parent.document.images['imEx']");
if (whichEl.visibility == "hide") {
whichEl.visibility="show";
whichEl.isExpanded=true;

}
else {
whichEl.visibility="hide";
whichEl.isExpanded=false;

}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl=document.layers[i];
whichEl.visibility="show";
}
}
function expandAll(isBot) {

if (NS4) {
document.images["imEx"].src=newSrc;
for (i=firstInd; i<document.layers.length; i++) {
whichEl=document.layers[i];
if (whichEl.id.indexOf("Parent") != -1) {
whichEl.document.images["imEx"].src=newSrc;
}
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility=(isExpanded)?"hide":"show";
whichEl.isExpanded=(isExpanded)?false:true;
}
}
arrange();
if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
}
else {
divColl=document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
if (divColl(i).className == "child") {
divColl(i).style.display=(isExpanded)?"none":"block";
divColl(i).isExpanded=(isExpanded)?false:true;
}
}
imColl=document.images.item("imEx");
for (i=0; i<imColl.length; i++) {
imColl(i).src=newSrc;
}
}
isExpanded=!isExpanded;
}
with (document) {
write("<STYLE TYPE='text/css'>");
write(".parent {");
if (NS4) {write("position:absolute; visibility:hidden;")};
if (IE4) {write("margin-top:10;")};
write("margin-left:10;");
write("color:#006");
write("}");
write(".child {");
if (NS4) {write("position:absolute; visibility:hidden;")};
if (IE4) {write("display:none;")};
write("margin-left:0;");
write("}");
write(".other {");
if (NS4) {write("position:absolute; visibility:hidden;")};
write("margin-left:0;");
write("}");
write("</STYLE>");
}
function linkIt(whichEl, whichHref) {
lay=(NS4)?eval("document."+whichEl+"Child"):eval(whichEl+"Child");
if (!lay.isExpanded) expandIt(whichEl);
nlay=(NS4)?lay.document.images[whichHref]:document.images[whichHref];
if (NS4){
sY=nlay.y+lay.pageY-20
window.scrollTo(0,sY);
}else{nlay.scrollIntoView();scroll(0,document.body.scrollTop-20);
//alert(nlay.parentElement.tagName);
nlay.parentElement.style.backgroundColor="#FF99FF";setTimeout("nlay.parentElement.style.backgroundColor='white'",1000);}
}
window.onload=initIt;

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function BW_centerLayers() { //v4.1.1
	if (document.layers || document.all || document.getElementById){
		var winWidth, winHeight, i, horz, vert, width, height, offsetX, offsetY, negX, negY, group, x, y, args;
		args = BW_centerLayers.arguments;
		
		onresize = BW_reload;

				
		winWidth = (document.all)?document.body.clientWidth:window.innerWidth;
		winHeight = (document.all)?document.body.clientHeight:window.innerHeight;
				
		for (i=0; i<(args.length-9); i+=10) {
			horz    = args[i+1];
			vert    = args[i+2];
			width   = parseInt(args[i+3]);
			height  = parseInt(args[i+4]);
			offsetX = parseInt(args[i+5]);
			offsetY = parseInt(args[i+6]);
			negX    = args[i+7];
			negY    = args[i+8];
		
			x = ((winWidth - width)/2) + offsetX;
			y = ((winHeight - height)/2) + offsetY;
						
			x = (negX=='false' && (x < 0))?0:x;
			y = (negY=='false' && (y < 0))?0:y;
				
			layerObj = (document.getElementById)?document.getElementById(args[i]):MM_findObj(args[i]);
			
			if (layerObj!=null) {
				layerObj = (layerObj.style)?layerObj.style:layerObj;
				layerObj.left = (horz=="true")?x:layerObj.left;
				layerObj.top = (vert=="true")?y:layerObj.top;
			}
		}
	}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function BW_reload() {location.reload();}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

