
function checkrequirefields(frm) {
   
  vObj = document.onLineForm.validateimage;
  if (vObj.value == ""){
     alert ("\n The Word validation field is blank. \n\n Please type the characters you see in the picture.")
     document.onLineForm.validateimage.focus();
     return false;
  }

   vObj = document.onLineForm.username;
   if (vObj.value == "") {
      alert("'Name' can not be empty!");
      vObj.focus();
      return false;
   }
   
   vObj = document.onLineForm.title;
   if (vObj.value == "") {
      alert("'Title' can not be empty!");
      vObj.focus();
      return false;
   }
   
   
   vObj = document.onLineForm.company;
   if (vObj.value == "") {
      alert("'Company' can not be empty!");
      vObj.focus();
      return false;
   }
   
   
   vObj = document.onLineForm.email;
   if (vObj.value == "") {
      alert("'E-Mail Address' can not be empty!");
      vObj.focus();
      return false;
   }
   
   
   vObj = document.onLineForm.how;
   if (vObj.value == "") {
      alert("How did you hear about Elma Bustronic?");
      vObj.focus();
      return false;
   }
             
   return true;
 } 
  
 //Check numbers only 
function validate_number(field) {
  var valid = "0123456789.,"
  var ok = "yes";
  var temp;
  for (var i=0; i<field.value.length; i++) {
  temp = "" + field.value.substring(i, i+1);
  if (valid.indexOf(temp) == "-1") ok = "no";
  }
  if (ok == "no") {
     alert("Invalid entry!  Only numbers are accepted!");
     field.focus();
     field.select();
     return false;
   }
   return true;
} 

function check_phone(phonefield)
{ 
        
    var re=/^[0-9]{3,3}[-][0-9]{3,3}[-][0-9]+$/;
    if (phonefield.value != "")
    {
      if (!re.test(phonefield.value))
      {
         alert("Invalid phone number or format is wrong!");
         phonefield.focus();
         phonefield.select();
         return false;
      }
    }  
    return true;
}    

function check_email(emailfield)
{ 
    vObj = emailfield;
  
    var re=/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/;
    if (vObj.value != "")
    {
      if (!re.test(vObj.value))
      {
         alert("Invalid email address!");
         vObj.focus();
         vObj.select();
         return false;
      }
    }  
    return true;
}    

