var ronO="#F7F7F7"; // Colore al MouseOver
var roffO="#E6E6E6"; // Colore di default
var leftmarginO=230; // Distanza dal margine sinistro della pagina ( ---> v. commento alla riga 57)
var topmarginO=50; // Distanza dal margine superiore della pagina
var largoO=142;	// Larghezza dei layers, quindi distanza (orizzontale) fra i sottomenu

var x_coordO=100;// Spostamento dal centro pagina del menu
var d_vertO=0;	// Distanza verticale ma menu intestazione e menu a tendina
var d_orizO=5;	// Distanza orizzontale fra i menu di intestazione
var h_cellaO = 16; // altezza celle del menu a discesa

var HomeO = false; // Settare a "false" se non si desidera il link all'HomeOpage
var HomeOLink = "http://new.unite.it"; // URL della HomeOpage
var HomeOText = "Home Page Università degli Studi di Teramo"; // Testo del link alla HomeOpage
var HomeOWidth = 50; // Larghezza del livello che contiene il tasto alla HomeOpage. (se "HomeO" viene impostato a "false" viene azzerato.

var vociO=new Array();
	vociO[0]=new Array("studenti")
	vociO[1]=new Array("ricerca");
	vociO[2]=new Array("verso le professioni");
	vociO[3]=new Array("ateneo");

var linksO=new Array();
	linksO[0]=new Array("http://193.206.24.248/UniTE/Engine/RAServePG.php/P/25091UTE0905")
	linksO[1]=new Array("http://193.206.24.248/UniTE/Engine/RAServePG.php/P/25081UTE0706")
	linksO[2]=new Array("http://193.206.24.248/UniTE/Engine/RAServePG.php/P/25071UTE0507")
	linksO[3]=new Array("http://193.206.24.248/UniTE/Engine/RAServePG.php/P/25061UTE0604")




var targetsO=new Array();
	targetsO[0]=new Array("self","self","self","self","self","self","self","self","self","self","self")
	targetsO[1]=new Array("self","self","self","self","self")
	targetsO[2]=new Array("self","self","self","self")
	targetsO[3]=new Array("self","self","self","self","self","self","self","self","self")


var wstO=new Array();
	wstO[0]=new Array("studenti","lauree triennali","lauree specialistiche","specializzazioni","master di primo livello","master di secondo livello","master di perfezionamento"," facoltà","centro linguistico","studiare all'estero","C.U.S.");
	wstO[1]=new Array("ricerca","dipartimenti e settori","assegni di ricerca","dottorati di ricerca","bandi e concorsi");
	wstO[2]=new Array("verso le professioni","lavorare con l\'Ateneo","formazione professionale","bandi e concorsi");
	wstO[3]=new Array("ateneo","storia dell'Ateneo","organi universitari","statuto e regolamenti","bandi e concorsi","edilizia","servizi informatici","strutture","associazioni");

var nn=document.layers?true:false,N6=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1?true:false,contaO=0,lastO=0,last=0;
var op=navigator.userAgent.toLowerCase().indexOf("opera")!=-1?true:false
HomeOWidth=HomeO?HomeOWidth:0;
var MenuLength=HomeOWidth+d_orizO+largoO*vociO.length; //modifica guiski
var BrowserWidth=nn||op?window.innerWidth:N6?document.width:document.body.clientWidth;

