function getID(id,doc)
{
	if (!doc) doc = document;
	if (document.all) return doc.all[id];
	else return doc.getElementById(id);
}
function findPElem(el,type,dir,mx)
{
	var r = new Array();
	do { if (el.nodeType == 1 && el.tagName.toUpperCase() == type) {
			r[r.length] = el;
			if (r.length>=mx) return r;
		}
		el = el[dir];
	} while(el);
	return r;
}

function handleMnu(e)
{
	var el = !e.target ? e.srcElement:e.target,i; 
	var li = findPElem(el,"LI","parentNode",1);
	if (!li.length || (li[0].className != "dynitm" && li[0].className != "selected")) return;
	var ul = findPElem(el,"UL","nextSibling",1);
	if (!ul.length) return;
	var tul = findPElem(li[0],"UL","parentNode",1);
	if (!tul.length) return;
	var lis = findPElem(tul[0].firstChild,"LI","nextSibling",100);
	var open = (ul[0].style.display == "block") ;
	for (i in lis) {
		var u = findPElem(lis[i].firstChild,"UL","nextSibling",1);
		if (!u.length) continue;
		u[0].style.display = "none";
	}
	if (!open) ul[0].style.display = "block";

}

