window.onload = function() {
  var hash = window.location.hash;
  if (hash.search("#") > -1) {
    hash = hash.replace("#", "");
    show(hash);
  }
}

function show(id) {
  $ps("features").style.display = "none";
  $ps("faqs").style.display = "none";
  $ps("bibles").style.display = "none";
  $ps("versions").style.display = "none";
  $ps("screenshots").style.display = "none";

  $ps(id).style.display = "";
}

function $ps(identifier, kind) {
  if (kind == null || kind == "id") {return document.getElementById(identifier);}
  else if (kind == "name") {return document.getElementsByName(identifier);}
  else if (kind == "tag") {return document.getElementsByTagName(identifier);}
  else if (kind == "class") {
    var elements = [];
    var objects = $("*", "tag");
    for (dollarInt = 0; dollarInt < objects.length; dollarInt++) {
      if (objects[dollarInt].className) {
        var classes = objects[dollarInt].className.split(" ");
        if (uber.array.contains(identifier, classes)) {
          elements.push(objects[dollarInt]);
        }
      }
    }
    return elements;
  }
  else if (kind == "rel") {
    var elements = [];
    var objects = $("*", "tag");
    for (dollarInt = 0; dollarInt < objects.length; dollarInt++) {
      if (objects[dollarInt].getAttribute("rel")) {
        if (objects[dollarInt].getAttribute("rel") == identifier) {
          elements.push(objects[dollarInt]);
        }
      }
    }
    return elements;
  }
  else {return false;}
}
