  /////////////////////////////////////////////////////
  //
  // bValidateForm() - validate fields in enquiry form
  //                   highlight captions for invalid/missing
  //                   fields, and move focus to first one.
  //
  // NB. Moving the focus to the first invalid field BEFORE
  //     displaying the alert gets round the IE timing bug!
  //
  function bValidateForm(form)
    {
    //alert("Validating form...");

    var bValid = true;
    var caption;

    // Enquiry text...
    caption = document.getElementById("cap_message");
    if (bIsEmpty(form.sMessage))
      {
      caption.style.color = "#FF4040";
      form.sMessage.focus();
      bValid = false;
      }
    else
      caption.style.color = "#EEEEEE";

    // Email address...
    caption = document.getElementById("cap_email");
    if (bIsEmpty(form.sEmail))
      {
      caption.style.color = "#FF4040";
      form.sEmail.focus();
      bValid = false;
      }
    else
      caption.style.color = "#EEEEEE";

    // Name...
    var caption = document.getElementById("cap_name");
    if (bIsEmpty(form.sName))
      {
      caption.style.color = "#FF4040";
      form.sName.focus();
      bValid = false;
      }
    else
      caption.style.color = "#EEEEEE";

    // tell Sir if he goofed...
    if (!bValid)
      alert("Please fill in the boxes marked in red.");
    return bValid;
    }

  function bIsEmpty(elem)
    {
    var str = elem.value;
    if (str == null || str.length == 0)
      return true;
    else
      return false;
    }

  function bIsValidRadio(elem)
    {
    for (var i = 0; i < elem.length; i++)
      {
      if (elem[i].checked)
        return true;
      }
    return false;
    }
  //
  // End of File //////////////////////////////////////
