
var ron="#1D8391"; // Colore al MouseOver

var roff="#000000"; // Colore di default

var leftmargin=0; // Distanza dal margine sinistro della pagina ( ---> v. commento alla riga 57)

var topmargin=68; // Distanza dal margine superiore della pagina

var largo=127; // Larghezza dei layers, quindi distanza (orizzontale) fra i menu (principali)

var larghsottomenu=200; // Larghezza dei layers, quindi distanza (orizzontale) fra i sottomenu



var Home = true; // Settare a "false" se non si desidera il link all'homepage

var HomeLink = "/cgi-bin/home.cgi?PageNo=1"; // URL della homepage

var HomeText = "&nbsp;&nbsp;&nbsp;&nbsp;Home"; // Testo del link alla homepage

var HomeWidth = 80; // Larghezza del livello che contiene il tasto alla homepage. (se "Home" viene impostato a "false" viene azzerato.



// Larghezza dei layers, quindi distanza (orizzontale) fra i menu (principali, prima riga)

var largo=new Array();

largo[0]=100;

largo[1]=100;

largo[2]=140;

largo[3]=100;

largo[4]=90;

largo[5]=120;

largo[6]=200;



// Larghezza dei layers, quindi distanza (orizzontale) fra i sottomenu

var larghsottomenu=new Array();

larghsottomenu[0]=170;

larghsottomenu[1]=240;

larghsottomenu[2]=200;

larghsottomenu[3]=150;

larghsottomenu[4]=130;

larghsottomenu[5]=160;

larghsottomenu[6]=200;



var leftlargo=new Array();

leftlargo[0]=0;

leftlargo[1]=leftlargo[0]+largo[0];

leftlargo[2]=leftlargo[1]+largo[1];

leftlargo[3]=leftlargo[2]+largo[2];

leftlargo[4]=leftlargo[3]+largo[3];

leftlargo[5]=leftlargo[4]+largo[4];

leftlargo[6]=leftlargo[5]+largo[5];



/* 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("L'azienda&nbsp;&nbsp;&nbsp;&nbsp;","Persone/Presentazione","Dove siamo","Contatti/Supporto","","I nostri clienti","","FAQ","Opportunitą lavorative","Mappa del sito");

	voci[1]=new Array("Prodotti&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","Computer grafica 3D","Visual F/X - compositing","Visualizzazione scientifica","Simulazione","Videogames","Illustrazioni 2D/3D","Progetti grafici/Logo","","Cartoons/Disegni animati","Comics/Fumetti","","Sviluppo software/Multimedia CD-ROM","Installazioni museali","","Web design","Streaming/Dirette web","","Composizioni musicali/Jingles/Effetti sonori","","Didattica/Scuole");

	voci[2]=new Array("Servizi gratuiti&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","Annunci/Mercatino","Cartoline/Biglietti virtuali","Newsletter/Mailing list","Webmail","Blog","Games online","Downloads","","News/Giornali","Borse/Valute","Meteo","Televisioni","Radio","Info voli/Viaggi","Pagine bianche/Pagine gialle","Google News Italia");

	voci[3]=new Array("Negozio&nbsp;&nbsp;&nbsp;&nbsp;","Online shop","Libri consigliati","Spazio banner");

	voci[4]=new Array("Teatro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","Video showreel","Galleria immagini");

	voci[5]=new Array("Archivio&nbsp;news&nbsp;&nbsp;&nbsp;&nbsp;","Company news","News generali");

	voci[6]=new Array("Links&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");



/* Questo array contiene invece i links che saranno aperti dalle singole voci dei sottomenu.

 * In questa nuova versione del menu e' possibile specificare un link anche per la voce principale del menu */

var links=new Array();

	links[0]=new Array("#","/persone.html","/dovesiamo.html","/contatti.html","#","/clienti.html","#","/faq.html","/lavoro.html","/mappasito.html")

	links[1]=new Array("#","/grafica3d.html","/effetti.html","/viscientifica.html","/simulazione.html","/videogames.html","/illustrazioni.html","/progettigrafici.html","#","/cartoons.html","/fumetti.html","#","/software.html","/musei.html","#","/webdesign.html","/streaming.html","#","/musica.html","#","/didattica.html")

	links[2]=new Array("#","/annunci.html","/cartoline.html","/newsletter.html","/webmail.html","/forum.html","/gamesonline.html","/downloads.html","#","/info/ita/giornali.html","/info/ita/markets.html","/info/ita/tempo.html","/info/ita/tv.html","/info/ita/radio.html","/info/ita/voli.html","http://www.paginebianche.it","http://news.google.it")

	links[3]=new Array("#","/onlineshop.html","/amazon.html","/banner.html")

	links[4]=new Array("#","/showreel.html","/galleria.html")

	links[5]=new Array("#","/cgi-bin/news/listanews.cgi?PageNo=1","/cgi-bin/news2/listanews.cgi?PageNo=1")

	links[6]=new Array("/links.html")