if (nn)
	{
	if (HomeO)
		document.write("<LAYER NAME=topO. position=absolute left="+leftmarginO+" top="+topmarginO+" width="+HomeOWidth+" height=15 clip=0,0,"+HomeOWidth+",15 bgColor="+roffO+" visibility=visible onMouseOver=showdepsO(lastO,false);mrollO('topO.') onMouseOut=unmrollOO('topO.') CLASS=menuNNb>&nbsp;<A HREF='"+HomeOLink+"' CLASS=menuNNb>"+HomeOText+"</A></LAYER>");
	for (i=0;i<vociO.length;i++)
		{
		var n=i;
		document.writeln("<LAYER NAME=topO"+n+". position=absolute left="+eval(leftmarginO+HomeOWidth+largoO*i+d_orizO*i)+" top="+topmarginO+" width="+largoO+" height=15 clip=0,0,"+largoO+",15 bgColor="+roffO+" visibility=visible onMouseOver=MostraMenuO("+i+");mrollO('topO"+i+".');contaO++ onMouseOut=lastO="+i+";unmrollOO('topO"+i+".');contaO--><DIV ALIGN=left CLASS=menuNNb>&nbsp;<A HREF=javascript:mrollO('topO"+i+".') onClick=vaiO('"+linksO[i][0]+"',"+i+",0) CLASS=menuNNb>"+vociO[i][0]+"</A></DIV></LAYER>");
		for (l=1;l<vociO[i].length;l++)
			document.writeln("<LAYER NAME=depO"+i+"."+l+" position=absolute left="+eval(leftmarginO+HomeOWidth+largoO*i+d_orizO*i)+" top="+eval(topmarginO+d_vertO+h_cellaO*l)+" width="+largoO+" height=15 clip=0,0,"+largoO+",15 bgColor="+roffO+" visibility=hidden onMouseOver=mrollO('depO"+n+"."+l+"');contaO++ onMouseOut=unmrollOO('depO"+n+"."+l+"');contaO--  CLASS=menuNNb>&nbsp;<A HREF=javascript:mrollO('depO"+n+"."+l+"') onClick=vaiO('"+linksO[i][l]+"',"+i+","+l+") CLASS=menuNN>"+vociO[i][l]+"</A></LAYER>");
		}
	}
	else
	{
	if (HomeO)
		document.write("<DIV ID=topO. STYLE=\"position:absolute;left:"+leftmarginO+";top:"+topmarginO+";width:"+HomeOWidth+";height:15;background:"+roffO+";visibility:visible;cursor:hand\" onMouseOver=showdepsO(lastO,false);mrollO('topO.') onMouseOut=unmrollOO('topO.')><A HREF='"+HomeOLink+"' CLASS=menuIEb onFocus=this.blur()>&nbsp;"+HomeOText+"</A></DIV>");
	for (i=0;i<vociO.length;i++)
		{
		var n=i;
		document.writeln("<DIV ID=topO"+n+". STYLE=\"position:absolute;left:"+eval(leftmarginO+HomeOWidth+largoO*i+d_orizO*i)+";top:"+topmarginO+";width:"+largoO+";height:15;background:"+roffO+";visibility:visible;cursor:hand\" onMouseOver=MostraMenuO("+n+");mrollO('topO"+n+".');contaO++ onMouseOut=lastO="+n+";unmrollOO('topO"+n+".');contaO--><DIV ALIGN=left CLASS=menuIEb onClick=vaiO('"+linksO[i][0]+"',"+i+",0)>&nbsp;"+vociO[i][0]+"</DIV></DIV>");
		for (l=1;l<vociO[i].length;l++)
			document.writeln("<DIV ID=depO"+i+"."+l+" STYLE=\"position:absolute;left:"+eval(leftmarginO+HomeOWidth+largoO*i+d_orizO*i)+";top:"+eval(topmarginO+d_vertO+h_cellaO*l)+";width:"+largoO+";height:15;background:"+roffO+";visibility:hidden;cursor:hand\" onMouseOver=;mrollO('depO"+n+"."+l+"');contaO++ onMouseOut=unmrollOO('depO"+n+"."+l+"');contaO-- CLASS=menuIE onClick=vaiO('"+linksO[i][l]+"',"+i+","+l+")>&nbsp;"+vociO[i][l]+"</DIV>");
		}
	}

timer=setInterval("NascondiMenuO()",2000)

function NascondiMenuO()
	{
	if (contaO==0)
		{
		coloratuttiO(true)
		timer=setTimeout("coloratuttiO(false)",200);
		timer=setTimeout("showdepsO(lastO,false)",250);
		}
	}

