
function controlli_mail()
		{
			var cognome = document.form_mail.cognome.value;
			var nome = document.form_mail.nome.value;
			var email = document.form_mail.email.value;
			var messaggio = document.form_mail.messaggio.value;
			var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
			var errors = new Array();
			var str = "";

			// CONTROLLO COGNOME
			if (cognome == "") {
			   errors=errors.concat("* Il campo \"cognome\" è obbligatorio.\n\n");
			}
			// CONTROLLO NOME
			if (nome == "") {
			   errors=errors.concat("* Il campo \"nome\" è obbligatorio.\n\n");
			}
			// CONTROLLO EMAIL
			if (!email_reg_exp.test(email) || (email == "")) {
			   errors=errors.concat("* Il campo \"e-mail\" è obbligatorio. Assicurati di scriverlo nella forma corretta.\n\n");
			}
			// CONTROLLO MESSAGGIO
			if (messaggio == "") {
			   errors=errors.concat("* Il campo \"messaggio\" è obbligatorio.\n\n");
			}
			// controllo se ci sono stati errori nella compilazione del form
			if (errors.length > 0){
				for (i=0;i<errors.length;i++){
					str += errors[i];
				}
				alert (str);
				return false;
			}
			//INVIA IL MODULO
			else {
			   return true;
			}
		}
