
function checkrequirefields(frm) {
  
   vObj = frm.firstName;
   if (vObj.value == "") {
      alert("'First Name' can not be empty!");
      vObj.focus();
      return false;
   }
   
   vObj = frm.LastName;
   if (vObj.value == "") {
      alert("'Last Name' can not be empty!");
      vObj.focus();
      return false;
   }
   
      
   vObj = frm.email;
   if (vObj.value == "") {
      alert("'Email Address' can not be empty!");
      vObj.focus();
      return false;
   }
   
   
   vObj = frm.password2;
   vObj2 = frm.verify_password;
   
   if (vObj.value == "") {
      alert("'Password' can not be empty!");
      vObj.focus();
      return false;
   }
    
	
   if (vObj2.value == "") {
      alert("'The password you are entering is not matched.");	  
      vObj2.focus();	  
      return false;
   }else{
      if (vObj.value != vObj2.value){
	      alert("The password you are entering is not matched.");
		  vObj2.value = "";
		  vObj2.focus();
		  return false;
	  }
   }
   
   vObj = frm.phone;
   if (vObj.value == "") {
      alert("'Phone Number' can not be empty!");
      vObj.focus();
      return false;
   }
   
   vObj = frm.mailingAddress;
   if (vObj.value == "") {
      alert("'Mailing address' can not be empty!");
      vObj.focus();
      return false;
   }
    
   vObj = frm.mailingCity;
   if (vObj.value == "") {
      alert("'Mailing city' can not be empty!");
      vObj.focus();
      return false;
   }
    
   vObj = frm.mailingState;
   if (vObj.value == "") {
      alert("'Mailing state' can not be empty!");
      vObj.focus();
      return false;
   }
     
   vObj = frm.mailingZipcode;
   if (vObj.value == "") {
      alert("'Mailing ZIP Code' can not be empty!");
      vObj.focus();
      return false;
   }
                                                 
   return true;
 } 
 
 
function check_followup(frm) {
  
  if (frm.strCAPTCHA.value == "")
  {
    alert("Please enter a value in the image.");
    frm.strCAPTCHA.focus();
    return (false);
  }
     
   vObj = frm.client_name;
   if (vObj.value == "") {
      alert("'Name' can not be empty!");
      vObj.focus();
      return false;
   }
   
   vObj = frm.phone;
   if (vObj.value == "") {
      alert("'Phone Number' can not be empty!");
      vObj.focus();
      return false;
   }
   
      
   vObj = frm.email;
   if (vObj.value == "") {
      alert("'Email Address' can not be empty!");
      vObj.focus();
      return false;
   }
   
   
   var S_Option = -1
    for (i=0; i<frm.pr_availability.length; i++) {
       if (frm.pr_availability[i].checked)
          S_Option = i;
    }
    if (S_Option == -1) {
       alert ("What is the press release availability?");
       frm.pr_availability[0].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;
}    
