function ValidarLogin (login, password) { var loginRegisto = document.getElementById(login); var passwordRegisto = document.getElementById(password); if(loginRegisto.value.length == 0) { notify('Ha d\'indicar un email', loginRegisto); SetBoldStyleToMandatoryFields_Login (); return false; } if(IsNotValidEmail(loginRegisto)) { notify('L\'Usuari no és correcte . Ha de ser un compte d\' email', loginRegisto); return false; } if(passwordRegisto.value.length == 0) { notify('Ha d\'indicar la seva contrasenya', passwordRegisto); SetBoldStyleToMandatoryFields_Login (); return false; } return true; } function ValidarRecuperarPass(registrationEmail) { var emailRegisto = document.getElementById(registrationEmail); if(emailRegisto.value.length == 0) { notify('Ha d\'indicar un email', emailRegisto); SetBoldStyleToMandatoryFields_Recover (); return false; } if(IsNotValidEmail(emailRegisto)) { notify('L\'Usuari no és correcte . Ha de ser un compte d\' email', emailRegisto); return false; } return true; } function ValidarRegisto(registrationEmail, name, nif, country, mobile, pass1, pass2, conditions) { var emailRegisto = document.getElementById(registrationEmail); var nome = document.getElementById(name); var contribuinte = document.getElementById(nif); var pais = document.getElementById(country); var telemovel = document.getElementById(mobile); var password1 = document.getElementById(pass1); var password2 = document.getElementById(pass2); var condicoes = document.getElementById(conditions); if(emailRegisto.value.length == 0) { notify('Ha d\'indicar un email', emailRegisto); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(IsNotValidEmail(emailRegisto)) { notify('L\'Usuari no és correcte . Ha de ser un compte d\' email', emailRegisto); return false; } if(nome.value.length == 0) { notify('Ha d\'indicar el seu nom', nome); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(pais.value == "") { notify('Per favor, seleccioni el País', pais); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(telemovel.value.length > 0 && telemovel.value.length < 7) { notify('Aparentment el Mòbil no està correcte', telemovel); return false; } if(telemovel.value.length > 0 && IsNotValidInt(telemovel)) { notify('El mòbil només pot tenir números', telemovel); return false; } if(password1.value.length == 0) { notify('Ha d\'indicar la seva contrasenya', password1); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(password1.value.length < 4) { notify('La contrasenya ha de tenir com a mínim 4 caràcters', password1); return false; } if(password1.value != password2.value) { notify('Les contrasenyes indicades han de ser idèntiques', password2); return false; } if(!condicoes.checked) { notify('Ha d\'acceptar les condicions per a poder registrar-se', condicoes); SetBoldStyleToMandatoryFields_NewUser (); return false; } return true; } function ValidarAlterarDadosRegisto(name, contactEmail, nif, country, phone, mobile, faxNr, smsNr) { var nome = document.getElementById(name); var emailContacto = document.getElementById(contactEmail); var contribuinte = document.getElementById(nif); var pais = document.getElementById(country); var telefone = document.getElementById(phone); var telemovel = document.getElementById(mobile); var fax = document.getElementById(faxNr); var sms = document.getElementById(faxNr); if(nome.value.length == 0) { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('Ha d\'indicar el seu nom', nome); return false; } if(emailContacto.value.length == 0) { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('Ha d\'indicar el seu email de contacte', emailContacto); return false; } if(IsNotValidEmail(emailContacto)) { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('L\'email de contacte no és correcte.', emailContacto); return false; } if(pais.value == "") { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('Per favor, seleccioni el País', pais); return false; } if(telefone.value.length > 0 && telefone.value.length < 7) { notify('Aparentment el telèfon no és correcte', telefone); return false; } if(telefone.value.length > 0 && IsNotValidInt(telefone)) { notify('El telèfon només pot tenir números', telefone); return false; } if(telemovel.value.length > 0 && telemovel.value.length < 7) { notify('Aparentment el Mòbil no està correcte', telemovel); return false; } if(telemovel.value.length > 0 && IsNotValidInt(telemovel)) { notify('El mòbil només pot tenir números', telemovel); return false; } if(fax.value.length > 0 && fax.value.length < 7) { notify('Aparentment el fax no és correcte', fax); return false; } if(fax.value.length > 0 && IsNotValidInt(fax)) { notify('El fax només pot tenir números', fax); return false; } if(sms.value.length > 0 && sms.value.length < 7) { notify('Aparentment el contacte SMS no és correcte', sms); return false; } if(sms.value.length > 0 && IsNotValidInt(sms)) { notify('El contacte SMS només pot tenir números', sms); return false; } return true; } function ValidarMudarPass (oldPass, pass1, pass2) { var oldPassword = document.getElementById(oldPass); var password1 = document.getElementById(pass1); var password2 = document.getElementById(pass2); if(oldPassword.value.length == 0) { notify('Ha d\'indicar la seva contrasenya', oldPassword); SetBoldStyleToMandatoryFields_ChangePassword (); return false; } if(password1.value.length == 0) { notify('Ha d\'indicar la seva contrasenya', password1); SetBoldStyleToMandatoryFields_ChangePassword (); return false; } if(password1.value.length < 4) { notify('La contrasenya ha de tenir com a mínim 4 caràcters', password1); return false; } if(password1.value != password2.value) { notify('Les contrasenyes indicades han de ser idèntiques', password2); return false; } return true; }