function ContactUsForm_Validator(theForm)
{

  strError = validateEmail(theForm.strEmail.value)
  if (strError != "") {
		alert(strError);
    	theForm.strEmail.focus();
    	return (false);
  }
  
  
 if (theForm.strFirstName.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.strFirstName.focus();
    return (false);
  }
  
  if (theForm.strLastName.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.strLastName.focus();
    return (false);
  }
  
  if (theForm.strCompanyName){
  
  if (theForm.strCompanyName.value == "")
  {
    alert("Please enter a value for the \"Organization Name\" field.");
    theForm.strCompanyName.focus();
    return (false);
  }
  
  }
   /*
   if (theForm.strStreet.value == "")
  {
    alert("Please enter a value for the \"Street\" field.");
    theForm.strStreet.focus();
    return (false);
  }
  
 if (theForm.strCity.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.strCity.focus();
    return (false);
  }
  
  if (theForm.lngStateID){
	  if (theForm.lngStateID.value == "0")
	  {
	    alert("Please select a \"State\".");
	    theForm.lngStateID.focus();
	    return (false);
	  }
  }
  
  if (theForm.strZIP.value == "")
  {
    alert("Please enter a value for the \"Postal Code\" field.");
    theForm.strZIP.focus();
    return (false);
  }
  

 flag = 0
  
  if (theForm.strPhoneArea.value != "" && theForm.strPhone.value !="") {
  	strError = validatePhone(theForm.strPhoneArea.value, theForm.strPhone.value)
  	if (strError != "") {
		alert(strError);
    	theForm.strPhone.focus();
    	return (false);
  	}
	flag = 1
  }
  
  if (theForm.strPhoneArea2.value != "" && theForm.strPhone2.value !="") {
  	strError = validatePhone(theForm.strPhoneArea2.value, theForm.strPhone2.value)
  	if (strError != "") {
		alert(strError);
    	theForm.strPhone2.focus();
    	return (false);
  	}
	flag = 1
  }
  
  if (theForm.strCellArea.value != "" && theForm.strCell.value !="") {
  	strError = validatePhone(theForm.strCellArea.value, theForm.strCell.value)
  	if (strError != "") {
		alert(strError);
    	theForm.strCell.focus();
    	return (false);
  	}
	flag = 1
  }
  
  if (theForm.strFaxArea.value != "" && theForm.strFax.value !="") {
  	strError = validatePhone(theForm.strFaxArea.value, theForm.strFax.value)
  	if (strError != "") {
		alert(strError);
    	theForm.strFax.focus();
    	return (false);
  	}
	flag = 1
  }
  
  if (flag == 0) {
  	alert("Please enter atleast one \"Phone No\".");
    theForm.strPhoneArea.focus();
    return (false); 
  }
  
  */
  
  link = new Array()
  link[0] = theForm.link1.value;
  link[1] = theForm.link2.value;
  link[2] = theForm.link3.value;
  
  for (i = 0; i < link.length; i++){
 
	  if (link[i] != "") {
	  
		var fileext = "";
		
		if (link[i].lastIndexOf(".") != -1) {
			fileext = (link[i].substring(link[i].lastIndexOf(".") + 1, link[i].length)).toLowerCase();
		}
		
		if (!(fileext == "pdf" || fileext == "doc" || fileext == "jpg" || fileext == "gif" || fileext == "dwg" || fileext == "dwf")) {
			alert("Please upload only pdf, doc, jpg, jpeg, gif, dwg, or dwf files for  \"Attachment\" " + (i+ 1));
			return (false);
		}
		
	  }
  }
  
  strImageVal = theForm.strImage.value.toLowerCase()
  if (strImageVal != "bub7d") {
  	strError = "Security Check Failed! Please type the letters that you see into the space provided."
  	if (strError != "") {
		alert(strError);
    	theForm.strImage.focus();
    	return (false);
  	}
  }
  
   return (true);  
}
