function ValidarLogin (login, password) { var loginRegisto = document.getElementById(login); var passwordRegisto = document.getElementById(password); if(loginRegisto.value.length == 0) { notify('You must indicate an email', loginRegisto); SetBoldStyleToMandatoryFields_Login (); return false; } if(IsNotValidEmail(loginRegisto)) { notify('Invalid User. It must be an email address', loginRegisto); return false; } if(passwordRegisto.value.length == 0) { notify('You must indicate your password', passwordRegisto); SetBoldStyleToMandatoryFields_Login (); return false; } return true; } function ValidarRecuperarPass(registrationEmail) { var emailRegisto = document.getElementById(registrationEmail); if(emailRegisto.value.length == 0) { notify('You must indicate an email', emailRegisto); SetBoldStyleToMandatoryFields_Recover (); return false; } if(IsNotValidEmail(emailRegisto)) { notify('Invalid User. It must be an email address', 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('You must indicate an email', emailRegisto); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(IsNotValidEmail(emailRegisto)) { notify('Invalid User. It must be an email address', emailRegisto); return false; } if(nome.value.length == 0) { notify('You must indicate your name', nome); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(pais.value == "") { notify('Please select the Country', pais); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(telemovel.value.length > 0 && telemovel.value.length < 7) { notify('It seems the mobile phone number is not correct', telemovel); return false; } if(telemovel.value.length > 0 && IsNotValidInt(telemovel)) { notify('The mobile field can only have numbers', telemovel); return false; } if(password1.value.length == 0) { notify('You must indicate your password', password1); SetBoldStyleToMandatoryFields_NewUser (); return false; } if(password1.value.length < 4) { notify('The password must have at least 4 characters', password1); return false; } if(password1.value != password2.value) { notify('The passwords indicated must match', password2); return false; } if(!condicoes.checked) { notify('You must accept the conditions in order to register yourself', 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('You must indicate your name', nome); return false; } if(emailContacto.value.length == 0) { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('You must indicate your email address', emailContacto); return false; } if(IsNotValidEmail(emailContacto)) { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('The email address is not correct.', emailContacto); return false; } if(pais.value == "") { SetBoldStyleToMandatoryFields_MinimalLoginData(); notify('Please select the Country', pais); return false; } if(telefone.value.length > 0 && telefone.value.length < 7) { notify('It seems the telephone number is not correct', telefone); return false; } if(telefone.value.length > 0 && IsNotValidInt(telefone)) { notify('The telephone field can only have numbers', telefone); return false; } if(telemovel.value.length > 0 && telemovel.value.length < 7) { notify('It seems the mobile phone number is not correct', telemovel); return false; } if(telemovel.value.length > 0 && IsNotValidInt(telemovel)) { notify('The mobile field can only have numbers', telemovel); return false; } if(fax.value.length > 0 && fax.value.length < 7) { notify('It seems the fax number is not correct', fax); return false; } if(fax.value.length > 0 && IsNotValidInt(fax)) { notify('The fax field can only have numbers', fax); return false; } if(sms.value.length > 0 && sms.value.length < 7) { notify('It seems that the SMS contact is not correct', sms); return false; } if(sms.value.length > 0 && IsNotValidInt(sms)) { notify('The SMS contact can only have numbers', 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('You must indicate your password', oldPassword); SetBoldStyleToMandatoryFields_ChangePassword (); return false; } if(password1.value.length == 0) { notify('You must indicate your password', password1); SetBoldStyleToMandatoryFields_ChangePassword (); return false; } if(password1.value.length < 4) { notify('The password must have at least 4 characters', password1); return false; } if(password1.value != password2.value) { notify('The passwords indicated must match', password2); return false; } return true; }