function checkform ( form )
{
  var regex=/^([a-z\s\.'-]+)$/i;

  if (!regex.test(form.first_name.value))
  {
    alert("Your first name appears to be invalid. Use alphabetical characters plus hyphens, apostrophes, full stops and spaces only.");
    form.first_name.focus();
    return false ;
  }

  if (!regex.test(form.last_name.value))
  {
    alert("Your last name appears to be invalid. Use alphabetical characters plus hyphens, apostrophes, full stops and spaces only.");
    form.last_name.focus();
    return false ;
  }

  function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Your email address appears to be invalid.")    ;
		   form.email.focus();
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
                   alert("Your email address appears to be invalid.");
		   form.email.focus();
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
                    alert("Your email address appears to be invalid.");
		    form.email.focus();
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
                    alert("Your email address appears to be invalid.");
		    form.email.focus();
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
                    alert("Your email address appears to be invalid.");
		    form.email.focus();
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
                    alert("Your email address appears to be invalid.");
		    form.email.focus();
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
                    alert("Your email address appears to be invalid.");
		    form.email.focus();
		    return false
		 }

 		 return true
	}

	var email = document.form.email

	if ((email.value==null)||(email.value=="")){
		alert("Please enter your email address.");
		form.email.focus();
		return false ;
	}
	if (echeck(email.value)==false){
		form.email.focus();
		return false ;
	}

  var regex2 = /^([\/\\a-z0-9\s\.'-]+)$/i;

  if (!regex2.test(form.address1.value))
  {
    alert("The first line of your address appears to be invalid. Use alphanumeric characters plus hyphens, apostrophes, full stops and spaces only.");
    form.address1.focus();
    return false ;
  }

  var regex3 = /^([a-z0-9\s-]+)$/i;

  if (!regex3.test(form.postcode.value))
  {
    alert("Your postal/zip code appears to be invalid. Use alphanumeric characters plus hyphens and spaces only.\n\nIf you do not have a postcode please enter '000'");
    form.postcode.focus();
    return false ;
  }

return true;
}
