function controlla()
{
	var 
		Nome = document.contatti.nome.value,
		Cognome = document.contatti.cognome.value,
		Email = document.contatti.email.value,
		Testo = document.contatti.testo.value,
		
		email_reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		
	if(Nome == "" || Nome == null)
	{
		alert("Il campo nome &egrave; obbligatorio");
		document.contatti.nome.focus();
		return false;
	}
	else if(Cognome == "" || Cognome == null)
	{
		alert("Il campo cognome e' obbligatorio");
		document.contatti.cognome.focus();
		return false;
	}
	else if(Email == "" || Email == null)
	{
		alert("Il campo email e' obbligatorio");
		document.contatti.email.focus();
		return false;
	}
	else if(Testo == "" || Testo == null)
	{
		alert("Il campo testo e' obbligatorio");
		document.contatti.testo.focus();
		return false;
	}
	if (!email_reg.test(Email)) 
	{
	    alert("L'indirizzo email inserito non e' corretto");
	    document.contatti.email.select();
	    return false;
	}
	else
		return true;
	return false;
}

function controlla_pre()
{
	var f = document.pre;
	
	var
		c1 = f.ragione.value,
		c2 = f.iva.value,
		c3 = f.indirizzo.value,
		c4 = f.numero.value,
		c5 = f.citta.value,
		c6 = f.provincia.value,
		c7 = f.cap.value,
		c88 = f.nazione.value,
		c8 = f.paese.value,
		c9 = f.telefono.value,
		c10 = f.fax.value,
		c11 = f.mail.value,
		c12 = f.nome.value,
		c13 = f.cognome.value,
		c14 = f.mail_ref.value,
		c15 = f.attivita,
		c115 = f.attivita_altro,
		c16 = f.p_nome_1.value,
		c17 = f.p_cognome_1.value,
		c18 = f.p_mail_1.value,
		c19 = f.p_funzione_1.value,
		c20 = f.p_nome_2.value,
		c21 = f.p_cognome_2.value,
		c22 = f.p_mail_2.value,
		c23 = f.p_funzione_2.value,
		c24 = f.p_nome_3.value,
		c25 = f.p_cognome_3.value,
		c26 = f.p_mail_3.value,
		c27 = f.p_funzione_3.value,
		c28 = f.p_nome_4.value,
		c29 = f.p_cognome_4.value,
		c30 = f.p_mail_4.value,
		c31 = f.p_funzione_4.value,
		c32 = f.p_nome_5.value,
		c33 = f.p_cognome_5.value,
		c34 = f.p_mail_5.value,
		c35 = f.p_funzione_5.value,
		
		invitati = 0,
		
		reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/,
		partecipa = false,
		radio = false;
		
	for (var i = 0; i < c15.length; i++) 
		if (c15[i].checked) 
			radio = true;
	
	if(c1 == "" || c1 == "undefined")
	{
		alert("Il campo Ragione Sociale e' obbligatorio");
		f.ragione.focus();
		return false;
	}
	else if(c2 == "" || c2 == "undefined")
	{
		alert("Il campo Partita Iva e' obbligatorio");
		f.iva.focus();
		return false;
	}
	else if(c3 == "" || c3 == "undefined")
	{
		alert("Il campo Indirizzo e' obbligatorio");
		f.indirizzo.focus();
		return false;
	}
	else if(c4 == "" || c4 == "undefined")
	{
		alert("Il campo Numero e' obbligatorio");
		f.numero.focus();
		return false;
	}
	else if(c5 == "" || c5 == "undefined")
	{
		alert("Il campo Citta' e' obbligatorio");
		f.citta.focus();
		return false;
	}
	else if((c6 == "" || c6 == "undefined") && false)
	{
		alert("Il campo Provincia e' obbligatorio");
		f.provincia.focus();
		return false;
	}
	else if(c7 == "" || c7 == "undefined")
	{
		alert("Il campo CAP e' obbligatorio");
		f.cap.focus();
		return false;
	}
	else if((c8 == "" || c8 == "undefined") && c88 == 'estero')
	{
		alert("Il campo Nazione e' obbligatorio");
		f.paese.focus();
		return false;
	}
	else if(c9 == "" || c9 == "undefined")
	{
		alert("Il campo Telefono e' obbligatorio");
		f.telefono.focus();
		return false;
	}
	else if(c10 == "" || c10 == "undefined")
	{
		alert("Il campo Fax e' obbligatorio");
		f.fax.focus();
		return false;
	}
	else if(c11 == "" || c11 == "undefined")
	{
		alert("Il campo E-mail e' obbligatorio");
		f.mail.focus();
		return false;
	}
	else if(c12 == "" || c12 == "undefined")
	{
		alert("Il campo Nome Referente e' obbligatorio");
		f.nome.focus();
		return false;
	}
	else if(c13 == "" || c13 == "undefined")
	{
		alert("Il campo Cognome Referente e' obbligatorio");
		f.cognome.focus();
		return false;
	}
	else if(c14 == "" || c14 == "undefined")
	{
		alert("Il campo E-mail Referente e' obbligatorio");
		f.mail_ref.focus();
		return false;
	}
	else if(!radio)
	{
		alert("Il campo Attivita' e' obbligatorio");
		return false;
	}
	else if(!c115.disabled && (c115.value == "" || c115.value == undefined))
	{
		alert("Il campo Attivita' e' obbligatorio");
		return false;
	}
	else if(!reg.test(c11))
	{
		alert("L'indirizzo E-mail fornito non e' valido");
		f.mail.select();
		return false;
	}
	else if(!reg.test(c14))
	{
		alert("L'indirizzo E-mail fornito non e' valido");
		f.mail_ref.select();
		return false;
	}
	
	if(c16 != "" && c16 != "undefined")
	{
		if(c17 == "" || c17 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_1.focus();
			return false;
		}
		else if(c18 == "" || c18 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_1.focus();
			return false;
		}
		else if(!reg.test(c18))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_1.select();
			return false;
		}
		else if(c19 == "" || c19 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_1.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c20 != "" && c20 != "undefined")
	{
		if(c21 == "" || c21 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_2.focus();
			return false;
		}
		else if(c22 == "" || c22 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_2.focus();
			return false;
		}
		else if(!reg.test(c22))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_2.select();
			return false;
		}
		else if(c23 == "" || c23 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_2.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c24 != "" && c24 != "undefined")
	{
		if(c25 == "" || c25 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_3.focus();
			return false;
		}
		else if(c26 == "" || c26 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_3.focus();
			return false;
		}
		else if(!reg.test(c26))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_3select();
			return false;
		}
		else if(c27 == "" || c27 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_3.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c28 != "" && c28 != "undefined")
	{
		if(c29 == "" || c29 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_4.focus();
			return false;
		}
		else if(c30 == "" || c30 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_4.focus();
			return false;
		}
		else if(!reg.test(c30))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_4.select();
			return false;
		}
		else if(c31 == "" || c31 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_4.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c32 != "" && c32 != "undefined")
	{
		if(c33 == "" || c33 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_5.focus();
			return false;
		}
		else if(c34 == "" || c34 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_5.focus();
			return false;
		}
		else if(!reg.test(c34))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_5.select();
			return false;
		}
		else if(c35 == "" || c35 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_5.focus();
			return false;
		}
		else
			partecipa = true;
	}
	
	if(partecipa)
	{
		return true;
	}
	else
	{
		alert("Devi inserire almeno un partecipante");
		f.p_nome_1.focus();
		return false;
	}
	return false;
}


