<!--
function input(){
var sez=top.dati.document.forms[0].elements['sez'].value;
var pag=top.dati.document.forms[0].elements['pag'].value;
var sch=top.dati.document.forms[0].elements['sch'].value;
if (top.dati.document.forms[0].elements['index'].value!=1){
top.dati.document.forms[0].elements['index'].value=1;
go(sez,pag,sch);
}else{
top.dati.document.forms[0].elements['index'].value=0;
top.sito.document.location.href='mappa.htm';
}
}

function input2(){
setTimeout('input()',250);
}

function input3(){
var sez=top.dati.document.forms[0].elements['sez'].value;
var pag=top.dati.document.forms[0].elements['pag'].value;
var sch=top.dati.document.forms[0].elements['sch'].value;
lay="layer"+sez;
layer(lay,'','show');
}

function input4(){
setTimeout('input3()',250);
}

function go(sez,pag,sch,s){
if(sch==null){sch=0;}
var loc;
if(sez==1){loc="pag/chi";}
if(sez==2){loc="pag/cosa";}
if(sez==3){loc="pag/come";}
if(sez==4){loc="pag/dove";}
if(s==1)  {loc="../cosa";}
loc=loc+pag;
if(sch!=0){loc=loc+"-"+sch;}
loc=loc+".htm";
top.dati.document.forms[0].elements['sez'].value=sez;
top.dati.document.forms[0].elements['pag'].value=pag;
top.dati.document.forms[0].elements['sch'].value=sch;
top.sito.main.document.location.href=loc;
}
function go2(pag){
top.dati.document.forms[0].elements['pag'].value=pag;
}
function jump(i){
var sez = top.dati.document.forms[0].elements['sez'].value;
var pag = top.dati.document.forms[0].elements['pag'].value;
var sch = top.dati.document.forms[0].elements['sch'].value;
if(sch==0){if(i==0){pag=0;}
					 if(i==-2){pag=1;}
					 if(i==-3){pag=7;}					 
					 if(i==1||i==-1){pag=eval(pag)+i};}
else      {if(i==0){sch=0;}
					 else{if(i==-2){sch=1;}
					 		  if(i==-3){sch=2;}
					 		  if(i==-4){sch=3;}
					 		  if(i==-5){sch=4;}
							  if(i==-6){sch=5;}
					      if(i==1||i==-1){sch=eval(sch)+i};}}
if(sez==1){loc="../chi";}
if(sez==2){loc="../cosa";}
if(sez==3){loc="../come";}
if(sez==4){loc="../dove";}
loc=loc+pag;
if(sch!=0){loc=loc+"-"+sch;}
loc=loc+".htm";
top.dati.document.forms[0].elements['pag'].value=pag;
top.dati.document.forms[0].elements['sch'].value=sch;parent.parent.frames[1].document.location.href=loc;
}

function download(n){
var pag = top.dati.document.forms[0].elements['pag'].value;
var sch = top.dati.document.forms[0].elements['sch'].value;
var loc="../../schede/SV-";
if (n==1) {
			loc=loc+"scheda-"+pag+"-"+sch;
			loc=loc+".pdf"
			} 
else      {
			loc=loc+"schede-"+pag;
			loc=loc+".zip";
			}

parent.location.href=loc;
}

function inizio(){
var sez = top.dati.document.forms[0].elements['sez'].value;
var pag = top.dati.document.forms[0].elements['pag'].value;
var sch = top.dati.document.forms[0].elements['sch'].value;
var loc;
if(sez==1){loc="../cont/chi";}
if(sez==2){loc="../cont/cosa";}
if(sez==3){loc="../cont/come";}
if(sez==4){loc="../cont/dove";}
loc=loc+pag;
if(sch!=0){loc=loc+"-"+sch;}
loc=loc+".htm#t";
parent.frames[1].document.location.href=loc;
}
//---------------------------------------------

function redo(){location.reload();}

