<!--

//validazione form iscrizione in italiano
function validamodulo() {

var cognome = document.frm_mod.cognome.value;
var nome = document.frm_mod.nome.value;
var giorno = document.frm_mod.giorno_nascita.value;
var mese = document.frm_mod.mese_nascita.value;
var anno = document.frm_mod.anno_nascita.value;
var data = new Date(parseInt(anno, 10), parseInt(mese-1, 10), parseInt(giorno, 10));
var luogo_nascita = document.frm_mod.luogo_di_nascita.value;
//var nazionalita = document.frm_mod.cittadinanza.value;
var via = document.frm_mod.via_r.value;
var cap = document.frm_mod.cap_r.value;
var citta = document.frm_mod.citta_r.value;
var provincia = document.frm_mod.provincia_r.value;
//var codice_fiscale = document.frm_mod.codice_fiscale.value;
var telefono = document.frm_mod.telefono.value;
var cellulare = document.frm_mod.cellulare.value;
var email = document.frm_mod.email.value;
var cv = document.frm_mod.cv.value;
var foto = document.frm_mod.foto.value;
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

if (cognome == "") {
	alert("Non hai inserito il tuo cognome");
	document.frm_mod.cognome.focus();
	return false;
}

else if (nome == "") {
	alert("Non hai inserito il tuo nome");
	document.frm_mod.nome.focus();
	return false;
}

else if (giorno == "gg") {
	alert("Non hai inserito la tua data di nascita");
	document.frm_mod.giorno_nascita.focus();
	return false;
}

else if (mese == "mm") {
	alert("Non hai inserito il tuo mese di nascita");
	document.frm_mod.mese_nascita.focus();
	return false;
}

else if (anno == "aaaa") {
	alert("Non hai inserito il tuo anno di nascita");
	document.frm_mod.anno_nascita.focus();
	return false;
}

else if (!(data.getFullYear()==parseInt(anno, 10) && data.getMonth()+1==parseInt(mese, 10) && data.getDate()==parseInt(giorno, 10))) {
	alert("La data di nascita fornita è inesistente");
	document.frm_mod.giorno_nascita.focus();
	return false;
}
	
else if (luogo_nascita == "") {
	alert("Non hai inserito il tuo luogo di nascita");
	document.frm_mod.luogo_di_nascita.focus();
	return false;
}

/*else if (nazionalita == "") {
	alert("Non hai inserito la tua cittadinanza");
	document.frm_mod.cittadinanza.focus();
	return false;
}

else if (codice_fiscale == "") {
	alert("Non hai inserito il tuo codice fiscale");
	document.frm_mod.codice_fiscale.focus();
	return false;
}

else if (via == "") {
	alert("Non hai inserito il tuo indirizzo di residenza");
	document.frm_mod.via_r.focus();
	return false;
}

else if (cap == "") {
	alert("Non hai inserito il CAP");
	document.frm_mod.cap_r.focus();
	return false;
}

else if (citta == "") {
	alert("Non hai inserito la tua citta'");
	document.frm_mod.citta_r.focus();
	return false;
}

else if (provincia == "") {
	alert("Non hai inserito la tua provincia");
	document.frm_mod.provincia_r.focus();
	return false;
}

else if (telefono == "") {
	alert("Non hai inserito il tuo recapito telefonico");
	document.frm_mod.telefono.focus();
	return false;
}

else if (isNaN(telefono)) {
	alert("Il campo 'telefono' deve contenere solo valori numerici senza spazi");
	document.frm_mod.telefono.value = "";
	document.frm_mod.telefono.focus();
	return false;
}*/

else if (cellulare == "") {
	alert("Non hai inserito il tuo numero di cellulare");
	document.frm_mod.cellulare.focus();
	return false;
}

else if (isNaN(cellulare)) {
	alert("Il campo 'cellulare' deve contenere solo valori numerici senza spazi");
	document.frm_mod.cellulare.value = "";
	document.frm_mod.cellulare.focus();
	return false;
}

else if (email == "") {
	alert("Non hai inserito il tuo indirizzo email");
	document.frm_mod.email.focus();
	return false;
}

else if ((email != "") && (!email_reg_exp.test(email))) {
	alert("Inserire un indirizzo e-mail corretto");
	document.frm_mod.email.select();
	return false;
}

else if (cv == "") {
	alert("Non hai inserito il tuo CV");
	document.frm_mod.cv.focus();
	return false;
}

/*else if (foto == "") {
	alert("Non hai inserito la tua foto");
	document.frm_mod.foto.focus();
	return false;
}*/

else if (document.frm_mod.consenso.checked == false) {
	alert("Per inviare il modulo e' necessario autorizzare il trattamento dei dati personali.");
	document.frm_mod.consenso.focus();
	return false;
}

else {
	document.frm_mod.action = "send-processor.php";
	document.frm_mod.submit();
}

}