function controlla_pre_ENG()
{
	var f = document.pre;
	
	var
		c1 = f.ragione.value,
		c2 = f.iva.value,
		c3 = f.indirizzo.value,
		c4 = f.numero.value,
		c5 = f.citta.value,
		c6 = f.provincia.value,
		c7 = f.cap.value,
		c88 = f.nazione.value,
		c8 = f.paese.value,
		c9 = f.telefono.value,
		c10 = f.fax.value,
		c11 = f.mail.value,
		c12 = f.nome.value,
		c13 = f.cognome.value,
		c14 = f.mail_ref.value,
		c15 = f.attivita,
		c115 = f.attivita_altro,
		c16 = f.p_nome_1.value,
		c17 = f.p_cognome_1.value,
		c18 = f.p_mail_1.value,
		c19 = f.p_funzione_1.value,
		c20 = f.p_nome_2.value,
		c21 = f.p_cognome_2.value,
		c22 = f.p_mail_2.value,
		c23 = f.p_funzione_2.value,
		c24 = f.p_nome_3.value,
		c25 = f.p_cognome_3.value,
		c26 = f.p_mail_3.value,
		c27 = f.p_funzione_3.value,
		c28 = f.p_nome_4.value,
		c29 = f.p_cognome_4.value,
		c30 = f.p_mail_4.value,
		c31 = f.p_funzione_4.value,
		c32 = f.p_nome_5.value,
		c33 = f.p_cognome_5.value,
		c34 = f.p_mail_5.value,
		c35 = f.p_funzione_5.value,
		
		invitati = 0,
		
		reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/,
		partecipa = false,
		radio = false;
		
	for (var i = 0; i < c15.length; i++) 
		if (c15[i].checked) 
			radio = true;
	
	if(c1 == "" || c1 == "undefined")
	{
		alert("Il campo Ragione Sociale e' obbligatorio");
		f.ragione.focus();
		return false;
	}
	else if(c2 == "" || c2 == "undefined")
	{
		alert("Il campo Partita Iva e' obbligatorio");
		f.iva.focus();
		return false;
	}
	else if(c3 == "" || c3 == "undefined")
	{
		alert("Il campo Indirizzo e' obbligatorio");
		f.indirizzo.focus();
		return false;
	}
	else if(c4 == "" || c4 == "undefined")
	{
		alert("Il campo Numero e' obbligatorio");
		f.numero.focus();
		return false;
	}
	else if(c5 == "" || c5 == "undefined")
	{
		alert("Il campo Citta' e' obbligatorio");
		f.citta.focus();
		return false;
	}
	else if((c6 == "" || c6 == "undefined") && false)
	{
		alert("Il campo Provincia e' obbligatorio");
		f.provincia.focus();
		return false;
	}
	else if(c7 == "" || c7 == "undefined")
	{
		alert("Il campo CAP e' obbligatorio");
		f.cap.focus();
		return false;
	}
	else if((c8 == "" || c8 == "undefined") && c88 == 'estero')
	{
		alert("Il campo Nazione e' obbligatorio");
		f.paese.focus();
		return false;
	}
	else if(c9 == "" || c9 == "undefined")
	{
		alert("Il campo Telefono e' obbligatorio");
		f.telefono.focus();
		return false;
	}
	else if(c10 == "" || c10 == "undefined")
	{
		alert("Il campo Fax e' obbligatorio");
		f.fax.focus();
		return false;
	}
	else if(c11 == "" || c11 == "undefined")
	{
		alert("Il campo E-mail e' obbligatorio");
		f.mail.focus();
		return false;
	}
	else if(c12 == "" || c12 == "undefined")
	{
		alert("Il campo Nome Referente e' obbligatorio");
		f.nome.focus();
		return false;
	}
	else if(c13 == "" || c13 == "undefined")
	{
		alert("Il campo Cognome Referente e' obbligatorio");
		f.cognome.focus();
		return false;
	}
	else if(c14 == "" || c14 == "undefined")
	{
		alert("Il campo E-mail Referente e' obbligatorio");
		f.mail_ref.focus();
		return false;
	}
	else if(!radio)
	{
		alert("Il campo Attivita' e' obbligatorio");
		return false;
	}
	else if(!c115.disabled && (c115.value == "" || c115.value == undefined))
	{
		alert("Il campo Attivita' e' obbligatorio");
		return false;
	}
	else if(!reg.test(c11))
	{
		alert("L'indirizzo E-mail fornito non e' valido");
		f.mail.select();
		return false;
	}
	else if(!reg.test(c14))
	{
		alert("L'indirizzo E-mail fornito non e' valido");
		f.mail_ref.select();
		return false;
	}
	
	if(c16 != "" && c16 != "undefined")
	{
		if(c17 == "" || c17 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_1.focus();
			return false;
		}
		else if(c18 == "" || c18 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_1.focus();
			return false;
		}
		else if(!reg.test(c18))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_1.select();
			return false;
		}
		else if(c19 == "" || c19 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_1.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c20 != "" && c20 != "undefined")
	{
		if(c21 == "" || c21 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_2.focus();
			return false;
		}
		else if(c22 == "" || c22 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_2.focus();
			return false;
		}
		else if(!reg.test(c22))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_2.select();
			return false;
		}
		else if(c23 == "" || c23 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_2.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c24 != "" && c24 != "undefined")
	{
		if(c25 == "" || c25 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_3.focus();
			return false;
		}
		else if(c26 == "" || c26 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_3.focus();
			return false;
		}
		else if(!reg.test(c26))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_3select();
			return false;
		}
		else if(c27 == "" || c27 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_3.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c28 != "" && c28 != "undefined")
	{
		if(c29 == "" || c29 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_4.focus();
			return false;
		}
		else if(c30 == "" || c30 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_4.focus();
			return false;
		}
		else if(!reg.test(c30))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_4.select();
			return false;
		}
		else if(c31 == "" || c31 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_4.focus();
			return false;
		}
		else
			partecipa = true;
	}
	if(c32 != "" && c32 != "undefined")
	{
		if(c33 == "" || c33 == "undefined")
		{
			alert("Il campo Cognome e' obbligatorio");
			f.p_cognome_5.focus();
			return false;
		}
		else if(c34 == "" || c34 == "undefined")
		{
			alert("Il campo E-mail e' obbligatorio");
			f.p_mail_5.focus();
			return false;
		}
		else if(!reg.test(c34))
		{
			alert("L'E-mail fornita non e' valida");
			f.p_mail_5.select();
			return false;
		}
		else if(c35 == "" || c35 == "undefined")
		{
			alert("Il campo Funzione e' obbligatorio");
			f.p_funzione_5.focus();
			return false;
		}
		else
			partecipa = true;
	}
	
	if(partecipa)
	{
		return true;
	}
	else
	{
		alert("Devi inserire almeno un partecipante");
		f.p_nome_1.focus();
		return false;
	}
	return false;
}

