function validate(theForm) {
   //...  Validate the entire form...
   var retval;         //...  return value...
   var errnum;         //...  error count...
   var errmsg;         //...  error message(s)...
   var i;              //...  just a counter...

   //...  Initialize error indicators...
   retval = true;
   errnum = 0;
   errmsg = "";
   user_specs = "";

   //...  Trim the fields...
   theForm.user_name.value = trim(theForm.user_name.value);
   theForm.password.value = trim(theForm.password.value);

   //...  Validate the user name...
   if (isEmpty(theForm.user_name.value)) {
      //...  Return an error...
      errnum++;
      errmsg += "\n" + errnum + ")  User Name MUST be entered.";
      if (errnum == 1) {
         theForm.user_name.focus();
         theForm.user_name.select();
      }
   }

   //...  Validate the password...
   if (isEmpty(theForm.password.value)) {
      //...  Return an error...
      errnum++;
      errmsg += "\n" + errnum + ")  Password MUST be entered.";
      if (errnum == 1) {
         theForm.password.focus();
         theForm.password.select();
      }
   } else {
      //...  Encrypt the password...
//      theForm.password.value = hex_md5(theForm.password.value);
//      errmsg += "\nPassword is " + theForm.password.value;
   }

   //...  Check for any errors...
   if (errnum > 0) {
      //...  Indicate errors and display all messages...
      retval = false;
      errmsg = "PLEASE CORRECT THE FOLLOWING:\n" + errmsg;
      alert(errmsg);
   }

   //...  Return to the caller...
   return retval;
}