function lu(o,e)
{
	if (o.getElementById)
		return o.getElementById(e);
	else
		return o[e];
}

function find(n, d){
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=lu(d,n))&&d.all) 
   x=lu(d.all,n); 
for (i=0;!x&&i<d.forms.length;i++) 
   x=lu(d.forms[i],n);
for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  x=find(n,d.layers[i].document); 
return x;
}

function swap(){
var i,j=0,x,a=swap.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if((x=find(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function swaprest(){
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preload(){
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preload.arguments; for(i=0; i<a.length; i++)
if(a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function change(objName,x,theProp,theValue){ //v3.0
var obj = find(objName);
if(obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
function layer(){
var i,p,v,obj,args=layer.arguments;
for (i=0; i<(args.length-2); i+=3) if((obj=find(args[i]))!=null){ v=args[i+2];
if(obj.style){ obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}
}
if(document.layers){origWidth = innerWidth; origHeight = innerHeight;}
function reDo(){if(innerWidth != origWidth || innerHeight != origHeight) location.reload();}
if(document.layers) onresize = reDo;

//---------------------------------------------

function MFXinitMenu(){
IE = NN = NN6 = 0;
if (document.all)
	IE = 1;
else if (document.getElementById) 
	NN6 = 1;
else if (document.layers)
	NN = 1;

HIDDEN = (NN) ? 'hide' : 'hidden';
VISIBLE = (NN) ? 'show' : 'visible';
myLayer=new Array();
mySpeed=5;
subLeft=4;
closes=true;
if (NN6) {
	myLayer[0]= document.getElementById("MFX0").style;
	myLayer[1]= document.getElementById("MFX1").style;
	myLayer[2]= document.getElementById("MFX2").style;
	myLayer[3]= document.getElementById("MFX3").style;
	myLayer[4]= document.getElementById("MFX4").style;
	myLayer[5]= document.getElementById("MFX5").style;
	myLayer[6]= document.getElementById("MFX6").style;
	myLayer[7]= document.getElementById("MFX7").style;
	myLayer[8]= document.getElementById("MFX8").style;
	myLayer[9]= document.getElementById("MFX9").style;
	myLayer[10]= document.getElementById("MFX10").style;
	myLayer[11]= document.getElementById("MFX11").style;
	myLayer[12]= document.getElementById("MFX12").style;
	myLayer[13]= document.getElementById("MFX13").style;
} else if (IE) {
	myLayer[0]= document.all.MFX0.style;
	myLayer[1]= document.all.MFX1.style;
	myLayer[2]= document.all.MFX2.style;
	myLayer[3]= document.all.MFX3.style;
	myLayer[4]= document.all.MFX4.style;
	myLayer[5]= document.all.MFX5.style;
	myLayer[6]= document.all.MFX6.style;
	myLayer[7]= document.all.MFX7.style;
	myLayer[8]= document.all.MFX8.style;
	myLayer[9]= document.all.MFX9.style;
	myLayer[10]= document.all.MFX10.style;
	myLayer[11]= document.all.MFX11.style;
	myLayer[12]= document.all.MFX12.style;
    myLayer[13]= document.all.MFX13.style;
} else if (NN) {
	myLayer[0]= document.MFX0;
	myLayer[1]= document.MFX1;
	myLayer[2]= document.MFX2;
	myLayer[3]= document.MFX3;
	myLayer[4]= document.MFX4;
	myLayer[5]= document.MFX5;
	myLayer[6]= document.MFX6;
	myLayer[7]= document.MFX7;
	myLayer[8]= document.MFX8;
	myLayer[9]= document.MFX9;
	myLayer[10]= document.MFX10;
	myLayer[11]=document.MFX11;
	myLayer[12]=document.MFX12;
	myLayer[13]= document.MFX13;
}
running=false;
whichOpen=-1;
lastMain=myLayer.length-2;
MFXmain=new Array();
for(i=0; i<myLayer.length; i++){
mainORsub= i % 2;
MFXmain[i] = mainORsub ? 0:1;}
myTop=new Array();
myLeft=new Array();
myHeight=new Array();
myWidth=new Array();
mySlide=new Array();
for(i=0; i<myLayer.length; i++){
if((NN||NN6)&&MFXmain[i]){
 if(i==0){
  myTop[i]=myLayer[i].top;
  myLeft[i]=myLayer[i].left;}
 else{
  myLeft[i]=myLeft[i-2];
  myTop[i]=myTop[i-2]+myHeight[i-2];
 }
  myHeight[i]=myLayer[i].clip.height;
  myWidth[i]=myLayer[i].clip.width;
  myLayer[i].left=myLeft[i];
  myLayer[i].top=myTop[i];
  myLayer[i].visibility=VISIBLE;
}
if((NN||NN6)&&!MFXmain[i]){
  myTop[i]=myTop[i-1]+myHeight[i-1];
  myLeft[i]=myLeft[i-1];
  myHeight[i]=myLayer[i].clip.height;
  myWidth[i]=myLayer[i].clip.width;
  mySlide[i]=myTop[i]+myHeight[i];
  myLayer[i].left=myLeft[i]+subLeft;
  myLayer[i].top=myTop[i];
}
if((IE)&&MFXmain[i]){
 if(i==0){
  myLeft[i]=myLayer[i].pixelLeft;
  myTop[i]=myLayer[i].pixelTop;
 } else{
  myLeft[i]=myLeft[i-2];
  myTop[i]=myTop[i-2]+myHeight[i-2];}
  myHeight[i]=myLayer[i].pixelHeight;
  myWidth[i]=myLayer[i].pixelWidth;
  myLayer[i].left=myLeft[i];
  myLayer[i].top=myTop[i];
  myLayer[i].visibility=VISIBLE;
 }
 if((IE)&&!MFXmain[i]){
  myTop[i]=myTop[i-1]+myHeight[i-1];
  myLeft[i]=myLeft[i-1];
  myHeight[i]=myLayer[i].pixelHeight;
  myWidth[i]=myLayer[i].pixelWidth;
  myLayer[i].pixelLeft=myLeft[i]+subLeft;
  myLayer[i].pixelTop=myTop[i];
  mySlide[i]=myTop[i]+myHeight[i];
 }
}
  setTimeout("layer('temp','','hide')",250)
}

function MFXrunMenu(myName,newspeed){
ieStep=0;
thereS=false;
thereC=false;
if(newspeed>0){mySpeed=newspeed;}
first=myName;
if(whichOpen==-1&&!running&&MFXmain[myName]&&!(whichOpen==myName)){
running=true;
if(NN){
myLayer[myName+1].clip.height=0;
myLayer[myName+1].visibility=VISIBLE;}
if(IE){
myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
myLayer[myName+1].visibility=VISIBLE;}
MFXopenMenuS(myName);
MFXopenMenuC(myName);}
if(whichOpen>=0&&!running&&!(whichOpen==myName)){
running=true;
second=whichOpen;
ieStep1=myHeight[second+1];
thereCS=false;
thereCC=false;
MFXcloseMenuS(second);
MFXcloseMenuC(second);}
if(whichOpen>=0&&!running&&whichOpen==myName&&closes){
running=true;
second=whichOpen;

ieStep1=myHeight[second+1];
thereCS=false;
thereCC=false;
MFXcloseMenuS(second);
MFXcloseMenuC(second);}}

function MFXstopCloseS(myName){
running=false;
thereCS=true;
if(closes&&first==whichOpen){whichOpen=-1;}
else{whichOpen=-1;
MFXrunMenu(first);}}

function MFXstopOpenS(myName){
running=false;
thereS=true;
if(IE||NN6){myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ ("auto") +" "+ ("auto") +")";}
whichOpen=myName;}

function MFXopenMenuS(myName){
myStep=mySpeed;
if(NN&&!thereS&&!(first==lastMain)){
if(myLayer[first+2].top+myStep>mySlide[first+1]){
myStep=mySlide[first+1]-myLayer[first+2].top;}
for(i=first+2; i<myLayer.length; i+=2){
myLayer[i].top+=myStep;}
if(myLayer[first+2].top==mySlide[first+1]){
MFXstopOpenS(first)}
if(running)setTimeout('MFXopenMenuS(first)',10);}
if((IE||NN6)&&!thereS&&!(first==lastMain)){
if(myLayer[first+2].pixelTop+myStep>mySlide[first+1]){
myStep=mySlide[first+1]-myLayer[first+2].pixelTop;}
for(i=first+2; i<myLayer.length; i+=2){
myLayer[i].pixelTop+=myStep;}
if(myLayer[first+2].pixelTop==mySlide[first+1]){
MFXstopOpenS(first)}
if(running)setTimeout('MFXopenMenuS(first)',10);}}

function MFXopenMenuC(myName){
myStep=mySpeed;
if(NN&&!thereC){
if((myLayer[first+1].clip.height+myStep)>myHeight[first+1]){
myLayer[first+1].clip.height=myHeight[first+1]}
if(myLayer[first+1].clip.height==myHeight[first+1]){
thereC=true;
whichOpen=first;
MFXstopOpenS(first)}
else{
myLayer[first+1].clip.height+=myStep;}
if(running)setTimeout('MFXopenMenuC(first)',10);}
if((IE||NN6)&&!thereC){
ieStep+=myStep;
myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep) +" "+ ("auto") +")";
if(ieStep>=myHeight[first+1]){
thereC=true;
whichOpen=first;
MFXstopOpenS(first)}
if(running)setTimeout('MFXopenMenuC(first)',10);}}

function MFXcloseMenuS(myName){
myStep=mySpeed;
if(NN&&!thereCS&&!(second==lastMain)){
if(myLayer[second+2].top-myStep<myTop[second+2]){
myStep=myLayer[second+2].top-myTop[second+2];}
for(i=second+2; i<myLayer.length; i+=2){
myLayer[i].top-=myStep;}
if(myLayer[second+2].top==myTop[second+2]){
MFXstopCloseS(second);}
if(running)setTimeout('MFXcloseMenuS(second)',10);}
if((IE||NN6)&&!thereCS&&!(second==lastMain)){
if(myLayer[second+2].pixelTop-myStep<myTop[second+2]){
myStep=myLayer[second+2].pixelTop-myTop[second+2];}
for(i=second+2; i<myLayer.length; i+=2){
myLayer[i].pixelTop-=myStep;}
if(myLayer[second+2].pixelTop==myTop[second+2]){
MFXstopCloseS(second);}
if(running)setTimeout('MFXcloseMenuS(second)',10);}}

function MFXcloseMenuC(myName){
myStep=-mySpeed;
ieStep1-=mySpeed;
if(NN&&!thereCC){
if((myLayer[second+1].clip.bottom+myStep)<0){
myLayer[second+1].clip.bottom=0;}
if(myLayer[second+1].clip.bottom==0){
thereCC=true;
if(second==lastMain)MFXstopCloseS(second);}
else{myLayer[second+1].clip.bottom+=myStep;}
if(running)setTimeout('MFXcloseMenuC(second)',10);}
if((IE||NN6)&&!thereCC){if(ieStep1<=0){
myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (0) +" "+ ("auto") +")";
thereCC=true;
if(second==lastMain)MFXstopCloseS(second);}
else{
myLayer[myName+1].clip= "rect(" + ("auto") +" "+ ("auto") +" "+ (ieStep1) +" "+ ("auto") +")";}
if(running)setTimeout('MFXcloseMenuC(second)',10);}}
//-->
