function checkContattin(){
 var email = document.getElementById('emailn').value;
 var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;


	var strError = new String("");
    var tmpErrorField = new String("");



    if (document.getElementById('nomen').value == ""){ tmpErrorField = tmpErrorField.concat(" - Nome\n")};

    if (tmpErrorField.length) {
        strError = strError.concat("Attenzione!!\n\nNon sono stati valorizzati i seguenti campi obbligatori:\n", tmpErrorField);
    };

    if ((email == "") || (email == "undefined")){
           document.getElementById('emailn').select();
           strError = strError.concat(" - E-Mail\n");
    }else if(!email_reg_exp.test(email)){
        document.getElementById('emailn').select();
        strError = strError.concat("\nL'email è errata\n");
    };

     if(!document.getElementById('autorizzon').checked){
        strError = strError.concat("\nDevi dare l'autorizzazione al trattamento dei dati personali se vuoi registrarti");
    }

    if (strError.length) {
        alert(strError);
        return false;
    } else {
        return true;
    };
}

