<!-- Hide script from older browsers
// This script checks for numeric input only in form fields.
var nr=0;
 function numericCheck(){
  // Eg:  nrl=document.<name of form>.<name of field>.value;
  nr1=document.form1.office.value;
  flg=0;
  str="";
  spc=""
  arw="";
  for (var i=0;i<nr1.length;i++){
   cmp="0123456789"
   tst=nr1.substring(i,i+1)
   if (cmp.indexOf(tst)<0){
    flg++;
    str+=" "+tst;
    spc+=tst;
    arw+="^";
   }
   else{arw+="_";}
  }
  if (flg!=0){
   if (spc.indexOf(" ")>-1) {
    str+=" and/or a space";
    }
   alert(nr1+"\r"+arw+"\rI'm sorry. This entry must "
   +"be a number. I found "+flg+" unacceptable characters: "+str+".");
   return false;
  }
  return true;
 }

// This script validates fields, returns error messages, submits form and redirects page

// Ensure that ESSENTIAL FIELDS have been filled in.
function CheckFields(form1) {

  // The fields are checked for blanks
  if ( form1.name.value   == "" ||
       form1.address.value  == "" ||
	   form1.email.value  == "" ||
       form1.telephone.value  == "" ||
       form1.status.value    == "" ) {
     alert( "Data in essential fields missing.\nPlease ensure that all fields are filled in." );
     return false;
  }

// check for valid email address
else if ( form1.email.value.length <= 6 ||
      form1.email.value.indexOf ('@', 0) == -1 ||
      form1.email.value.indexOf ('.', 0) == -1){

      alert("'' " + form1.email.value + " '', is not valid Email Address.");
      return false;
 }


  else {

     // If reached this far then thank user, submit form and show redirect page

	 alert ("'Thank you for your application.'" +form1.name.value + " '' \nPlease wait a moment while your data is sent to our server")
	 
     // put your email address in here
     form1.action="contactus.php";
     // put the redirect url in here absolute or relative urls can be used
	 location.href="thanks.htm";
	 
	 	 
     return true;
  }

}

//End Hiding -->


