var __INC_USERS = true;
var __LOGIN_TTL = 48;

var ACL=new Array();
// c88MakeUser("[MD5 Hash of Password]","[RC4 Location of Client Page]");
// Don't put "/" at start if destination is in a sub directory

// Description = Password Management - DO NOT DELETE OR CHANGE
c88MakeUser("4e3be1726257a156beeffea54a90bf03","9FQ8ZP9L5wScFIREt3PzZTOtbqLP");

c88MakeUser("cfaeedafb0f237713be626aabca45ee1","/zmawSLlInon9D");

function c88Login() {
  pw=document.getElementById("c88LoginPass").value;
  if (c88ValidUser(pw)) {
    if (c88AuthLogin(pw)) {
      delCookie("wsPass");
      setCookie("wsPass",toBase64(rc4("POM",pw)),__LOGIN_TTL);
      window.location.href=rc4(pw,fromBase64(ACL[md5(pw)]));
    } else {
      delCookie("wsPass");
      window.location.href="failure.html";
    }
  }
}

function c88Logout() {
  delCookie("wsPass");
  window.location.reload(true);
}

function c88ValidUser(pw) {
  if (pw.match(/\W/)!=null) return(false);
  return(true);
}

function c88AuthLogin(pw) {
  pwMD5=md5(pw);
  if (typeof(ACL[pwMD5])!="undefined")
    return(true);
  else
    return(false);
}

function c88MakeUser(pwMD5,html) {
  if (typeof(ACL[pwMD5])=="undefined")
    ACL[pwMD5]=html;
}

function __c88AuthUser() {
  var pw;
  if ((pw=getCookie("wsPass"))!=null)
    if (c88AuthLogin(rc4("POM",fromBase64(pw))))
      return(true);
  return(false);
}
