function Checkrequirefield() {
   var vObj;
   vObj = document.frmAdd.strCAPTCHA;
   if (vObj.value == "") {
      alert("Please enter the correct value in the image box.");
      vObj.focus();
      return false;
   }
   
   vObj = document.frmAdd.firstName;
   if (vObj.value == "") {
      alert("'First Name' field can not be empty!");
      vObj.focus();
      return false;
   }
   
   vObj = document.frmAdd.lastName;
   if (vObj.value == "") {
      alert("'Last Name' field can not be empty!");
      vObj.focus();
      return false;
   }
   
  vObj = document.frmAdd.contactedBy;
   vObj1 = document.frmAdd.phone;
   var Contacted = ""
   for (i=0; i<vObj.length; i++) {
     if (document.frmAdd.contactedBy[i].checked)
        Contacted = document.frmAdd.contactedBy[i].value;    
   }
      
   if (Contacted == "byPhone"){
       if (vObj1.value == ""){
          alert("'Phone' can not be empty if you prefer to be contacted by e-mail.");
          vObj1.focus();
          return false;
       }   
   }
   
   
   vObj1 = document.frmAdd.email;
   var Contacted = ""
   for (i=0; i<vObj.length; i++) {
     if (document.frmAdd.contactedBy[i].checked)
        Contacted = document.frmAdd.contactedBy[i].value;    
   }
      
   if (Contacted == "byEmail"){
       if (vObj1.value == ""){
          alert("'E-mail' can not be empty if you prefer to be contacted by e-mail.");
          vObj1.focus();
          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;
}

function check_number(strng){
  var str = strng.value;	
  var re=/^[0-9]+$/;
  //strip out acceptable non-numeric characters
  if (str != ""){
    if (!re.test(str)) {
       error = "The phone number field must be numberic and no space.";
       alert (error);
       strng.focus();       
       return false;
    }
  }  
  return true;
  
}                        