/*  The getFieldValue function will return the field value (or value list) based on the element type. */
function getFieldValue ( theField, vType ) {
   theValue = ""; 
   sep = ""; 
   hits = 0;
/* The field is of type text. */
   if ( vType == "text" ) return ( theField.value );
/* The field is of type textarea, a string array of one element. */
   if ( vType == "textarea" ) return ( theField[0].value );
/*The field is of type checkboxes or radio buttons. */
   if ( vType == "checkbox" || vType == "radio" ) { 
      if ( theField.value == null ) {
/* If we're here, we are validating a radio button or a multi-element checkbox. */
         for ( i = 0; i < theField.length; i++ ) { 
            if ( theField[i].checked ) { 
               hits++; 
               if ( hits > 1 ) {
                  sep = "; ";
               } 
               theValue += sep + theField[i].value;  
            } 
         }
      } 
      return ( theValue );
   } else {
/* If we are here, must be an ie checkbox, or nn with a one-element checkbox. */
      if ( navigator.appName == "Microsoft Internet Explorer" ) { 
/* I.E. has problems in this area, return some data so we can validate on the server. */
         return ("can't validate on client")
      }
/* nn one-element checkbox, see if its checked. */
      if (theField.checked ) { 
         return ( theField.value ); 
      } else {
         return ( "" ); 
      } 
   } 
/* select is an array of selection pointers to an array of strings representing the choices */
   if ( vType == "select" ) {
      for ( i = 0; i < theField.options.length; i++ ) {
         if ( theField.options[i].selected ) {
            theValue += theField.options[i].text ;
         }
      } 
      return ( theValue );
   }
}