  var hi = "yellow";
  var lo = "white";
  var waitID = 0;
  mage = new Array();

  function thing(left, top, ob, parent, im, ty) {
    mage[ob] = new Array();
    document.write("<a target=\"main\" href=" + ob);
    if (ty==undefined) document.write(".htm>"); else document.write("." + ty + ">");
    document.write("<p class=menu id=" + ob + " style=\"color=" + lo + ";");
    if (parent!=undefined) {
        document.write(" visibility=hidden;");
	mage[ob]["parent"] = parent;
	var sub = mage[parent]["sub"];
	if (sub==undefined) {
	   mage[parent]["sub"] = new Array;
	   mage[parent]["sub"][0] = ob;
	} else {
            var ix = 0;
            while (sub[ix]!=null) ix = ix+1;
            sub[ix] = ob;
	}
    }
    document.write(" left:" + left + "px; top:" + top + "px\"");
    document.write(" onmouseover=\"hilight(this)\"");
    document.write(" onmouseout=\"unlight(this)\"");
    document.write(">");
    if (im==undefined) document.write(ob); else document.write(im);
    document.write("</p></a>");
  }

  function hideall() {
    for (i in mage) for (j in mage[i]["sub"])
      document.getElementById(mage[i]["sub"][j]).style.visibility='hidden';
    clearInterval(waitID);
  }

  function visit(th) {
    for (i in mage[th]["sub"])
      document.getElementById(mage[th]["sub"][i]).style.visibility='visible';
  }

  function hilight(ob) {
    hideall();
    ob.style.color = hi;
    if (mage[ob.id]["parent"]==undefined) visit(ob.id);
    else                                  visit(mage[ob.id]["parent"]);
  }

  function unlight(ob) {
    ob.style.color = lo;
    waitID = setInterval("hideall()", 500);
  }
