function showChildren(id) {
	var element = document.getElementById("menuItem"+id);
	request("mainId="+id, "getchildren.php", function(req) {
		displayChildMenu(element, req.responseText);
	})
}

function hide(id) {
	document.getElementById(id).style.visibility = "hidden";
}

function displayChildMenu(mother, contents) {
	if(contents == "Empty") {
		return;
	}
	var div2 = document.getElementById("child"+mother.id);    if(div2 == null) {        div2 = document.createElement("DIV");        div2.className = "menu";        div2.id = "child" + mother.id;        div2.style.zIndex = "500";        div2.style.padding = "0";
		div2.style.width = "120px";        div2.style.border = "none";        div2.style.position = "absolute";        div2.style.overflow = "hidden";    }
    div2.timerId = 0;
    div2.hide = function() {hide(div2.id);};
	div2.onmouseout = function() {
		div2.timerId = setTimeout(div2.hide, 1000);
	};
	div2.onmouseover = function() {
		if(div2.timerId != 0) {
			clearTimeout(div2.timerId);
		}
		if(mother.timerId != 0) {
			clearTimeout(mother.timerId);
		}
	};
	div2.innerHTML = contents;    div2.style.visibility = "visible";    positionBelowParent(div2, mother);    document.body.appendChild(div2);
}

function positionBelowParent(div, parent) {    div.style.left=calculateOffsetLeft(parent)+"px";    div.style.top=calculateOffsetTop(parent)+parent.offsetHeight-1+"px";}function calculateWidth(parent) {    return parent.offsetWidth;}function calculateOffsetLeft(element){  return calculateOffset(element,"offsetLeft") + 75;}function calculateOffsetTop(element){  return calculateOffset(element,"offsetTop") +1;}function calculateOffset(element,attribute){  var kb=0;  while(element){    kb+=element[attribute];     element=element.offsetParent  }  return kb}