/* Questo array contiene i target dei links

 * E' possibile scegliere fra "self" e "new" (o qualsiasi altro valore)

 * "self" aprira' il link nella stessa finestra d'origine, "new" o qualsiasi altro valore aprira' una nuova finestra del browser

 * come un TARGET="_new" messo in un normale link A 

 * - - - - - - - - - - - - - - - - -

 * In una prossima revisione del menu sara' possibile aprire anche delle pop-up */

var targets=new Array();

	targets[0]=new Array("self","self","self","self","self","self","self","self","self","self")

	targets[1]=new Array("self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self","self")

	targets[2]=new Array("self","self","self","self","self","self","self","self","self","new","new","new","new","new","new","new","new")

	targets[3]=new Array("self","self","self","self")

	targets[4]=new Array("self","self","self")

	targets[5]=new Array("self","self","self")

	targets[6]=new Array("self")



/* Ultimo array.

 * Contiene i testi che saranno visualizzati nella barra di stato del browser quando il mouse e' sopra una voce del menu  */

var wst=new Array();

	wst[0]=new Array("L'azienda","Persone","Dove siamo","Contatti","","I nostri clienti","","FAQ","Opportunitą lavorative","Mappa del sito");

	wst[1]=new Array("La nostra offerta","Computer grafica 3D","Visual F/X - compositing","Visualizzazione scientifica","Simulazione","Videogames","Illustrazioni 2D/3D","Progetti grafici/Logo","","Cartoons/Disegni animati","Comics/Fumetti","","Sviluppo software/Multimedia CD-ROM","Installazioni museali","","Web design","Streaming/Dirette web","","Composizioni musicali/Jingles/Effetti sonori","","Didattica/Scuole");

	wst[2]=new Array("Servizi gratuiti","Annunci/Mercatino","Cartoline/Biglietti virtuali","Newsletter/Mailing list","Webmail","Blog","Games online","Downloads","","News/Giornali","Borse/Valute","Meteo","Televisioni","Radio","Info voli/Viaggi","Pagine bianche/Pagine gialle","Google News Italia");

	wst[3]=new Array("Negozio","Online shop","Libri consigliati","Spazio banner");

	wst[4]=new Array("Teatro","Video showreel","Galleria immagini");

	wst[5]=new Array("Archivio&nbsp;news","Archivio news aziendali, aggiornamenti e notizie sulla Pixel Cartoon","Archivio news generali di Informatica, Computer Grafica 2D/3D, animazione, cartoon, fumetto, telefonia ecc.");

	wst[6]=new Array("Links");



/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

 * 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, ad eccezione della riga evidenziata

 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

var nn=document.layers?true:false,N6=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false,conta=0,last=0;

var op=navigator.userAgent.toLowerCase().indexOf("opera")!=-1?true:false

HomeWidth=Home?HomeWidth:0;

var MenuLength=HomeWidth+largo*voci.length;

var BrowserWidth=nn||op?window.innerWidth:N6?document.width:document.body.clientWidth;

//leftmargin=parseInt((BrowserWidth-MenuLength)/2); // Commentare questa riga con // all'inizio se non si desidera i menu al centro della pagina, bensi' nella posizione definita in "leftmargin"