function controlla_esporre()
{
	var 
		Nome = document.contatti.nome.value,
		Cognome = document.contatti.cognome.value,
		Nomeazienda = document.contatti.nomeazienda.value
		Email = document.contatti.email.value,
		Indirizzo = document.contatti.indirizzo.value
		Citta = document.contatti.citta.value,
		Stato = document.contatti.stato.value
		Telefono = document.contatti.telefono.value
		Sito = document.contatti.sito.value
		Testo = document.contatti.testo.value,
		Info = document.contatti.info.value,
		
		email_reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		
	if(Nome == "" || Nome == null)
	{
		alert("Il campo nome e' obbligatorio");
		document.contatti.nome.focus();
		return false;
	}
	else if(Cognome == "" || Cognome == null)
	{
		alert("Il campo cognome e' obbligatorio");
		document.contatti.cognome.focus();
		return false;
	}
	else if(Info < 17)
	{
		alert("Inserire un numero maggiore di 16");
		document.contatti.info.focus();
		return false;
	}
	else if(Nomeazienda == "" || Nomeazienda == null)
	{
		alert("Il campo Nome Azienda e' obbligatorio");
		document.contatti.nomeazienda.focus();
		return false;
	}
	else if(Email == "" || Email == null)
	{
		alert("Il campo email e' obbligatorio");
		document.contatti.email.focus();
		return false;
	}
	else if(Indirizzo == "" || Indirizzo == null)
	{
		alert("Il campo Indirizzo e' obbligatorio");
		document.contatti.indirizzo.focus();
		return false;
	}
	else if(Citta == "" || Citta == null)
	{
		alert("Il campo citta'; e' obbligatorio");
		document.contatti.citta.focus();
		return false;
	}
	else if(Stato == "" || Stato == null)
	{
		alert("Il campo stato e' obbligatorio");
		document.contatti.stato.focus();
		return false;
	}
	else if(Telefono == "" || Telefono == null)
	{
		alert("Il campo telefono e' obbligatorio");
		document.contatti.telefono.focus();
		return false;
	}
	else if(Testo == "" || Testo == null)
	{
		alert("Il campo testo e' obbligatorio");
		document.contatti.testo.focus();
		return false;
	}
	if (!email_reg.test(Email)) 
	{
	    alert("L'indirizzo email inserito non e' corretto");
	    document.contatti.email.select();
	    return false;
	}
	else
		return true;
	return false;
}