/*
	Expandable Listmenu Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/
function initMenus() {
	if (!document.getElementsByTagName) return;
	var aMenu = document.getElementsByTagName("LI");
	for (var ii = 0; ii < aMenu.length; ii++) {
		var mcx = aMenu[ii].className;
		var inhtml = aMenu[ii].innerHTML;
		if (inhtml.indexOf("Newspaper Info") > -1)
			mcx = "treenode closed";
		if (mcx.indexOf("treenode") > -1) {
			var smx = aMenu[ii].childNodes;
			for (var jj = 0; jj < smx.length; jj++) {
				//if ((smx[jj].tagName == "A") && (smx[jj].id == '0' || smx[jj].id == '1')) {
				if ((smx[jj].tagName == "A")) {
					smx[jj].onclick = function() {
						var ndx = this.nextSibling;
											
						while (1) {
							if (ndx != null) {
								if (ndx.tagName == "UL") {
									var dstyle = (ndx.style.display == "none")
									ndx.style.display = (dstyle) ? "block" : "none";
									this.className = (dstyle) ? "b" : "a";
									return false;
								}
								ndx = ndx.nextSibling;
							} else {
								return false;
							}
						}
						return false;
					}
					smx[jj].className = (mcx.indexOf("open") > -1) ? "b" : "a";
				}
				
				if (smx[jj].tagName == "UL")
					smx[jj].style.display = (mcx.indexOf("open") > -1) ? "block" : "none";
			}
		}
	}
	var aLinks = document.getElementsByTagName("A");
	for (var jj=0; jj< aLinks.length; jj++) {
		if (aLinks[jj].id == '1')
			aLinks[jj].onclick();
	}

}

