function menuinit() {

	atags =	document.getElementsByTagName("td");

	i=0;


	while (atag = atags[i]) {

		if (atag.className == "topcat") {
			atag.onclick = expandfunc;
		}

		if(atag.id) {
			atag.onmouseover = testover;
			atag.onmouseout = testout;
		}

		i++;
	}

	function expandfunc(e) {

		if (!e) var e = window.event;

		target = e.target;
		if (!target) target = e.srcElement;

		hidefunc();

		if(document.getElementById(target.id+"_sub")) {

			document.getElementById(target.id).className = "over";
			document.getElementById(target.id+"_sub").style.display = "block";
		}

	}

	function hidefunc() {
	
		trtags = document.getElementsByTagName("table");

		i=0;
		while (trtag = trtags[i]) {		
			if (trtag.className == "showhide") trtag.style.display = "none";
		        i++;
		}

		tdtags = document.getElementsByTagName("td");

		i=0;
		while (tdtag = tdtags[i]) {		
			if (tdtag.className == "over") tdtag.className = "";
		        i++;
		}

	}

	document.body.onclick = clickhidefunc;

	function clickhidefunc(e) {
		if (!e) var e = window.event;
		target = e.target;
		if (!target) target = e.srcElement;
		if (target.className != "over") hidefunc();
	}

	function testover() {
		this.className = "over";
	}

	function testout() {
		this.className = "";
	}

}

