
// For older browsers
 function verify(theForm)
 {
  // checks if the e-mail address is valid --([A-Za-z]\w*(\.[A-Za-z]\w*))
  var emailStr = theForm.email.value;
  var emailPat = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 
  var matchArray = emailStr.match(emailPat);
  
   if (theForm.firstName.value == "")
  {
     alert("Please enter a value for the \"First Name\" field.");
     theForm.firstName.focus();
     return (false);
  }
  
  if (theForm.lastName.value == "")
  {
     alert("Please enter a value for the \"Last Name\" field.");
     theForm.lastName.focus();
     return (false);
  }
    if (theForm.email.value == "")
  {
     alert("Please enter a value for the \"E-mail\" field.");
     theForm.email.focus();
     return (false);
   }   
   if (matchArray == null)
  { 
	  alert("Your e-mail address seems incorrect. Please try again (check the '@' and '.'s in the e-mail address)"); 
	  theForm.email.focus();
	  return false; 
  } 
/*   // make sure the IP address domain is valid  */
/*   var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);  */
/*   if (IPArray != null) */
/*   {  */
/* 	  for (var i=1;i<=4;i++)  */
/* 	  {  */
/* 		  if (IPArray[i]>255)  */
/* 		  {  */
/* 			  alert("Destination IP address is invalid!");  */
/* 			  return false;  */
/*   		}  */
/* 		}  */
/*   }  */


  if (theForm.employer.value == "")
  {
    alert("Please enter a value for the \"Company Name\" field.");
    theForm.employer.focus();
    return (false);
  }
  
    if (theForm.industryId.selectedIndex == "")
    {
        alert("Please enter a value for the \"Primary Industry\" field.");
        theForm.industryId.focus();
        return (false);
    }
  
    if (theForm.job_level.selectedIndex == "")
    {
        alert("Please enter a value for the \"Job Level\" field.");
        theForm.job_level.focus();
        return (false);
    }
    
    if (theForm.department.selectedIndex == "")
    {
        alert("Please enter a value for the \"Department\" field.");
        theForm.department.focus();
        return (false);
    }

return (true);
}
