/**
 * Verify registration data before submitting the form.
 */
function verifyRegistration()
  {
    theForm = document.registrationForm;
    var msg;
    var isValid = true;

    // FOR TESTING PURPOSES
    // return true;

    msg  = "Invalid form data.  Please correct and re-submit.\n";
    msg += "___________________________________________________________________\n\n";

    // company info
    var userId, password1, password2, emaiAddr, baseCurrencyCode;

    userId = document.getElementById("userIdId");
    if (userId.value == "" || userId.value.length < 6 || userId.value.length > 20)
      {
        isValid = false;
        msg += "- Please enter a valid User ID. (6-20 characters)\n\n";
      }

    password1 = document.getElementById("password1Id");
    if (password1.value == "" || password1.value.length < 6 || password1.value.length > 20)
      {
        isValid = false;
        msg += "- Please enter a valid Password. (6-20 characters)\n\n";
      }
    else
      {
        password2 = document.getElementById("password2Id");
        if (password2.value == "")
          {
            isValid = false;
            msg += "- Please retype password.\n\n";
          }
        if (password1.value != password2.value)
          {
            isValid = false;
            msg += "- Passwords do not match.  Please retype\n\n";
          }
      }

    baseCurrencyCode = document.getElementById("baseCurrencyCodeId");
    if (baseCurrencyCode.value == "")
      {
        isValid = false;
        msg += "- Please select a Default Base Currency.\n\n";
      }

    if (isValid)
        return true;
    else
      {
        alert(msg);
        return false;
      }
  }
