function RegisterForm_Validator(theForm, val)
{
  
  Eventjs = theForm.Eventjs.value
  
  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);
  }
  
  strError = validateEmail(theForm.strEmail.value) 
  if (strError != "") {
		alert(strError);
    	theForm.strEmail.focus();
    	return (false);
  }
  
  if (theForm.strCompanyName.value == "")
  {
    alert("Please enter a value for the \"CompanyName\" field.");
    theForm.strCompanyName.focus();
    return (false);
  }
  
  if (theForm.strRegistrationType) {
	  flag = 0;
	  if (theForm.strRegistrationType.length > 1) {
		  for (i=0; i < theForm.strRegistrationType.length; i++) {
			if (theForm.strRegistrationType[i].checked) {
				flag += 1;
				break;
			}
		  }
	  } else if (theForm.strRegistrationType.checked){
		  flag += 1;
 	  }

	  if (flag == 0) {
		alert("Please select a Registration Type.");
		return (false);
	  } 
  }
 
 /*adjust the [] number in the box to correspond to the number for sponsor registration type */
  num = 4
  if (Eventjs == 11) {
  	num = 6
  } else if (Eventjs == 13) {
  	num = 2
  }
  
  if (theForm.strRegistrationType[num]) {
	  if ( (theForm.strRegistrationType[num].checked) && (theForm.strSponsor.value == ""))
	  {
	    alert("Please select a \"Sponsor/Exhibitor\" .");
	    theForm.strSponsor.focus();
	    return (false);
	  }
  }
  
  /*  
  if (theForm.strMiscellaneous.value == "")
  {
    alert("Please fill in your \"Wind Shirt size\".");
    theForm.strMiscellaneous.focus();
    return (false);
  } */
  
  
  theForm.action.value = val
  
  return (true);  
}
