/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * Sezione personalizzabile.
 * Modificare le variabili e gli array seguenti per adattare il menu al propri sito.
 * L'ultima voce di questo menu e' un link a JsDir, se credete potete toglierlo, ma in tal caso vi preghiamo
 * di lasciare il riferimento della riga seguente... dopotutto non l'avete pagato nulla, quindi... che vi costa? :-)
 *
 * Questo menu e' (C)2001 ri.riccardi@agora.stm.it - Lo script e' reperibile al sito http://www.jsdir.com - JavaScript Directory
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var ron="#c00000"; // Colore al MouseOver
var roff="#000000"; // Colore di default
var leftmargin=170; // Distanza dal margine sinistro della pagina
var topmargin=70; // Distanza dal margine superiore della pagina
var largo=125; // Larghezza dei layers, quindi distanza (orizzontale) fra i sottomenu

/* L'array seguente contiene i testi che verranno visualizzati dal menu.
 * Nell'esempio (il menu di JsDir) trovate quattro elementi dell'array "voci" corrispondenti alle quattro voci del menu principale
 * Il primo elemento degli array e' il nome del menu, gli elementi successivi sono i links contenuti nel singolo menu.
 * Il tasto "Home" non compare in questo array perche' viene inserito di default come primo elemento */
var voci=new Array();
	voci[0]=new Array("About me","Curruculun","Strutture","Bibliografia","Altre fonti")
	voci[1]=new Array("Patologie","Dimensione del pene","Eiaculazione","Disturbi sessuali","Varicocele","Andropausa");
	voci[2]=new Array("Impotenza","Disfunzione erettile");
	voci[3]=new Array("Consulenza on line","Fai il test","Consulenza","Inconvenienti  ");

/* Questo array contiene invece i links che saranno aperti dalle singole voci dei sottomenu.
 * Da notare che il primo elemento degli array dev'essere una stringa vuota, infatti corrisponde non ad un link
 * da aprire, ma al titolo del sottomenu, cioe' al primo elemento dell'array "voci" */
var links=new Array();
	links[0]=new Array("","http://www.impotenzaonline.org/curriculum.htm","http://www.impotenzaonline.org/strutture.htm","http://www.impotenzaonline.org/bibliografia.htm","http://www.impotenzaonline.org/bibliografia2.htm","")
	links[1]=new Array("","http://www.impotenzaonline.org/dimensionepene.htm","http://www.impotenzaonline.org/eiaculazione.htm","http://www.impotenzaonline.org/disturbi.htm","http://www.impotenzaonline.org/varicocele.htm","http://www.impotenzaonline.org/andropausa.htm","")
	links[2]=new Array("","http://www.impotenzaonline.org/main_impotenza.htm","/staff/collaboratori.asp","/contatti.asp","/credits.asp")
	links[3]=new Array("","http://www.siam-italy.org/italy/argomenticlinici/disfunzione/default.htm","http://www.impotenzaonline.org/indicazionipagamento.htm","http://www.impotenzaonline.org/modulo/comunicazione.htm")

/* Ultimo array.
 * Contiene i testi che saranno visualizzati nella barra di stato del browser quando il mouse e' sopra una voce del menu 
 * Anche in questo caso il primo elemento degli array contiene il testo relativo alla voce principale dei sottomenu */
var wst=new Array();
	wst[0]=new Array("","","","","","");
	wst[1]=new Array("","","","","","","");
	wst[2]=new Array("","","","","");
	wst[3]=new Array("","","","","","","In questa pagina è possibile inserire i propri commenti");

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * Fine sezione personalizzabile.
 * Le righe che seguono costituiscono il menu vero e proprio.
 * La personalizzazione e' consigliata solo a webmaster un po' esperti di JavaScript.
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var nn=document.layers?true:false,conta=0,last=0;

