function checkInputPre(theForm) {
	var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

	if (theForm.tipo.value == "L") {
		if ((theForm.nomescuola.value==0) && (theForm.nomescuola.value.length<=0)) {
			alert("Nome della scuola mancante !");
			theForm.nomescuola.focus();
			return false
			}
	
		else if ((theForm.indirizzo.value==0) && (theForm.indirizzo.value.length<=0)) {
			alert("Indirizzo mancante !");
			theForm.indirizzo.focus();
			return false
			}
	
		else if ((theForm.cap.value==0) && (theForm.cap.value.length<=0)) {
			alert("CAP mancante !");
			theForm.cap.focus();
			return false
			}
	
		else if ((theForm.comune.value==0) && (theForm.comune.value.length<=0)) {
			alert("Comune mancante !");
			theForm.comune.focus();
			return false
			}
	
		else if ((theForm.prov.value==0) && (theForm.prov.value.length<=0)) {
			alert("Provincia mancante !");
			theForm.prov.focus();
			return false
			}
	
		else if ((theForm.tel.value==0) && (theForm.tel.value.length<=0)) {
			alert("Telefono mancante !");
			theForm.tel.focus();
			return false
			}

		else if ((theForm.email.value.length>0) && (!email_reg_exp.test(theForm.email.value))) {
			alert("E-mail non valida !");
			theForm.email.focus();
			return false
			}

		else if ((theForm.insegnante.value==0) && (theForm.insegnante.value.length<=0)) {
			alert("Insegnante di riferimento mancante !");
			theForm.insegnante.focus();
			return false
			}
	
		else if ((theForm.labrich.value==0) && (theForm.note.value==0) && (theForm.note.value.length<=0)) {
			alert("Specificare nelle note quale altro laboratorio si desidera !");
			theForm.note.focus();
			return false
			}
	}

	else if (theForm.tipo.value == "C") {
		if ((theForm.nome.value==0) && (theForm.nome.value.length<=0)) {
			alert("Nome mancante !");
			theForm.nome.focus();
			return false
			}
	
		else if ((theForm.cognome.value==0) && (theForm.cognome.value.length<=0)) {
			alert("Cognome mancante !");
			theForm.cognome.focus();
			return false
			}
	
		
		else if ((theForm.tel.value==0) && (theForm.tel.value.length<=0)) {
			alert("Telefono mancante !");
			theForm.tel.focus();
			return false
			}

		else if ((theForm.email.value.length>0) && (!email_reg_exp.test(theForm.email.value))) {
			alert("E-mail non valida !");
			theForm.email.focus();
			return false
			}

	}
	else {
		return false
	}

}
