function check_passwords (pw1, pw2)
{
  if (((pw1 != null) || (pw2 != ""))
      && pw2 != "" && pw1 != pw2)
  {
    alert ("The new passwords must be the same.");
    return false;
  }

  return true;
}

function check_us_date (d)
{
  var slash_count = 0;

  if (d.value.length == 0)
    return true;

  if (d.value.length != 10)
  {
    alert ("The "
           + d.desc
	   + " field must be 10 characters long and look like MM/DD/YYYY.");
    return false;
  }

  for (var j = 0; j < d.value.length; j++)
  {
    var c = d.value.charAt (j);

    if (c == '/')
      slash_count++;

    if ((c != '/') && (c < '0' || c > '9'))
    {
      alert ("The "
             + d.desc
	     + " field can only contain numbers and slashes.");
      return false;
    }
  }

  if (slash_count != 2)
  {
    alert ("The "
	    + d.desc
	    + " field must look like MM/DD/YYYY."
	    + " You had too many / characters");
    return false;
  }

  return true;
}