if (nn)
	{
	document.write("<LAYER NAME=mtop position=absolute left="+leftmargin+" top="+topmargin+" width=50 height=15 clip=0,0,50,15 bgColor="+roff+" visibility=visible onMouseOver=showdeps(last,false);mroll('mtop') onMouseOut=unmroll('mtop')>&nbsp;<A HREF=/ CLASS=menuNNb><I>Home</I></A></LAYER>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<LAYER NAME=mtop"+n+" position=absolute left="+eval(leftmargin+50+largo*i)+" top="+topmargin+" width="+largo+" height=15 clip=0,0,"+largo+",15 bgColor="+roff+" visibility=visible onMouseOver=MostraMenu("+i+");mroll('mtop"+i+"');conta++ onMouseOut=last="+i+";unmroll('mtop"+i+"');conta--><DIV ALIGN=center>&nbsp;<A HREF=javascript:mroll('mtop"+i+"') CLASS=menuNNb><I>"+voci[i][0]+"</I></A></DIV></LAYER>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<LAYER NAME=mdep"+i+""+l+" position=absolute left="+eval(leftmargin+50+largo*i)+" top="+eval(topmargin+15*l)+" width="+largo+" height=15 clip=0,0,"+largo+",15 bgColor="+roff+" visibility=hidden onMouseOver=mroll('mdep"+n+""+l+"');conta++ onMouseOut=unmroll('mdep"+n+""+l+"');conta-->&nbsp;<A HREF=javascript:mroll('mdep"+n+""+l+"') onClick=vai('"+links[i][l]+"',"+i+","+l+") CLASS=menuNN>"+voci[i][l]+"</A></LAYER>");
		}
	}
	else
	{
	document.write("<DIV ID=mtop STYLE=\"position:absolute;left:"+leftmargin+";top:"+topmargin+";width:50;height:15;background:"+roff+";visibility:visible;cursor:hand\" onMouseOver=showdeps(last,false);mroll('mtop') onMouseOut=unmroll('mtop')><A HREF='/' CLASS=menuIEb onFocus=this.blur()>&nbsp;<I>Home</I></A></DIV>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<DIV ID=mtop"+n+" STYLE=\"position:absolute;left:"+eval(leftmargin+50+largo*i)+";top:"+topmargin+";width:"+largo+";height:15;background:"+roff+";visibility:visible;cursor:hand\" onMouseOver=MostraMenu("+n+");mroll('mtop"+n+"');conta++ onMouseOut=last="+n+";unmroll('mtop"+n+"');conta--><DIV ALIGN=center CLASS=menuIEb>&nbsp;<I>"+voci[i][0]+"</I></DIV></DIV>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<DIV ID=mdep"+i+""+l+" STYLE=\"position:absolute;left:"+eval(leftmargin+50+largo*i)+";top:"+eval(topmargin+15*l)+";width:"+largo+";height:15;background:"+roff+";visibility:hidden;cursor:hand\" onMouseOver=;mroll('mdep"+n+""+l+"');conta++ onMouseOut=unmroll('mdep"+n+""+l+"');conta-- CLASS=menuIE onClick=vai('"+links[i][l]+"',"+i+","+l+")>&nbsp;"+voci[i][l]+"</DIV>");
		}
	}

timer=setInterval("NascondiMenu()",1000)

function NascondiMenu()
	{
	if (conta==0)
		{
		coloratutti(true)
		timer=setTimeout("coloratutti(false)",200);
		timer=setTimeout("showdeps(last,false)",250);
		}
	}

function coloratutti(col)
	{
	colore=col?ron:roff;
	for (i=0;i<voci.length;i++)
		for (j=1;j<voci[i].length;j++)
			{
		if (nn)
			document.layers["mdep"+i+j].bgColor=colore;
		else
			if(document.all)
				document.all["mdep"+i+j].style.background=colore;
				else
				document.getElementById('mdep'+i+j).style.background=colore;
			}
	}

function MostraMenu(n)
	{
	showdeps(last,false);
	showdeps(n,true);
	last=n;
	}

function showdeps(n,act)
	{
	if (conta==0)
		{
		act?stat="visible":stat="hidden";
	if (nn)
		for (i=1;i<voci[n].length;i++)
			document.layers["mdep"+n+i].visibility=stat;
	else
		for (i=1;i<voci[n].length;i++)
			if(document.all)
				document.all["mdep"+n+i].style.visibility=stat;
				else
				document.getElementById('mdep'+n+i).style.visibility=stat;
		}
	}


function vai(dove,r,c)
	{
	lev=nn?document.layers["mdep"+r+c]:(document.all)?document.all["mdep"+r+c].style:document.getElementById("mdep"+r+c).style;
	if (nn)
		{
		lev.bgColor=roff;
		timer=setTimeout("lev.bgColor=ron",50)
		timer=setTimeout("lev.bgColor=roff",100)
		timer=setTimeout("lev.bgColor=ron",150)
		timer=setTimeout("lev.bgColor=roff",200)
		timer=setTimeout("lev.bgColor=ron",250)
		}
		else
		{
		lev.background=roff;
		timer=setTimeout("lev.background=ron",50)
		timer=setTimeout("lev.background=roff",100)
		timer=setTimeout("lev.background=ron",150)
		timer=setTimeout("lev.background=roff",200)
		timer=setTimeout("lev.background=ron",250)
		}
	timer=setTimeout("self.location.href='"+dove+"'",350)
	}

function mroll(l)
	{
	nn?document.layers[l].bgColor=ron:(document.all)?document.all[l].style.background=ron:document.getElementById(l).style.background=ron;
	document.getElementById?document.getElementById(l).style.cursor=document.all?'hand':'pointer':'void(0)';
	if (l.substr(0,4)=="mdep")
		stringa=wst[parseInt(l.substr(4,1))][parseInt(l.substr(5,1))];
			else if (l.length>4)
			stringa=wst[parseInt(l.substr(4))][0];
				else stringa="Home page impotenza";		
	window.status=stringa;
	timer=setTimeout("window.status=stringa",20);
	}

function unmroll(l)
	{
	nn?document.layers[l].bgColor=roff:(document.all)?document.all[l].style.background=roff:document.getElementById(l).style.background=roff;
	window.status="";
	}
