var ron="#F3EE6D";
var roff="none";
var leftmargin=0;
var topmargin=0;
var largo=110;

var Home = false;
var HomeLink = "/";
var HomeText = "Home";
var HomeWidth = 50;

var voci=new Array();
	voci[0]=new Array('<img src="images/azienda.gif">','<img src="images/profilo.gif">','<img src="images/dove.gif">','<img src="images/contatti.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');
	voci[1]=new Array('<img src="images/produzione.gif">','<img src="images/fill.gif">','<img src="images/settori.gif">','<img src="images/materiali.gif">','<img src="images/tecnologia.gif">','<img src="images/gallery.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');
	voci[2]=new Array('<img src="images/servizi.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/galvanici.gif">','<img src="images/verniciatura.gif">','<img src="images/termici.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');
	voci[3]=new Array('<img src="images/qualita.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/iso.gif">','<img src="images/strumenti.gif">','<img src="images/identificazione.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');
	voci[4]=new Array('<img src="images/download.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/screensaver.gif">','<img src="images/immagini.gif">','<img src="images/biglietto.gif">','<img src="images/brochure.gif">');
	voci[5]=new Array('<img src="images/lavora.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');
	voci[6]=new Array('<img src="images/links.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">','<img src="images/fill.gif">');

var links=new Array();
	links[0]=new Array("#","profilo.html","dove.html","contatti.html");
	links[1]=new Array("#","#","settori.html","materiali.html","tecnologia.html","gallery.html");
	links[2]=new Array("#","#","#","galvanici.html","verniciatura.html","termici.html");
	links[3]=new Array("#","#","#","#","iso.html","strumenti.html","identificazione.html");
	links[4]=new Array("#","#","#","#","#","screensaver.html","immagini.html","biglietto.html","brochure.html");
	links[5]=new Array("lavora.html");
	links[6]=new Array("links.html");

var targets=new Array();
	targets[0]=new Array("self","self","self","self");
	targets[1]=new Array("self","self","self","self","self","self");
	targets[2]=new Array("self","self","self","self","self","self");
	targets[3]=new Array("self","self","self","self","self","self","self");
	targets[4]=new Array("self","self","self","self","self","self","self","self","self");
	targets[5]=new Array("self");
	targets[6]=new Array("self");

