// ---------------------------------------------------------------- //
// --- MENU PARAMETRIZZATO SEMPLICE (v. 1.1.0) 13 ottobre 2004 ---- //
// ------------- www.androgino.it --------------------------------- //
// ---------------------------------------------------------------- //
// -------------------------------------- Christian Iallonardi ---- //
// -------------------------------------- c.iallo@androgino.it ---- //
// ---------------------------------------------------------------- //

var tc = 600;
var ts = 10;
var tr = 10;
var ddbH = 2;
var ddbV = 3;	
var cf = '../menu/';
var nm = false;
var nf = true;
var som=4; // spessore ombra
var NS4=NS5=false,hi="'hidden'",vi="'visible'",Dw=".width=",Dh=".height=",Dl=".left=",Dt=".top=",Dv=".visibility=",Dc=".clip=",DiP="document.images['",DiD="']",Ds=".src=",dS="document.all['",sD="'].style",sC="']",x="document.body.scrollLeft",y="document.body.scrollTop",mX="window.event.clientX + "+x,mY="window.event.clientY + "+y,oL=".offsetLeft",oT=".offsetTop",oW=".offsetWidth",oH=".offsetHeight",Dbc=".background=",Wf="document.body.clientWidth",Hf="document.body.clientHeight";
if (navigator.appName == "Netscape") {
if (parseInt(navigator.appVersion) >= 5){dS="document.getElementById(\"";sD="\").style";sC="\")";x="window.pageXOffset"; y="window.pageYOffset";mX="evt.clientX + "+x;mY="evt.clientY + "+y;Dbc=".background=";Wf="window.innerWidth";Hf="window.innerHeight";NS5=true;}else{dS="document.";sD="";sC="";x="window.pageXOffset"; y="window.pageYOffset";mX="evt.pageX + "+x;mY="evt.pageY + "+y;Dbc=".bgColor=";DcL=".clip.left=";DcR=".clip.right=";DcT=".clip.top=";DcB=".clip.bottom=";DiP="document.";DiD="";oL=".x";oT=".y";oW=".width";oH=".height";Wf="window.innerWidth";Hf="window.innerHeight";NS4=true;}
}
if(eval(window.innerWidth)){
	Wf="window.innerWidth";
	Hf="window.innerHeight";
}
if(NS4)som=0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);
var mov=null,vaA='',i_d;
var fe=FG=FS=FGH=FSH=rch=true;
var ri=pr=tzH=trsH=tz=trs=car=aperto=mu=fr=false;
var at=lt=av=lv=oy=dtV=dtH=ab=apu=lb=lpu=dfV=dfH=lam=lsm=lbm=ldm=offH=offV=scb=scbH=pd=ps=pb=pa=prd=di=ImgT=kj=vpa=vpb=vav=0;
var ch=ttt=ggg=ti=null;
if (NS5) ddbV += 10;
function convertiHex(num){
	var hex=new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
	var qu=new Array(1048576,65536,4096,256,16,1);
	var str='';
	for(k=0;k<=5;k++){
		Nnum=parseInt(num/qu[k]);
		num=num-(Nnum*qu[k]);
		str+=""+hex[Nnum];
	}
	return str;
}
function CoffV(){
	if(NS4) return window.pageYOffset;
	else return document.body.scrollTop;
}
function AV(){fe=FG=FS=FGH=FSH=true;aperto=tz=tzH=trs=trsH=false;}
function ff(){return;}
function menu(n){if(!pr){pr=true;}else{pr=false;rch=false;ch=setTimeout("DR();",5);}return;}
function LF(){return parseInt( eval(Wf) -ddbH-scb);}
function AF(){return parseInt( eval(Hf) -ddbV-scbH);}
function CXy(n){return parseInt(eval(dS+n+sD+'.left'))+1;}
function CYy(n){return parseInt(eval(dS+n+sD+'.top'));}
function CLy(n){return parseInt(CXi("post_"+n+"_anc")-CXi("pre_"+n+"_anc"))-2;}
function CAy(n){return parseInt(CYi("post_"+n+"_anc")-CYi("pre_"+n+"_anc"));}
function CBy(n){
	if(NS4) return convertiHex(eval(dS+n+sD+'.bgColor'));
	else return eval(dS+n+sD+'.backgroundColor');
}
function CXi(im,gn,al){
	gnAgg="document.images['"+im+"']";
	xImg=0;
	if(NS4 && gn)gnAgg='document.layers["'+gn+'"].document.images["'+im+'"]';
	if(eval(gnAgg)){
		xImg=eval(dS+im+sC+oL);
		if (al=='right') xImg += eval(dS+im+sC+oW)-1;
		if (al=='center') xImg += eval(dS+im+sC+oW)/2;	
		
		if( NS4 ) {
			if (gn)xImg += document.layers[gn].x;
		}else{
			var q = document.getElementById(im);
			while( (q=q.offsetParent) ) { xImg += q.offsetLeft; }
		}
	}else{
		xImg=0;
	}
	return parseInt(xImg)+0;
}
function CYi(im,gn,al){
	gnAgg="document.images['"+im+"']";
	xImg=0;
	if(NS4 && gn)gnAgg='document.layers["'+gn+'"].document.images["'+im+'"]';
	if(eval(gnAgg)){
		yImg=eval(dS+im+sC+oT);
		if (al=='bottom') yImg += eval(dS+im+sC+oH);
		if( NS4 ) {
			if (gn)yImg += document.layers[gn].y;
		}else{
			var q = document.getElementById(im);
			while( (q=q.offsetParent) ) { yImg += q.offsetTop; }
		}
	}else{
		yImg=0;
	}
	return parseInt(yImg)-2+0;
}
function VSF(n,rp){
	fr=false;
	lt=CLy(n);at=CAy(n);ps=CXy(n);pd=ps+lt;pa=CYy(n);pb=pa+at;
	ps=CXy(n);
	pd=ps+CLy(n);
	pa=CYy(n);
	pb=pa+CAy(n);
	lv=pd-ps;
	av=pb-pa;
	fr=false;
	if (pd>LF()-som-3){
		ps=LF()-lt-som-3;
		pd=ps+CLy(n);
		Ay(n,false,false,ps,false,false);
	}
	if (pb>=AF()){
		pa=AF()-at;
		if(at>AF()){
			fr=true;
			if (pa<0)pa=1;
			av=(AF()-pa);
		}	
	} else {
		fr=false;
	}
	pb=pa+av;
	if (pa>AF()) return false;
	DFR(n,rp);
	if (aA()!=n) adA(n);
	if(fr){
		FG=FS=true;
		if (pa==CYy(aA())){
			Ay("fr_su",false,false,false,false,'hidden');
			Ay("sfr_su",false,false,false,false,'hidden');
			FG=false;
		}
		if (pb==CYy(aA())+at){
			Ay("fr_giu",false,false,false,false,'hidden');
			Ay("sfr_giu",false,false,false,false,'hidden');
			FS=false;
		}
	}
	dtV =at-av;
	dtH =lt-lv;
	if(!rp){
		agg=1;
		if(fr)agg=2;
		Ay(n,lv+2,av,ps-1,pa+CoffV()-1,false);
		Ay(n+"_om",lv+1,av+agg,ps,pa+CoffV()-1,false);
	}
	return true;
}
function VCH(n){
	if (aA()==n && ch) {
		rch=true;
		clearTimeout(ch);
		pr=false;
		if (NS4){
			document.layers[n].captureEvents(Event.MOUSEMOVE);
			document.layers[n].onmousemove = ret;
			if (ri){ ri=false; return; }
		}		
	}
	if (!rch && !ch) { rch=true;}
	if (rch && !pr){
		var apr = vaA.split("|");
		var pos=0;
		for (al=0; al<apr.length; al++){
			if (apr[al] == n) pos = al+1;
		}
		if (pos!=0){
			if (apr.length-pos>0 && aA()!=n && fe){
				for (af=pos+1; af<=apr.length; af++){
					nascondi(apr[af-1]);
				}
			}
		}
	}
	aperto=true;
}
function duA(c){
	var apr = vaA.split("|");
	if (apr.length==1 && !c) return vaA;
	vaA='';
	for (ap=0; ap<=apr.length-2; ap++){
		vaA+=apr[ap];
		if (ap!=apr.length-2) vaA+="|";
	}
}
function adA(n){if (vaA!='') vaA+="|";vaA+=n;}
function pA(){var apr = vaA.split("|");if (apr.length!=1) return apr[apr.length-2];}
function aA(){var apr = vaA.split("|");return apr[apr.length-1];}
function BS(){
		Ay(aA(),false,false,false,(CYy('fr_su')-dtV),false);
		RT(aA(),dtV,lv+offH+som,av+dtV,offH);
		Ay("fr_giu",false,false,false,false,'hidden');
		Ay("sfr_giu",false,false,false,false,'hidden');
		offV=pa-CYy(aA());
		FS=false;
}
function BG(){
		Ay(aA(),false,false,false,(CYy('fr_su')),false);
		RT(aA(),0,lv+offH+som,av,offH);
		Ay("fr_su",false,false,false,false,'hidden');
		Ay("sfr_su",false,false,false,false,'hidden');
		offV=pa-CYy(aA());
		FG=false;
}
function MM(dv){
	if (fe){
		if(mov!=null)clearInterval(mov);
		if (dv=='Su'){ mov = setInterval("muSu()",ts); }
		if (dv=='Giu'){ mov = setInterval("muGiu()",ts); }
	}
}
function muSu(){
	if(!FS) return;
	Ay("fr_su",false,false,false,false,'visible');
	Ay("sfr_su",false,false,false,false,'visible');
	FG=true;
	if (CYy(aA())-CoffV()>pb-at+5)Ay(aA(),false,false,false,(CYy(aA())-5),false);
	else BS();	
	offV=pa-CYy(aA())+CoffV();
	RT(aA(),offV,lv+1,av+offV,2);
}
function muGiu(){
	if(!FG) return;
	Ay("fr_giu",false,false,false,false,'visible');
	Ay("sfr_giu",false,false,false,false,'visible');
	FS=true;
	if (CYy(aA())-CoffV()<pa-5)Ay(aA(),false,false,false,(CYy(aA())+5),false);
	else BG();
	offV=pa-CYy(aA())+CoffV();	
	RT(aA(),offV,lv+1,av+offV,2);
}
function ferma(){clearInterval (mov);}
function DR(){rch=true;}
var prdH=0;
var fr_v,prd_v,lv_v,av_v,lt_v,at_v;
function mostra(n,gn,off_x,off_y,al,no_fr,dir){
	if (aA()==n) {
		aperto=true;
		return;
	}else if(aA()){
		eval(dS+"fr_su"+sD+Dv+hi);
		eval(dS+"fr_giu"+sD+Dv+hi);		
		eval(dS+"sfr_su"+sD+Dv+hi);
		eval(dS+"sfr_giu"+sD+Dv+hi);
	}
	if (!gn){  ///  ??? aggiunto perché si bloccava nello scorrimento
		if (ttt) clearTimeout(ttt);
		if (ti) clearTimeout(ti);
		nascondi();
	}
	if (gn==pA())  { 
		rch=true;
		pr=false; 
		di=0;
		if(i_d) clearInterval(i_d);
		fe = true;
		VCH(pA());
	}
	if (aA()!=n && fe){
		aperto=false;
		rch=false;
		ch=setTimeout("DR();",5);
		if(!no_fr){
			if ((!gn) && (CXi(n+'_anc',gn,'left')-(eval(x))>LF() || CYi(n+'_anc',gn,'bottom')-CoffV()>AF())) {
				AV(); 
				aperto=true;
				return;
			}
		}
		if (car && aA()!=n && AF() > 32){
			prd=0;
			if (!gn) nascondi();
			if ((gn && aA()!=n) || no_fr) adA(n);
			AV();
			aperto=true;
			if (!ti) ti=setInterval("nascondi()",tc);
			RI(n,gn,off_x,off_y-CoffV(),al);
			var vsfg=VSF(n,false);
			if (no_fr) { //***spostato qui per problemi con NS4***//
				eval(dS+n+sD+Dv+vi);
				eval(dS+n+"_om"+sD+Dv+vi);
				fe=true;
				return;
			}
			if (!no_fr){
				if (vsfg){
					di=0;
					eval(dS+n+sD+Dv+vi);
					eval(dS+n+"_om"+sD+Dv+vi);
					fe = true;
					m=0;
					if(NS4)m=1;
					if (fr) {
						RT(n,prd+1,lv+1,av+prd+m,2);
						RT(n+"_om",prd,lv+som+2-m,av+prd+som+2,0);
					}else{
						RT(n,1,lt+1,at,2);
						RT(n+"_om",0,lt+som+2-m,at+som+2-m,0);
					}
				}
			}
			fe=true;
			ri=false;
		} else { 
			aperto=false;
			AV();
		}
	}
	if (!gn) {fr_v=fr;prd_v=prd;lv_v=lv;av_v=av;lt_v=lt;at_v=at;}
}
function rc(){
	if (ttt && fe){
		clearTimeout(ttt);
		VSF(aA(),true);
		AV();
		aperto=true;
	}
}
function nascondi(n){
	if (car){	
		trs=false;
		trsH=false;
		if (n){
			if (ti) clearInterval(ti);
			Ay(n+"_om",false,false,false,-500,'hidden');
			Ay(n,false,false,false,-500,'hidden');
			eval(dS+"fr_su"+sD+Dv+hi);
			eval(dS+"fr_giu"+sD+Dv+hi);
			eval(dS+"sfr_su"+sD+Dv+hi);
			eval(dS+"sfr_giu"+sD+Dv+hi);
			if (pA()!=''){
				if (i_d) clearInterval(i_d);
				duA();
				ttt=setTimeout("rc();",50);
			}
			ti=setInterval("nascondi()",tc)
		}else{
			if (!aperto){
				if (i_d) clearInterval(i_d);
				scb=0;
				scbH=0;
				dtH=0;
				dtV=0;
				kj=0;
				if (vaA!=false){			
					var apr = vaA.split("|");				
					for (ap=0; ap<apr.length; ap++){
						eval(dS+apr[ap]+"_om"+sD+Dv+hi);
						eval(dS+"fr_su"+sD+Dv+hi);
						eval(dS+"fr_giu"+sD+Dv+hi);
						eval(dS+"sfr_su"+sD+Dv+hi);
						eval(dS+"sfr_giu"+sD+Dv+hi);
						eval(dS+apr[ap]+sD+Dv+hi);
						nxx=-500
						Ay(apr[ap],false,false,nxx,nxx,false);
					}
				}
				
				vaA='';
				AV();
				if (ti) clearInterval(ti);
				ti=null;
			}	
		}	
	}
	fr_v=null;prd_v=null;lv_v=null;av_v=null;
}
function DES(n,vel){
	ggg=setTimeout("VCH('"+n+"')",300);
	if(vel){
		clearTimeout(ggg);
		if (ti) clearInterval(ti);
		ggg=false;ti=false;aperto=false;nascondi();
	}
}
function RT(n,T,R,B,L){
	if(NS4){	
		eval(dS+n+sD+DcB+	(B) );		
		eval(dS+n+sD+DcT+	(T) );
		eval(dS+n+sD+DcR+	(R) );
		eval(dS+n+sD+DcL+	(L) );	
	}else{
		eval(dS+n+sD+Dc+	("'rect("+T+" "+R+" "+B+" "+L+")'") );
	}
}
var ap1="'";
var ap2="px'";
if(NS4){
	ap1="";
	ap2="";
}
function Ay(n,W,H,L,T,vis){
	if(mac) eval(dS+n+sD+Dv+hi);
	if (W+''!='false') eval(dS+n+sD+Dw+ap1+W+ap2);
	if (H+''!='false') eval(dS+n+sD+Dh+ap1+H+ap2);
	if (L+''!='false') eval(dS+n+sD+Dl+ap1+L+ap2);
	if (T+''!='false') eval(dS+n+sD+Dt+ap1+T+ap2);
	if (vis) eval(dS+n+sD+Dv+"'"+vis+"'");
	if(mac && vis!='hidden') eval(dS+n+sD+Dv+vi);
}
function DFR(n,rp){
	if (fr) {
		Ay('fr_su',lv,false,(pd-(CLy(n)/2))-10,pa+CoffV(),'visible');
		Ay('sfr_su',lv,17,ps,pa+CoffV(),'visible');
		RT('sfr_su',0,lv,17,1);
		Ay('fr_giu',lv,false,(pd-(CLy(n)/2))-10,pb-17+CoffV(),'visible');
		Ay('sfr_giu',lv,17,ps,pb-17+CoffV(),'visible');
		RT('sfr_giu',1,lv,17,1);
		aggL="_om";
		if(NS4)aggL='';
		eval(dS+"sfr_su"+sD+Dbc+"'"+CBy(n+aggL)+"'");
		eval(dS+"sfr_giu"+sD+Dbc+"'"+CBy(n+aggL)+"'");
	}
	if (!rp)Ay(n,false,false,false,pa,false);
}
function RI(n,gn,off_x,off_y,al){
	if (!al) al='left';
	var xx=CXi(n+'_anc',gn,al)-1;
	var yy=CYi(n+'_anc',gn,'bottom');
	if (!xx) xx=CXi(n+'_anc',false,al)-1;
	if (!yy) yy=CYi(n+'_anc',false,'bottom');
	if (al=='right') xx-=CLy(n);
	if (al=='center') xx-=CLy(n)/2;
	if (off_x) xx += off_x;
	if (off_y) yy += off_y;
	Ay(n,false,false,xx,yy,false);
}
function apri_ly(n,col_div,z,bo,onM,BGImg,tsp,sha,cob){
	nM='';
	nF='';
	if(!BGImg)BGImg='';
	if(!col_div)col_div='';
	if(!onM)onM='';
	if(!nf)nf='';
	if (nf) nF=' onMouseOut="aperto=false;" ';
	if (nm) nM=" VCH('"+n+"'); ";
	if (!z) z='100';
	if (NS4) {
		if (BGImg) BGImg = ' background="'+BGImg+'" ';
		if (col_div) col_div=' bgcolor="'+col_div+'" ';
		return '<layer name="'+n+'" visibility="hidden" pagex="0" pagey="-500" width="1" height"1" z-index="'+z+'" '+col_div+' onMouseOver="aperto=true; '+nM+'" '+nF+' '+onM+' onMouseUp="trs=false; tz=false; trsH=false; tzH=false;" '+BGImg+'>';
	}else {
		if (BGImg) BGImg = ' background-image: url('+BGImg+'); ';
		if (col_div) {col_div=' background-color:'+col_div+'; layer-background-color: '+col_div+';';}else{col_div='';}
		if (bo>0) col_div+=' border: '+bo+'px solid '+cob+';';
		if(tsp || sha) tsp_sc=" filter:";
		if (tsp) {
			if (navigator.userAgent.indexOf("MSIE 6.0")!=-1){
				tsp_sc+='progid:DXImageTransform.Microsoft.Alpha(Opacity='+eval(tsp)+') ';
			}else{
				tsp_sc+='Alpha(Opacity='+eval(tsp)+') ';
			}
		} else {tsp_sc='';}
		if(sha && som)tsp_sc+='progid:DXImageTransform.Microsoft.Shadow(strength='+som+', direction=135, color=#000000); ';
		if(tsp_sc!='')tsp_sc+='; ';
		return '<div id="'+n+'" style="visibility:hidden; position:absolute; left: 0px; top: -500px; width: 1px; height: 1px; z-index:'+z+'; '+tsp_sc+col_div+' '+BGImg+'" onMouseOver="aperto=true; '+nM+'" '+nF+' '+onM+' onMouseUp="trs=false; tz=false; trsH=false; tzH=false;">';
	}
}

