function errore(campo) {
   if (LANG == 0) {
   	alert("ATTENZIONE!\nImpossibile confermare l'iscrizione alla mailing list\nperchè il campo «"+campo+"»\nnon è stato correttamente valorizzato!\nCompilare attentamente tutti i campi obbligatori,\nquindi confermare nuovamente l'iscrizione.\nI campi obbligatori sono contrassegnati in grassetto.");
   } else {
      	alert("WARNING!\nThe field «"+campo+"» is not correctly filled out, so the\nsubscription can't be completed! Please fill out carefully all the\nmandatory fields, then try again to complete the subscription.\nAll the bold fields are mandatory.");
   }
}

function inviaMessaggio() {
	var err="";
	var flag=0;
	
	document.Mail.NOME_COGNOME.value = document.Mail.realname.value;
	document.Mail.EMAIL_ADDRESS.value = document.Mail.email.value;
	var name_text = document.Mail.NOME_COGNOME.value;
	var indemail = document.Mail.email.value;

	if (name_text == "" || name_text == null || name_text == "null") {
		if (LANG == 0) { err = "Nome e cognome"; } else { err = "Name and surname"; }
		flag=1;	
	}

	if ((indemail == "" || indemail == null || indemail == "null" || indemail.lastIndexOf("@") == -1 || indemail.lastIndexOf(".") == -1) && (flag==0)) {
		if (LANG == 0) { err = "Indirizzo e-mail"; } else { err = "E-mail address"; }
		flag=1;
	}

	if (err != "" && flag!=0) {
		errore(err);
	}
	
	if (flag==0) {
		document.Mail.submit();
	}
}
