    // ErrorHandler.js - functions to deal with errors
    // this has been necessary since setting focus from on onchange event does not
    // work in I.E. 6.0.  Setting focus from an onblur event does work, but onblur
    // triggers when I don't want it to.  For example, I use a "return to menu" button
    // so that the user can just bail from the form.  I don't want the user to click
    // return to menu and then get an error message stating that a validation rule
    // has failed.
    // So now, I will use the onchange event to check for errors.  If an error is found
    // the field that triggered the error will be saved.  Then the next field will have
    // an onfocus event handler that will check to see if an error occurred on the last
    // field.  If so, focus will be set back to the field that caused the error

    var ErrorField;
    var ErrorOccurred = false;

    function SetError(field, message)
    {
// alert("field: " + field + " Message: " + message);
      var eloc = field.name + '_Error';
      var emsg = field.name + '_Errmsg';
      errmsg = document.getElementById(emsg);
      if  (errmsg)
      {
//        if (document.getElementById(field.id)) positionElement(field.id, eloc);
        errmsg.innerHTML = message + "<span onmousedown=" +
               '"document.getElementById(' + "'" + field.name + 
               "_Errmsg').innerHTML = '';" + 
               '" class="pointer">&nbsp; &nbsp; X</span>';
      }
      else
      {
        alert(message);
      }

      ErrorField = field;
      ErrorOccurred = true;
    }
    
    function ClearError(field)
    {
      var eloc = field.name + '_Error';
      var emsg = field.name + '_Errmsg';
      errmsg = document.getElementById(emsg);
      errmsg.innerHTML = '';
      ErrorField = '';
      ErrorOccurred = false;
    }
    
    function CheckError()
    {
      if (!ErrorOccurred) return;
      var tmp1 = ErrorField;
      var tmp = ErrorField.type;
      if ((ErrorField.type == "text") || (ErrorField.type == "textarea"))
      {
        tmp1.focus();
        tmp1.select();
      }
      ErrorOccurred = false;
    }