function CheckD2W() {
  return true;
  var checked = location.href.indexOf("d2wissen.d2chars.de") != -1;
  if (!checked)
    top.location = "http://d2wissen.d2chars.de/";
  return checked;
}

function CheckForward(toplevel) {
  if (!top.forward || top.forward.length == 0)
    return;
  var start = top.forward.indexOf("d2wissen.d2chars.de/") + 20;
  var slashpos = top.forward.indexOf("/", start);
  if (slashpos == -1) {
    top.forward = "";
    return;
  }
  var d = top.forward.substring(start, slashpos);
  start = slashpos + 1;
  slashpos = top.forward.indexOf("/", start);
  var version = slashpos == -1 ? "" : top.forward.substring(start, slashpos + 1);
  if (toplevel) {
    var x = version + "index";
    if (top.forward.indexOf("-x.html") != -1)
      x += "-x";
    x += ".html";
    if (d == "chars" || d == "items" || d == "levels" || d == "monster" || d == "npcs" || d == "quests")
      top.mainwindow.location.replace(d + "/" + x);
    else {
      top.mainwindow.location.replace(top.forward);
      top.forward = "";
    }
  }
  else
    if (!top.mainwindow.main) {
      window.setTimeout("CheckForward()", 1);
      return;
    }
    else {
      if (top.mainwindow.nav.location.href.indexOf(d) != -1)
        top.mainwindow.main.location.replace(top.forward);
      top.forward = "";
    }
}

function CheckTop() {
  if (CheckD2W() && !top.frames.d2w_nav && window.name != "ps" && location.href.indexOf("d2wissen.d2chars.de/") != -1)
    top.location.replace("http://d2wissen.d2chars.de/?start=" + location.href);
}

function getParameter(pstring, param) {
  var start = pstring.indexOf("&" + param + "=");
  if (start == -1)
    if (pstring.substr(0, param.length + 1) == param + "=")
      start = param.length + 1;
    else
      return "";
  else
    start = start + param.length + 2;
  var end = pstring.indexOf("&", start);
  if (end == -1)
    end = pstring.length;
  return pstring.substring(start, end);
}
  
