function contains(a,b)
{
	// we climb through b parents
	// till we find a
 	while(b && (a!=b) && (b!=null))
		b = b.parentNode;
	return a == b;
}
var lastmenu=null;
function PopMenu(a) {
	if (document.getElementById) { /* DOM3 = IE5, NS6 */ 
		//tdtype=document.getElementById("ImgCell").style.display
		nomenu();
		lastmenu=document.getElementById(a);
		lastmenu.style.display="block";
		return false;
	} else {
		return true;
	}
}
function menuout(ev) {
	if(!ev)
		ev=window.event;
	tgt = ev.srcElement || ev.target
	if (lastmenu!=null) {
		if (!contains(lastmenu.parentNode, tgt)) {
			nomenu();
		}
	}
}
function nomenu() {
	if (lastmenu!=null) 
		lastmenu.style.display="none";
}