var paolo ='Essere Chiesa-Studi e Ricerche Bibliche a cura di Paolo Di Luca, evangelista della Chiesa di Cristo';
defaultStatus = paolo;

var annocopy = "2006";

function indirizzi (pagina){
	 //var indirizzo = "http://digilander.iol.it/esserechiesa/";
	 //var indirizzo = "../Essere Chiesa 2/";
	 var indirizzo = "./";
	 var vai = indirizzo + pagina;
	 document.location.href=vai;

}

function isEmpty(str) {
	    for (var intLoop = 0; intLoop<str.length; intLoop++)
	       if (" " != str.charAt(intLoop))
		  return false;
	    return true;
	 }

function checkSfondo(f) {
	    for (var intLoop = 0; intLoop<f.elements.length; intLoop++)
	       if ("Sfondo"==f.elements[intLoop].className) {
		  alert("All red fields are required.");
		  return false;
	       }
	 }

function fixUp(el) {
	    el.className = isEmpty(el.value) ? "sfondo" : "";
	 }

function checkChar(el) {
	    if (32 != event.keyCode)
	       el.className = "";
	 }

function titolare(){
	trattadati=window.open("","Responsabili","width=250,height=230,status=0,toolbar=0,menubar=0");
	trattadati.document.write("<html><head>");
	trattadati.document.write("<title>Responsabili</title>");
	trattadati.document.write("</head><body bgcolor=green>");
	trattadati.document.write("<font face='arial' color='yellow' size=3><u>Titolari del trattamento\:</u><br><br>");
	trattadati.document.write("<b><u>Paolo Di Luca & Giuseppe Celant</u></b><br>");
	trattadati.document.write("<!--Casella Postale<br>");
	trattadati.document.write("Prata<br>-->");
	trattadati.document.write("<a href='mailto:info@esserechiesa.org'> Scrivi</a><br><br></font>");
	trattadati.document.write("<center><input type='button' value='Chiudi' onClick='window.close()'></center><br>")
	trattadati.document.write("</body></html>");
}

function controllaForm(form) 
	{
	foundError = false;
	nessuno = false;
	
	if(isFieldBlank(form.Nick)) 
	  {
	  alert("Il campo Nickname non e\' compilato!");
	    foundError = true;
	}
	if(!foundError && isFieldBlank(form.Cognome)) 
	  {
	  alert("Il campo Cognome non e\' compilato!");
	    foundError = true;
	}
	if(!foundError && isFieldBlank(form.Nome)) 
	  {
	  alert("Il campo Nome non e\' compilato!");
	    foundError = true;
	}
	if(!foundError && isFieldBlank(form.Indirizzo)) 
	  {
	  alert("Il campo Indirizzo non e\' compilato!");
	    foundError = true;
	}
	if(!foundError && isFieldBlank(form.Cap)) 
	  {
	  alert("Il campo CAP non e\' compilato!");
	    foundError = true;
	}
	
	if(!foundError && isFieldBlank(form.Citta)) 
	  {
	  alert("Il campo Citta\' non e\' compilato!");
	    foundError = true;
	}
	if(!foundError && isFieldBlank(form.Prov)) 
	  {
	  alert("Il campo Provincia non e\' compilato!");
		foundError = true;
	}
	if(!foundError && isFieldBlank(form.Email)) 
	  {
	    alert("E-mail non specificata!");
	    foundError = true;
	}
	if(!foundError && !isValidEmail(form.Email)) 
	  {
	    alert("Indirizzo E-mail non valido!");
	    foundError = true;
	}
	if(!foundError)
	  {
		nessuno=(form.servizi[0].checked ||
			form.servizi[1].checked ||
			form.servizi[2].checked) &&
			(form.materiali[0].checked ||
			form.materiali[1].checked);
		if(!nessuno)
		{
			alert("Servizi e/o Materiali:\nAttivate un servizio o\nRispondete alla domanda, prego!");
			foundError=true;
		}
	  }
	if(!foundError) {
		alert("Grazie per esservi iscritti ai servizi Essere Chiesa");
		document.registro.action = "http://digiland.libero.it/servlet/formmail";
                document.registro.submit()
		return true;
	}

	return false;
    }

	// Attenzione ai campi vuoti
    function isFieldBlank(theField) 
    {
	if(theField.value == "")
	    return true;
	else
	    return false;
    }
    // Controlla indirizzo email valido cio� che contenga il simbolo "@"
    function isValidEmail(theField) 
    {
		var primo=theField.value.indexOf('@',0);
		var ultimo=theField.value.length;
		if (primo==-1)
			return false;
		if(theField.value.lastIndexOf('@')>primo)
			return false;
		if(theField.value.indexOf(',',0) != -1)
			return false;
		if(theField.value.indexOf(' ',0) != -1)
			return false;
		if(theField.value.substring(ultimo-1,ultimo)==".")
			return false;
		return true;
    }

function diritti(chi){
	 var diretti;
	 if (chi == "EC"){diretti="Essere Chiesa, " + "2000 - " + annocopy +  " &copy\; Diritti Riservati";return diretti}
	 if (chi == "eo"){diretti="Mark A\. Copeland " + annocopy;return diretti}
	 if (chi == "pk"){diretti="Essere Chiesa, " + "2001 - " + annocopy +  " &copy\; Diritti Riservati";return diretti}
	 if (chi == "pkusa"){diretti="Essere Chiesa, " + "2001 - " + annocopy +  " &copy\; Reserved Rights";return diretti}	 
}

function giornata() {
	oggi = new Date()
	giorno = oggi.getDate()
	mese=oggi.getMonth()
	anno=oggi.getYear()
	giorno2=oggi.getDay()
	if (giorno2==1){giorno2="Luned&igrave\;"}
	if (giorno2==2){giorno2="Marted&igrave\;"}
	if (giorno2==3){giorno2="Mercoled&igrave\;"}
	if (giorno2==4){giorno2="Gioved&igrave\;"}
	if (giorno2==5){giorno2="Venerd&igrave\;"}
	if (giorno2==6){giorno2="Sabato"}
	if (giorno2==0){giorno2="Domenica"}

	for (i=1;i<=9;i++){
		if (giorno==i){giorno1=" "+giorno}
		else {giorno1=giorno}
	}
	mese=mese+1
	if (mese==1) {mese1="gennaio"}
	if (mese==2) {mese1="febbraio"}
	if (mese==3) {mese1="marzo"}
	if (mese==4) {mese1="aprile"}
	if (mese==5) {mese1="maggio"}
	if (mese==6) {mese1="giugno"}
	if (mese==7) {mese1="luglio"}
	if (mese==8) {mese1="agosto"}
	if (mese==9) {mese1="settembre"}
	if (mese==10) {mese1="ottobre"}
	if (mese==11) {mese1="novembre"}
	if (mese==12) {mese1="dicembre"}
	if (anno < 2000)(anno = (1900 + anno))
	esatto= giorno1+" "+mese1+" "+anno
	document.writeln(giorno2.fontcolor("#FFFF00"));
	document.write(esatto.fontcolor("#FFFF00"));
	verso=	mese1 + giorno1 +".html";
  }
  function statistica(){
		document.write('<!--Inizio Codice Statistiche.ws --><script type="text/javascript" language="JavaScript"  src="http://www.statistiche.ws/logo.asp?utente=1654"></script><!--fine Codice Statistiche.ws -->')
	}