function coloratuttiO(col)
	{
	colore=col?ronO:roffO;
	for (i=0;i<vociO.length;i++)
		for (j=1;j<vociO[i].length;j++)
			{
		if (nn)
			document.layers["depO"+i+"."+j].bgColor=colore;
		else
			if(document.all)
				document.all["depO"+i+"."+j].style.background=colore;
				else
				document.getElementById('depO'+i+"."+j).style.background=colore;
			}
	}

function MostraMenuO(n)
	{
	showdepsO(last,false);
	showdepsO(n,true);
	last=n;
	}

function showdepsO(n,act)
	{
	if (contaO==0)
		{
		act?statO="visible":statO="hidden";
	if (nn)
		for (i=1;i<vociO[n].length;i++)
			document.layers["depO"+n+"."+i].visibility=statO;
	else
		for (i=1;i<vociO[n].length;i++)
			if(document.all)
				document.all["depO"+n+"."+i].style.visibility=statO;
				else
				document.getElementById('depO'+n+"."+i).style.visibility=statO;
		}
	}

function vaiO(dove,r,c)
	{
	if (c>0)
		lev=nn?document.layers["depO"+r+"."+c]:(document.all)?document.all["depO"+r+"."+c].style:document.getElementById("depO"+r+"."+c).style;
	else
		lev=nn?document.layers["topO"+r+"."]:(document.all)?document.all["topO"+r+"."].style:document.getElementById("topO"+r+".").style;
	if (nn)
		{
		lev.bgColor=roffO;
		timer=setTimeout("lev.bgColor=ronO",50)
		timer=setTimeout("lev.bgColor=roffO",100)
		timer=setTimeout("lev.bgColor=ronO",150)
		timer=setTimeout("lev.bgColor=roffO",200)
		timer=setTimeout("lev.bgColor=ronO",250)
		}
		else
		{
		lev.background=roffO;
		timer=setTimeout("lev.background=ronO",50)
		timer=setTimeout("lev.background=roffO",100)
		timer=setTimeout("lev.background=ronO",150)
		timer=setTimeout("lev.background=roffO",200)
		timer=setTimeout("lev.background=ronO",250)
		}
   	if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1 && navigator.platform.toLowerCase().indexOf("mac")=="mac")
	   document.write("")  
	timer=targetsO[r][c]=="self"?setTimeout("self.location.href='"+dove+"'",350):setTimeout("window.open('"+dove+"')",350);
	}

function mrollO(l)
	{
	LTop="topO"+l.substr(4,l.indexOf(".")-4)+".";
	nn?document.layers[LTop].bgColor=ronO:(document.all)?document.all[LTop].style.background=ronO:document.getElementById(LTop).style.background=ronO;
	nn?document.layers[l].bgColor=ronO:(document.all)?document.all[l].style.background=ronO:document.getElementById(l).style.background=ronO;
	document.getElementById?document.getElementById(l).style.cursor=document.all?'hand':'pointer':'void(0)';
	if (l.substr(0,4)=="depO")
		stringa=wstO[l.substr(4,l.indexOf(".")-4)][l.substring(l.indexOf(".")+1,l.length)];
			else if (l.length>5)
			stringa=wstO[l.substr(4,l.indexOf(".")-4)][0];
				else stringa="HomeO Page";		
	window.status=stringa;
	timer=setTimeout("window.status=stringa",20);
	}

function unmrollOO(l)
	{
	LTop="topO"+l.substr(4,l.indexOf(".")-4)+".";
	nn?document.layers[LTop].bgColor=roffO:(document.all)?document.all[LTop].style.background=roffO:document.getElementById(LTop).style.background=roffO;
	nn?document.layers[l].bgColor=roffO:(document.all)?document.all[l].style.background=roffO:document.getElementById(l).style.background=roffO;
	window.status="";
	}

