function join()
{
  var join = 0;
  var join_text = "This site allows you to lookup UPC codes and get product or company information.\n\n\n"
                + "Anonymous visitors can look up " + AnonymousFree + " codes each day for free.\n"
                + "Visitors using a Key Code get to look up " + MemberFree + " codes each\n"
                + "day for free and may purchase more lookups if needed.\n\n\n"
                + "Would you like more information on getting a free key code or purchasing lookups?";
  join = confirm(join_text);
  if(join) self.location="/?action=account";
}

function remember()
{
  var remember_text = "A cookie is a small bit of data that gets stored on your computer.\n\n\n" 
                    + "In this case, the cookie we store on your computer is your KEY CODE.\n"
                    + "By remembering your KEY CODE in a cookie, each time you come to this\n"
                    + "site, your KEY CODE will be automatically entered into the text box\n"
                    + "so you don't have to type it yourself.\n\n\n"
                    + "This cookie is harmless. But if you share your computer with others\n"
                    + "and you don't want them to share your KEY CODE on this site, you\n"
                    + "should probably not use this feature. Even if you don't use this\n"
                    + "feature, your KEY CODE will be remembered for at least this visit\n"
                    + "using our computer's memory not yours."
  alert(remember_text);
}

function emailchange(oem)
{
  var em = prompt("Enter your new email address","");
  if(em != "" && em != null && em != oem) self.location="/?action=newkey&email=" + em
}

var PassSet = false;
function passwordchange(k,pwd)
{
  var npwd = "";
  var vpwd = "";
  var cpwd = "";
  if(PassSet)
  {
    alert("Your password has already been set. You must reload this page before you can change it again.");
  }
  else
  {
    cpwd = prompt("Before changing your password, please enter your current password","");
  }
  if(cpwd != "" && cpwd != null)
  {
    if(cpwd != pwd)
    {
      alert("Password doesn't match our records");
    }
    else
    {
      npwd = prompt("Now enter your new password","");
      if(npwd != "" && npwd != null)
      {
        vpwd = prompt("Finally, verify your new password","");
        if(npwd != vpwd)
        {
          alert("Verification password doesn't match your new password");
        }
        else
        {
          PassSet = true;
          var pic1 = new Image(1,1); 
          pic1.src="/?action=newpass&key=" + k + "&pwd=" + npwd;
          alert("Your password has been changed.");
        }
      }
      else
      {
        alert("Password change aborted");
      }
    }
  }
}