/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * Sezione personalizzabile..
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var ron="#800000"; // Colore al MouseOver
var roff="#808080"; // Colore di default
var leftmargin=100; // Distanza dal margine sinistro della pagina
var topmargin=135; // Distanza dal margine superiore della pagina
var largo=110; // Larghezza dei layers, quindi distanza (orizzontale) fra i sottomenu

/* L'array seguente contiene i testi che verranno visualizzati dal menu.
 * 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("Ruins","The history","The origin","The colony","The house","The municipium","The Vesuvius")
	voci[1]=new Array("Way of life","The family","The education","The school","The elections","The commerce","The religion","The souls");
	voci[2]=new Array("Entertainment","The games","The sports","The free time","The eroticism");
	voci[3]=new Array("Visit","Regio I","Regio II","Regio III","Regio IV","Regio V","Regio VI","Regio VII","Regio VIII","Regio IX","The villas","The Forum","The theatres");
	voci[4]=new Array("Gallery","Gallery 1","Gallery 2","Gallery 3","Gallery 4","Gallery 5","Gallery 6","Gallery 7","Gallery 8","Gallery 9","Gallery 10","Gallery 11");
	voci[5]=new Array("Facility","Info","Hotels","Restaurants","Guide","Books","Libraries","Newsletter","ArteCard","Virtual Pompei","Metrņ del Mare","Links","Some news");

/* 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("","storia.htm","origini.htm","colonia.htm","casa.htm","municipio.htm","vesuvio.htm")
	links[1]=new Array("","famiglia.htm","educazione.htm","scuola.htm","elezioni.htm","commercio.htm","religione.htm","morti.htm")
	links[2]=new Array("","giochi.htm","sport.htm","tempo.htm","erotismo.htm")
	links[3]=new Array("","regio1.htm","regio2.htm","regio3.htm","regio4.htm","regio5.htm","regio6.htm","regio7.htm","regio8.htm","regio9.htm","ville.htm","foro.htm","teatri.htm")
	links[4]=new Array("","galleria1.htm","galleria2.htm","galleria3.htm","galleria4.htm","galleria5.htm","galleria6.htm","galleria7.htm","galleria8.htm","galleria9.htm","galleria10.htm","galleria11.htm")
	links[5]=new Array("","info.htm","alberghi.htm","ristoranti.htm","guida.htm","libri.htm","biblioteche.htm","newsletter.htm","card.htm","virtual.htm","metro.htm","link.htm","altrenotizie.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("Archaeological area of Pompeii",
			"From 1628 till today the activity of excavation never stopped, to bring this historical testimony to the light",
			"The origins of the city, from the first Oscan installation, to Greek, Etruscan and finally Roman influence",
			"The advent of the Romans makes Pompeii one of the most famous Roman cities of its time",
			"A photo of the Pompeian house, its structure and the furnishings, in the style of life of the rich Pompeian merchants",
			"The political arrangement in Pompeii, with the Council elected by the populus, that administered the city life",
			"The most famous volcano in the world gives to the landscape of the parthenopean gulf a characteristic shape");
	wst[1]=new Array("A section of the daily life of the ancient Roman city",
			"The inhabitants, with their families and their habits, at the moment of the eruption",
			"The educational system of the Pompeians based on the model of the Roman world",
			"The Pompeian youth could count on Roman and Greek teachers of notable wisdom",
			"The most exciting moment for all the Pompeians, that involved the whole population",
			"Pompeii was famous for its commerces of alimentary products, wine, cloths and other merchandises",
			"The Pompeians revered all the Roman gods, but also some Egyptian and Judaic divinities, and the domestic lares",
			"Numerous are the necropolises found out of the city boundaries");
	wst[2]=new Array("Pompeians love to enjoy in different ways",
			"The games attracted a lot of Pompeians, that were reunited in gaming-den to pratice it",
			"Our ancestors had the cult of the care of the body and the sports; it's testified by the numerous thermal baths",
			"The theatre was alive in the city, and even the gladiatorial shows",
			"The Pompeians lived eroticism without inhibitions and without conditions");
	wst[3]=new Array("Visit to archaeological area",
			"Visit to Regio I",
			"Visit to Regio II",
			"Visit to Regio III",
			"Visit to Regio IV",
			"Visit to Regio V",
			"Visit to Regio VI",
			"Visit to Regio VII",
			"Visit to Regio VIII",
			"Visit to Regio IX",
			"Visit to suburban villas",
			"Visit to the Forum, the heart of the city",
			"Visit to the theatre area");
	wst[4]=new Array("Photo gallery of Pompei Sepolta",
			"Gallery n. 1",
			"Gallery n. 2",
			"Gallery n. 3",
			"Gallery n. 4",
			"Gallery n. 5",
			"Gallery n. 6",
			"Gallery n. 7",
			"Gallery n. 8",
			"Gallery n. 9",
			"Gallery n. 10",
			"Gallery n. 11");
	wst[5]=new Array("Facilities offered by Pompei Sepolta",
			"The way to arrive in Pompeii",
			"Hotels accomodation",
			"Where to taste parthenopean specialities",
			"An easy guide of the archaeological area to download and to consult. In English and in Italian",
			"A rich selections of books on the city and on the archaeological area",
			"Pompeii's Libraries",
			"The newsletter of Pompei Sepolta - Viaggi Italiani",
			"All inclusive museums, archaeological areas and public transport card in Campania",
			"Virtual Pompei - 3Dimensional Pompei Archeopark",
			"Metrņ del Mare - Pompeii by cruise",
			"Useful links",
			"Some news about archaeological area");

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 * 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,N6=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false,conta=0,last=0;
var MenuLength=50+largo*voci.length;
var BrowserWidth=nn?window.innerWidth:N6?document.width:document.body.clientWidth;
leftmargin=parseInt((BrowserWidth-MenuLength)/2);

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='home.html' 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='home.htm' 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[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)
	{
	nn?document.layers[l].bgColor=roff:(document.all)?document.all[l].style.background=roff:document.getElementById(l).style.background=roff;
	window.status="";
	}

