<!--Script

// The method is called from the page onload event.
// A cookie is set to indicate the user has logged in
// successfully.  The login will expire in one hour.
function checkLogin() {

  if (document.loader != null) {

    var user = document.loader.getUser();

    if (user != "") {
      var expdate = new Date ();
      expdate.setTime (expdate.getTime() + (1 * 60 * 60 * 1000)); // 1 hr from now
      SetCookie ("login", user, expdate, "/");
      document.loader.setReady();
      return;
    }

  }

  // Wait 500 ms between checks for page requests.
  // In IE5 this does not seem to work correctly.
  setTimeout("checkLogin()",500);

} // checkLogin


// Check to see if cookie has expired.
// Pass the URL for a file to redirect to if the
// cookie has expired.  You should probably send
// the user back to the login page.
function checkCookie(url) {

  var user = GetCookie("login");

  if (user != null) {
    var expdate = new Date ();
    expdate.setTime (expdate.getTime() + (1 * 60 * 60 * 1000)); // 1 hr from now
    SetCookie ("login", user, expdate, "/");
  }
  else {
    alert("Your previous session has expired.\nYou must start a new session.");
    document.location = url;
  }

} // checkCookie

//-->
