//Questo menu e' (C)2001 ri.riccardi@agora.stm.it - http://www.jsdir.com - JavaScript Directory

function avviaMenu()
{
	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>Hohhme</I></A></LAYER>");
		for (i=0;i<voci.length;i++)
			{
			var n=i;
			document.writeln("<LAYER NAME=mtop"+n+". position=absolute left="+eval(leftmargin+aggiunta+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>"+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+aggiunta+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>");
			}
		aggiunta=50;
		}
		else
		{
	
		for (i=0;i<voci.length;i++)
			{
			var n=i;
			document.writeln("<DIV ID=mtop"+n+". STYLE=\"position:absolute;left:"+eval(leftmargin+aggiunta+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;"+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+aggiunta+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>");
			}
		aggiunta=50;
		}
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="";
	}

//CODICE AGGIUNTIVO
var isMinNS4=(navigator.appName.indexOf("Netscape")>=0&&parseFloat(navigator.appVersion)>=4)?1:0;
var isMinIE4=(document.all)?1:0;
var isMinIE5=(isMinIE4&&navigator.appVersion.indexOf("5.")>=0)?1:0;


function approfondimenti(form, elemento, link){
	var puntatore = eval('form.' + elemento)
	pos=puntatore.selectedIndex
	if (pos>-1) {
		window.location.href=link+puntatore.options[pos].value
	}
}

function mailIT(subj,obj,url)
{	
	var subjPrefix = "Scheda su www.manuali.it";
	var bodyPrefix = "Ti segnalo " + obj + " all\'indirizzo: ";
	//var bodyFooter = "Omelie.org - Commento alla liturgia domenicale";
	subj = subjPrefix;
	//escape(subjPrefix + subj);
	//var body = escape(bodyPrefix + url + bodyFooter);
	var body = escape(bodyPrefix + url + " da Manuali.it");
	var x = window.open("mailto:?subject=" +subj + "&body=" + body , "mail");
}


function openwinpopupcorsi(url)
{	
	window.open(url, '', 'width=450,height=400,statusbar=no,scrollbars=yes')
}

function openwinpopup(url)
{	
	window.open(url, '', 'width=300,height=300,statusbar=no,scrollbars=no')
}


function openwin(url,w,h,status,scroll)
{	
	window.open(url,'', 'width=' + w + ',height=' + h + ',statusbar=' + status + ',scrollbars=' + scroll + '')
}

function checkblank(form, obj)
{
	var puntatore=eval("document.forms['" + form + "']." + obj);
	 if (puntatore.value=="") {
		alert('Attenzione il campo risulta essere vuoto')}
	else{
	var puntatore=eval("document.forms['" + form + "']");
	puntatore.submit()}
}

function checkemail(form)
{	
	if (form.txt_email.value=="") {
		alert('Attenzione email inserita non corretta')}
	else{
	form.submit()}
}

function checkregistrazione(form)
{
	if ((form.txt_datanata.value=="" || form.txt_residenza.value=="" || form.txt_comune.value=="" || form.txt_provincia.value=="" || form.txt_cap.value=="" || form.txt_email.value=="" || form.txt_userid.value=="" || form.txt_password.value=="" || form.txt_confermapassword.value=="") || (form.cmbsesso.options[form.cmbsesso.selectedIndex].value=="")){
		alert('Attenzione dati inseriti non correttamente')}
	else{
	if (form.txt_confermapassword.value!=form.txt_password.value) {
		alert('Attenzione la password non corrisponde')}
	else{
		form.submit()
		}
	}
}

function SetStatus() {
  window.status="";
  setTimeout("SetStatus()", 2);
}

function checkemail2(emailAddress) { 
 emailAddress=emailAddress 
 if (emailAddress.indexOf ('@',0) == -1 || emailAddress.indexOf ('.',0) == -1) { 
  alert("\nL' E-mail deve contenere \"@\" e uno o pił \".\"") 
  return false; 
 } 
 else
 { 
 return true;
 } 
}

function VerificaFormPartners(form){
	if (form.privacy.checked) {
		if (checkemail2(form.email.value)){
			if ((form.privacy.value=="") || (form.titolo.value=="") || (form.url.value=="http://") || (form.url.value=="")){
				alert("ATTENZIONE: tutti i campi devono essere riempiti");
			}else{
				form.submit();
			}
		}
	}else{
		alert("ATTENZIONE: la mancanza del consenso sulla privacy, no permette la registrazione");
	}
}

window.status="Omelie.org - La liturgia domenicale in rete. Letture, commenti e preghiere";