function Cy(){
	if (NS4) {
		return '</layer>\n';
	}else {
		return '</div>';
	}
}
function DC(n,ctn,bo,cllp){
	if (!cllp) cllp='0';
	if (!bo) bo='0';
	document.write('<table width="1" height="1" border="0" cellpadding="0" cellspacing="0"><tr><td width="1" height="1" valign="top"><img src="'+cf+'bl.gif" width="1" height="1" border="0" name="pre_'+n+'_anc" id="pre_'+n+'_anc"></td><td align="left" valign="top" nowrap><table width="1"  height="1" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap width=1 onMouseOver="aperto=true;"><table width="100%" border="0" cellspacing="'+bo+'" cellpadding="'+cllp+'" height="1"><tr><td nowrap height=1>'+ctn+'</td></tr></table></td></tr></table></td><td width="1" valign="bottom"><img src="'+cf+'bl.gif" width="1" height="1" border="0" name="post_'+n+'_anc" id="post_'+n+'_anc"></td></tr></table>');
	ImgT=n;
}
function disegna_menu(n,ctn,cof,cob,bo,z,tsp,cllp,BGimg){
	if(NS4){
		f1=cof;
		f2=cob;
		f3=false;
	}else{
		f1=false;
		f2=cof;
		f3=cob;
	}
	document.write(apri_ly(n,f1,z,false,false,false));
	DC(n,ctn,bo,cllp);
	document.write(Cy()+apri_ly(n+'_om',f2,z-1,bo,false,BGimg,tsp,true,f3));
	DC(n+'_om','<img src="'+cf+'bl.gif" border="0" width="1" height="1">',1,0);
	document.write(Cy());
}

document.write(apri_ly('fr_su',false,501));
DC('fr_su','<a href="javascript:ff()" onMouseOver="aperto=true;MM(\'Giu\');" onMouseOut="ferma();"><img src="'+cf+'fr_su2.gif" border="0" width="17" height="16" name="fr_su_i" id="fr_su_i"></a>',false,1,0,false);
document.write(Cy()+apri_ly('fr_giu',false,501));
DC('fr_giu','<a href="javascript:ff()" onMouseOver="aperto=true;MM(\'Su\');" onMouseOut="ferma();"><img src="'+cf+'fr_giu2.gif" border="0" width="17" height="16" name="fr_giu_i" id="fr_giu_i"></a>',false,1,0,false);
document.write(Cy()+apri_ly('sfr_su',false,500,false,false,false,70));
DC('sfr_su','<img src="'+cf+'bl.gif" border="0" width="17" height="16">',false,1,0,false);
document.write(Cy()+apri_ly('sfr_giu',false,500,false,false,false,70));
DC('sfr_giu','<img src="'+cf+'bl.gif" border="0" width="17" height="16">',false,1,0,false);
document.write(Cy());
//document.ondragstart = new Function("return false;");
//document.oncontextmenu = new Function("return false;");

//car=true;
nascondi();
