function Modulo_evento() {
   var titolo = document.nuovoevento.titolo.value;
   var autore = document.nuovoevento.autore.value;
   var descrizione = document.nuovoevento.descrizione.value;
		if ((titolo == "") || (titolo == "undefined")) {
      alert("Il campo titolo è obbligatorio.");
    	document.nuovoevento.titolo.focus();
    return false;
    }
   	else if ((autore == "") || (autore == "undefined")) {
      alert("Il campo autore è obbligatorio.");
    	document.nuovoevento.autore.focus();
    return false;
    }
        else {
           document.nuovoevento.action = "azioni-evento.php";
           document.nuovoevento.submit();
        }
  }

function Numeri(){
	if (event.keyCode < 48 || event.keyCode > 57)
		{
			event.returnValue = false
		}
}

function disattivatext(){
	document.modulo.prezzo.disabled=document.modulo.trattativa.checked;
	document.modulo.prezzo.value = '';
}

function Aggiungicommento(){
	var nome = document.modulo.nome.value;
  var mail = document.modulo.mail.value;
  var mail_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;	
	var commento = document.modulo.commento.value;

		if ((nome == "") || (nome == "undefined")) {
      alert("Il campo nome è obbligatorio.");
    	document.modulo.nome.focus();
    	return false;
    }
		else if (!mail_reg_exp.test(mail) || (mail == "") || (mail == "undefined")) {
			alert("Inserire un indirizzo e-mail corretto.");
			document.modulo.mail.select();
			return false;
		}
   	else if ((commento == "") || (commento == "undefined")) {
      alert("Inserisci un commento.");
    	document.modulo.commento.focus();
    	return false;
    }		
        else {
           document.modulo.action = "ins-commento.php";
           document.modulo.submit();
        }	
}