if (nn)

	{

	if (Home)

		document.write("<LAYER NAME=mtop. position=absolute z-index:3 left="+leftmargin+" top="+topmargin+" width="+HomeWidth+" height=15 clip=0,0,"+HomeWidth+",15 bgColor="+roff+" visibility=visible onMouseOver=showdeps(last,false);mroll('mtop.') onMouseOut=unmroll('mtop.') CLASS=menuNNb>&nbsp;<A HREF='"+HomeLink+"' CLASS=menuNNb>"+HomeText+"</A></LAYER>");

	for (i=0;i<voci.length;i++)

		{

		var n=i;

		document.writeln("<LAYER NAME=mtop"+n+". position=absolute z-index:3 left="+eval(leftmargin+HomeWidth+leftlargo[i])+" top="+topmargin+" width="+largo[i]+" 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 CLASS=menuNNb>&nbsp;<A HREF=javascript:mroll('mtop"+i+".') onClick=vai('"+links[i][0]+"',"+i+",0) CLASS=menuNNb>"+voci[i][0]+"</A></DIV></LAYER>");

		for (l=1;l<voci[i].length;l++)

			document.writeln("<LAYER NAME=mdep"+i+"."+l+" position=absolute z-index:3 left="+eval(leftmargin+HomeWidth+leftlargo[i])+" top="+eval(topmargin+15*l)+" width="+larghsottomenu[i]+" height=15 clip=0,0,"+largo[i]+",15 bgColor="+roff+" visibility=hidden onMouseOver=mroll('mdep"+n+"."+l+"');conta++ onMouseOut=unmroll('mdep"+n+"."+l+"');conta--  CLASS=menuNNb>&nbsp;<A HREF=javascript:mroll('mdep"+n+"."+l+"') onClick=vai('"+links[i][l]+"',"+i+","+l+") CLASS=menuNN>"+voci[i][l]+"</A></LAYER>");

		}

	}

	else

	{

	if (Home)

		document.write("<DIV ID=mtop. STYLE=\"position:absolute;z-index:3;left:"+leftmargin+";top:"+topmargin+";width:"+HomeWidth+";height:15;background:"+roff+";visibility:visible;cursor:hand\" onMouseOver=showdeps(last,false);mroll('mtop.') onMouseOut=unmroll('mtop.')><A HREF='"+HomeLink+"' CLASS=menuIEb onFocus=this.blur()>&nbsp;"+HomeText+"</A></DIV>");

	for (i=0;i<voci.length;i++)

		{

		var n=i;

		document.writeln("<DIV ID=mtop"+n+". STYLE=\"position:absolute;z-index:3;left:"+eval(leftmargin+HomeWidth+leftlargo[i])+";top:"+topmargin+";width:largo[i];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 onClick=vai('"+links[i][0]+"',"+i+",0)>&nbsp;&nbsp;&nbsp;&nbsp;"+voci[i][0]+"&nbsp;&nbsp;&nbsp;&nbsp;"+"</DIV></DIV>");

		for (l=1;l<voci[i].length;l++)

			document.writeln("<DIV ID=mdep"+i+"."+l+" STYLE=\"position:absolute;z-index:3;left:"+eval(leftmargin+HomeWidth+leftlargo[i])+";top:"+eval(topmargin+15*l)+";width:"+larghsottomenu[i]+";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)

	{

	if (c>0)

		lev=nn?document.layers["mdep"+r+"."+c]:(document.all)?document.all["mdep"+r+"."+c].style:document.getElementById("mdep"+r+"."+c).style;

	else

		lev=nn?document.layers["mtop"+r+"."]:(document.all)?document.all["mtop"+r+"."].style:document.getElementById("mtop"+r+".").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)

		}

   	if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1 && navigator.platform.toLowerCase().indexOf("mac")=="mac")

	   document.write("")  

	timer=targets[r][c]=="self"?setTimeout("self.location.href='"+dove+"'",350):setTimeout("window.open('"+dove+"')",350);

	}



function mroll(l)

	{

	LTop="mtop"+l.substr(4,l.indexOf(".")-4)+".";

	nn?document.layers[LTop].bgColor=ron:(document.all)?document.all[LTop].style.background=ron:document.getElementById(LTop).style.background=ron;

	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[l.substr(4,l.indexOf(".")-4)][l.substring(l.indexOf(".")+1,l.length)];

			else if (l.length>5)

			stringa=wst[l.substr(4,l.indexOf(".")-4)][0];

				else stringa="Home Page";		

	window.status=stringa;

	timer=setTimeout("window.status=stringa",20);

	}



function unmroll(l)

	{

	LTop="mtop"+l.substr(4,l.indexOf(".")-4)+".";

	nn?document.layers[LTop].bgColor=roff:(document.all)?document.all[LTop].style.background=roff:document.getElementById(LTop).style.background=roff;

	nn?document.layers[l].bgColor=roff:(document.all)?document.all[l].style.background=roff:document.getElementById(l).style.background=roff;

	window.status="";

	}