var menu_item = 0; // Home
var menu_path = "./";
var index_path = "";

function IndexItem(text, href, parent) {
	this.text = text;
	this.href = href;
	this.children = new Array();
	if (parent != null)
		parent.children.push(this);
}
var root = new IndexItem("", "", null);
var node = new IndexItem("News", "index.html", root);
node = new IndexItem("About", "about.html", root);
node = new IndexItem("Privacy", "privacy.html", root);
node = new IndexItem("Contact", "contact.html", root);

function setIndex() {
  document.getElementById("index").innerHTML = "\n" + indexChildren(root, "	  ");
}

function indexChildren(node, indent) {
  if (node.children.length == 0)
    return "";
  var html = indent + "<ul class=\"index_list\">\n";
  for (var i = 0; i < node.children.length; i++) {
    html += indent + "  <li><a href=\"" + index_path + node.children[i].href + "\" class=\"index_link\">" + node.children[i].text + "</a></li>\n";
    html += indexChildren(node.children[i], indent + "    ");
  }
  html += indent + "</ul>\n";
  return html;
}