function ValidateForm(inForm) {

  //"Global" arrays for radio groups AND checkboxes
  var choiceGroups = new Array()
  var chosen = new Array()

  //Regular Expression for null string/white space
  var noText = /^\s?$/

  for (var i = 0; i < inForm.elements.length; i++) 	{

    var formField = inForm.elements[i]
    var fieldType = formField.type
    var fieldName = formField.name
    var fieldValue = formField.value


    if (fieldType.substring(0,4) == "text") {		//Text box or text area	
      if (noText.test(fieldValue)) {			//Returns true if null string or white space
        alert("Please Fill Out All Form Fields")	
        return false
      }
    } 


    // Because first option in a drop down menu is always selected
    // This routine assumes first option is not assigned a value
    // Otherwise drop down menus would always pass test even if user didn't actively make a selection

    if (fieldType.substring(0,6) == "select") {				//Select one OR many
      var valueSelected
      for (var option = 0; option < formField.length; option++) {	//Step through each menu option
        var menuOption = formField.options[option]
        
        if (!valueSelected) {				
          // Only (re)assign when false to retain value if true
          valueSelected = (!noText.test(menuOption.value)) && menuOption.selected
          // Both tests must be true for ValueSelected to be true
        }

      }
      if (!valueSelected) {
        alert("Please Fill Out All Form Fields")
        return false
      }        
    } 


    // Creates two parallel arrays for each group of radio buttons or checkboxes
    // One with the name of the group, the other indicating if a value was selected

    if (fieldType == "radio" || fieldType == "checkbox") {

      if (choiceGroups.length == 0) 			{
        choiceGroups[0] = fieldName		//Enters very first group name and value encountered
        chosen[0] = formField.checked

      } else {					//If not the very first check if already in the name array
        for (var j = 0; j < choiceGroups.length; j++) 	{

          if (fieldName == choiceGroups[j]) 		{	// If in the name array only update value array
            if (!chosen[j]) {
              // Only (re)assign when false to retain value if true
              chosen[j] = formField.checked
            }
            break
          }

          if (j == choiceGroups.length - 1) 		{	// Add name to array as it wasn't found
            choiceGroups[choiceGroups.length] = fieldName
          }

        } //for
      } //else
    } //radio or checkbox

  }//for i < inForm.elements.length 


  // Check each radio and/or checkbox group
  for (var k = 0; k < choiceGroups.length; k++) {
    if (!chosen[k]) {
      alert("Please Fill Out All Form Fields")
      return false
    }
  }

  // Only reach here if haven't returned false with an error alert
  return true 

} // End of function and script