function checkreg1(form)
{
  var firstName = form.firstName.value;
  if(!firstName.match(/\S/))
  {
    alert("Please enter your first name.");
    form.firstName.focus();
    return false;
  }

  if(firstName.match(/\d/))
  {
    alert("Your first name should not contain any digits.");
    form.firstName.focus();
    return false;
  }

  var surname = form.surname.value;
  if(!surname.match(/\S/))
  {
    alert("Please enter your surname.");
    form.surname.focus();
    return false;
  }

  if(surname.match(/\d/))
  {
    alert("Your surname should not contain any digits.");
    form.surname.focus();
    return false;
  }

  var invoiceName = form.invoiceName.value;
  if(!invoiceName.match(/\S/))
  {
    alert("Please enter the name for invoice purposes.");
    form.invoiceName.focus();
    return false;
  }

  var Address1 = form.address1.value;
  var Address2 = form.address2.value;
  if(!(Address1.match(/\S/) || Address2.match(/\S/) ))
  {
    alert("Please enter an address.");
    form.address1.focus();
    return false;
  }

  var city = form.city.value;
  if(!city.match(/\S/))
  {
    alert("Please enter the city.");
    form.city.focus();
    return false;
  }

  var Postcode = form.postalCode.value;
  if(!Postcode.match(/\S/))
  {
    alert("Please enter a postal code.");
    form.postalCode.focus();
    return false;
  }

  var Email = form.email.value;
  if(Email.match(/\s/))
  {
    alert("No spaces are allowed in the e-mail address.");
    form.email.focus();
    return false;
  }

  if(!Email.match(/\@/))
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  var NumberOfChars = 0;
  for (var i=0 ; i < Email.length ; i++)
  {
    if (Email.substr(i,1) == "@")
    {
      NumberOfChars++;
    }
  }

  if(NumberOfChars > 1)
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  Email = Email.replace(/\s+/g,"");
  if(Email.match(/^\@/) || Email.match(/\@$/))
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  var TelW = form.phoneWork.value;
  if(!TelW.match(/\S/))
  {
    alert("Please enter your telephone number.");
    form.phoneWork.focus();
    return false;
  }

  if(!TelW.match(/\d/))
  {
    alert("Your telephone number should contain digits.");
    form.phoneWork.focus();
    return false;
  }

  /*
  var Cell = form.phoneCell.value;
  if(!Cell.match(/\S/))
  {
    alert("Please enter your cellphone/mobile number.");
    form.phoneCell.focus();
    return false;
  }

  if(!Cell.match(/\d/))
  {
    alert("Your cell number should contain digits.");
    form.phoneCell.focus();
    return false;
  }
  */

  return true;
}

function application(form)
{
  var firstName = form.firstName.value;
  if(!firstName.match(/\S/))
  {
    alert("Please enter your first name.");
    form.firstName.focus();
    return false;
  }

  var surname = form.surname.value;
  if(!surname.match(/\S/))
  {
    alert("Please enter your surname.");
    form.surname.focus();
    return false;
  }

  var tel = form.tel.value;
  if(!tel.match(/\S/))
  {
    alert("Please enter your telephone number.");
    form.tel.focus();
    return false;
  }
  
  var Email = form.email.value;
  if(Email.match(/\s/))
  {
    alert("No spaces are allowed in the e-mail address.");
    form.email.focus();
    return false;
  }

  if(!Email.match(/\@/))
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  var NumberOfChars = 0;
  for (var i=0 ; i < Email.length ; i++)
  {
    if (Email.substr(i,1) == "@")
    {
      NumberOfChars++;
    }
  }

  if(NumberOfChars > 1)
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  Email = Email.replace(/\s+/g,"");
  if(Email.match(/^\@/) || Email.match(/\@$/))
  {
    alert("Please enter a valid e-mail address.");
    form.email.focus();
    return false;
  }

  return true;
}
  

function terms(form)
{  
  if (form.term.checked == false) 
  {
    alert("You must accept the terms and conditions.");
    form.term.focus();
    return false;
  }
  
  return true;
}