var wst=new Array();
	wst[0]=new Array("La Nostra Azienda","Il Profilo della Nostra Azienda","Dove e Come Trovarci","Preventivo On Line");
	wst[1]=new Array("I Nostri Prodotti"," ","Settori di Competenza","Elenco Delle  Materie Prime","Macchinari","Foto Gallery di Alcuni dei Nostri Prodotti");
	wst[2]=new Array("Servizi della Nostra Azienda"," "," ","Trattamenti Galvanici","Verniciatura","Trattamenti Termici");
	wst[3]=new Array("Qualita'"," "," "," ","Politica per la Qualita'","Strumenti","Identificazione e rintracciabilita' dei Prodotti");
	wst[4]=new Array("Scarica Files - Screensavers - Immagini di Scrivania - Biglietti da Visita - Brochure"," "," "," "," ","Screensaver Originale OMCM","Immagini di Scrivania per una Resoluzione di 1024x768","Biglietto da Visita Stampabile della Nostra Azienda","Brochure Formato PDF Stampabile della Nostra Azienda");
	wst[5]=new Array("Lavora con noi");
	wst[6]=new Array("Perche' non visitare anche questi siti?");

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
var MenuLength=50+largo*voci.length;
var BrowserWidth=nn||op?window.innerWidth:N6?document.width:document.body.clientWidth;
// leftmargin=parseInt((BrowserWidth-MenuLength)/2);
HomeWidth=Home?HomeWidth:0;

	
if (nn)
	{
	if (Home)
		document.write("<LAYER NAME=mtop. position=absolute left="+leftmargin+" top="+topmargin+" width=50 height=30 clip=0,0,50,30 bgColor="+roff+" visibility=visible onMouseOver=showdeps(last,false);mroll('mtop.') onMouseOut=unmroll('mtop.') CLASS=piccolo>&nbsp;<A HREF='"+HomeLink+"' CLASS=piccolo>"+HomeText+"</A></LAYER>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<LAYER NAME=mtop"+n+". position=absolute left="+eval(leftmargin+HomeWidth+largo*i)+" top="+topmargin+" width="+largo+" height=30 clip=0,0,"+largo+",30 bgColor="+roff+" visibility=visible onMouseOver=MostraMenu("+i+");mroll('mtop"+i+".');conta++ onMouseOut=last="+i+";unmroll('mtop"+i+".');conta--><DIV ALIGN=center CLASS=piccolo><A HREF=javascript:mroll('mtop"+i+".') onClick=vai('"+links[i][0]+"',"+i+",0) CLASS=piccolo>"+voci[i][0]+"</A></DIV></LAYER>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<LAYER NAME=mdep"+i+"."+l+" position=absolute left="+eval(leftmargin+largo*(l-1))+" top="+eval(topmargin+30)+" width="+largo+" height=30 clip=0,0,"+largo+",30 bgColor="+roff+" visibility=hidden onMouseOver=mroll('mdep"+n+"."+l+"');conta++ onMouseOut=unmroll('mdep"+n+"."+l+"');conta-- CLASS=piccolo><A HREF=javascript:mroll('mdep"+n+"."+l+"') onClick=vai('"+links[i][l]+"',"+i+","+l+") CLASS=piccolo>"+voci[i][l]+"</A></LAYER>");
		}
	}
	else
	{
	if (Home)
		document.write("<div id='mtop.' style=\"position:absolute;left:"+leftmargin+"px;top:"+topmargin+"px;width:50px;height:30px;background:"+roff+";visibility:visible;cursor:hand;\" onmouseover=\"showdeps(last,false);mroll('mtop.');\" onmouseout=\"unmroll('mtop.');\"><div class='../menuIEb'><a href='"+HomeLink+"' class='piccolo' onfocus='this.blur();'>"+HomeText+"</a></div></div>");
	for (i=0;i<voci.length;i++)
		{
		var n=i;
		document.writeln("<div id='mtop"+n+".' style=\"position:absolute;left:"+eval(leftmargin+HomeWidth+largo*i)+"px;top:"+topmargin+"px;width:"+largo+"px;height:30px;background:"+roff+";visibility:visible;cursor:hand;\" onmouseover=\"MostraMenu("+n+");mroll('mtop"+n+".');conta++;\" onmouseout=\"last="+n+";unmroll('mtop"+n+".');conta--;\"><div class='piccolo' onclick=\"vai('"+links[i][0]+"',"+i+",0);\">"+voci[i][0]+"</div></div>");
		for (l=1;l<voci[i].length;l++)
			document.writeln("<div id='mdep"+i+"."+l+"' style=\"position:absolute;left:"+eval(leftmargin+largo*(l-1))+"px;top:"+eval(topmargin+30)+"px;width:"+largo+"px;height:30px;background:"+roff+";visibility:hidden;cursor:hand;\" onmouseover=\"mroll('mdep"+n+"."+l+"');conta++;\" onmouseout=\"unmroll('mdep"+n+"."+l+"');conta--;\" class='piccolo' onclick=\"vai('"+links[i][l]+"',"+i+","+l+");\">"+voci[i][l]+"</div>");
		}
	}

timer=setInterval("NascondiMenu()",1000)

function NascondiMenu()
	{
	if (conta==0)
		{
		coloratutti(false)
		timer=setTimeout("coloratutti(false)",0);
		timer=setTimeout("showdeps(last,false)",0);
		}
	}

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):targets[r][c]=="new"?setTimeout("window.open('"+dove+"')",350):setTimeout("window.open('"+dove+"','','"+targets[r][c]+"')",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="";
	}

onresize=function() {self.location.reload()};
