//confirm add user form completely populated before doing submit
function registrationvalidate() {
 if (document.loginform.pass.value != document.loginform.pass2.value) {
    alert("Your entered passwords do not match please re-type ensuring both passwords are identical.");
    document.loginform.pass.focus();
    return false;
 }
 if (document.loginform.username.value.length < 1) {
    alert("Please enter a username for you to access this site with.");
    document.loginform.username.focus();
    return false;
 }
 if (document.loginform.firstname.value.length < 1) {
    alert("You have not entered your first name.");
    document.loginform.firstname.focus();
    return false;
 }
 if (document.loginform.surname.value.length < 1) {
    alert("You have not entered your surname.");
    document.loginform.surname.focus();
    return false;
 }
 if (document.loginform.email.value.length < 1) {
    alert("You have not entered your email address.");
    document.loginform.email.focus();
    return false;
 }
  if (document.loginform.telephone.value.length < 1) {
    alert("You have not entered your telephone number.");
    document.loginform.telephone.focus();
    return false;
 }
  if (document.loginform.company.value.length < 1) {
    alert("You have not entered your company name.");
    document.loginform.company.focus();
    return false;
 }
 return true;
}

//confirm update account details
function updateaccountvalidate() {
 if (document.loginform.firstname.value.length < 1) {
    alert("You have not entered your first name.");
    document.loginform.firstname.focus();
    return false;
 }
 if (document.loginform.surname.value.length < 1) {
    alert("You have not entered your surname.");
    document.loginform.surname.focus();
    return false;
 }
 if (document.loginform.email.value.length < 1) {
    alert("You have not entered your email address.");
    document.loginform.email.focus();
    return false;
 }
  if (document.loginform.telephone.value.length < 1) {
    alert("You have not entered your telephone number.");
    document.loginform.telephone.focus();
    return false;
 }
  if (document.loginform.company.value.length < 1) {
    alert("You have not entered your company name.");
    document.loginform.company.focus();
    return false;
 }
 return true;
}