//validazione form iscrizione in inglese
function validateform() {

var cognome = document.frm_mod.cognome.value;
var nome = document.frm_mod.nome.value;
var giorno = document.frm_mod.giorno_nascita.value;
var mese = document.frm_mod.mese_nascita.value;
var anno = document.frm_mod.anno_nascita.value;
var data = new Date(parseInt(anno, 10), parseInt(mese-1, 10), parseInt(giorno, 10));
var luogo_nascita = document.frm_mod.luogo_di_nascita.value;
//var nazionalita = document.frm_mod.cittadinanza.value;
var via = document.frm_mod.via_r.value;
var cap = document.frm_mod.cap_r.value;
var citta = document.frm_mod.citta_r.value;
var provincia = document.frm_mod.provincia_r.value;
//var codice_fiscale = document.frm_mod.codice_fiscale.value;
var telefono = document.frm_mod.telefono.value;
var cellulare = document.frm_mod.cellulare.value;
var email = document.frm_mod.email.value;
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

if (cognome == "") {
	alert("Please insert your surname");
	document.frm_mod.cognome.focus();
	return false;
}

else if (nome == "") {
	alert("Please insert your forename");
	document.frm_mod.nome.focus();
	return false;
}

else if (giorno == "dd") {
	alert("Please insert your date of birth (day)");
	document.frm_mod.giorno_nascita.focus();
	return false;
}

else if (mese == "mm") {
	alert("Please insert your date of birth (month)");
	document.frm_mod.mese_nascita.focus();
	return false;
}

else if (anno == "yyyy") {
	alert("Please insert your date of birth (year)");
	document.frm_mod.anno_nascita.focus();
	return false;
}

else if (!(data.getFullYear()==parseInt(anno, 10) && data.getMonth()+1==parseInt(mese, 10) && data.getDate()==parseInt(giorno, 10))) {
	alert("The birthdate you have inserted is not valid");
	document.frm_mod.giorno_nascita.focus();
	return false;
}

else if (luogo_nascita == "") {
	alert("Please insert your place of birth");
	document.frm_mod.luogo_di_nascita.focus();
	return false;
}

/*else if (nazionalita == "") {
	alert("Please insert your nationality");
	document.frm_mod.cittadinanza.focus();
	return false;
}

else if (codice_fiscale == "") {
	alert("Please insert your fiscal code");
	document.frm_mod.codice_fiscale.focus();
	return false;
}

else if (via == "") {
	alert("Please insert your street address");
	document.frm_mod.via_r.focus();
	return false;
}

else if (cap == "") {
	alert("Please insert your postcode");
	document.frm_mod.cap_r.focus();
	return false;
}

else if (citta == "") {
	alert("Please insert your city of residence");
	document.frm_mod.citta_r.focus();
	return false;
}

else if (provincia == "") {
	alert("Please insert your county of residence");
	document.frm_mod.provincia_r.focus();
	return false;
}

else if (telefono == "") {
	alert("Please insert your phone number");
	document.frm_mod.telefono.focus();
	return false;
}

else if (isNaN(telefono)) {
	alert("Please insert your phone number without letters and blank spaces in between");
	document.frm_mod.telefono.value = "";
	document.frm_mod.telefono.focus();
	return false;
}*/

else if (cellulare == "") {
	alert("Please insert your mobile number");
	document.frm_mod.cellulare.focus();
	return false;
}

else if (isNaN(cellulare)) {
	alert("Please insert your mobile number without letters and blank spaces in between");
	document.frm_mod.cellulare.value = "";
	document.frm_mod.cellulare.focus();
	return false;
}

else if (email == "") {
	alert("Please insert your e-mail address");
	document.frm_mod.email.focus();
	return false;
}

else if ((email != "") && (!email_reg_exp.test(email))) {
	alert("Please insert a valid e-mail address");
	document.frm_mod.email.select();
	return false;
}

else if (cv == "") {
	alert("Please insert your CV");
	document.frm_mod.cv.focus();
	return false;
}

/*else if (foto == "") {
	alert("Please insert your picture");
	document.frm_mod.foto.focus();
	return false;
}*/

else if (document.frm_mod.consenso.checked == false) {
	alert("You must authorise processing of your personal data");
	document.frm_mod.consenso.focus();
	return false;
}

else {
	document.frm_mod.action = "send-processor.php";
	document.frm_mod.submit();
}

}


//validazione iscrizione area riservata
function valida_iscr_ut() {

var cognome = document.frm_mod.cognome.value;
var nome = document.frm_mod.nome.value;
var id_tu = document.frm_mod.id_tu.value;
var email = document.frm_mod.email.value;
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
var passwd = document.frm_mod.passwd.value;
var password_confirm = document.frm_mod.password_confirm.value;
var motivo = document.frm_mod.motivo.value;

if (cognome == "") {
	alert("Non hai inserito il tuo cognome");
	document.frm_mod.cognome.focus();
	return false;
}

else if (nome == "") {
	alert("Non hai inserito il tuo nome");
	document.frm_mod.nome.focus();
	return false;
}

else if (id_tu == "") {
	alert("Non hai inserito la tua tipologia di utente");
	document.frm_mod.id_tu.focus();
	return false;
}

else if (email == "") {
	alert("Non hai inserito il tuo indirizzo email");
	document.frm_mod.email.focus();
	return false;
}

else if ((email != "") && (!email_reg_exp.test(email))) {
	alert("Inserire un indirizzo e-mail corretto");
	document.frm_mod.email.select();
	return false;
}

else if (passwd == "") {
	alert("Non hai inserito la password");
	document.frm_mod.passwd.focus();
	return false;
}

else if (password_confirm != passwd) {
	alert("Password e conferma password devono coincidere");
	document.frm_mod.password_confirm.focus();
	return false;
}

else if (motivo == "") {
	alert("Non hai specificato il motivo per cui richiedi i materiali");
	document.frm_mod.motivo.focus();
	return false;
}

else if (document.frm_mod.consenso.checked == false) {
	alert("Per inviare il modulo e' necessario autorizzare il trattamento dei dati personali.");
	document.frm_mod.consenso.focus();
	return false;
}

else if (document.frm_mod.consenso_diff.checked == false) {
	alert("Per inviare il modulo e' necessario autorizzare la comunicazione a terzi dei propri dati personali.");
	document.frm_mod.consenso_diff.focus();
	return false;
}


else {
	document.frm_mod.action = "insert_user.php";
	document.frm_mod.submit();
}

}
//-->