
function showMenu(menu)
{
	var el = document.getElementById("div_menu_"+menu)
	var posArray = findPos(el);
	var widthEl = parseInt(el.offsetWidth);
	if(widthEl<85) {widthEl=85;}
	var menuDiv = document.getElementById("menu_" + menu);
	menuDiv.style.left=posArray[0]+"px";
	menuDiv.style.top=posArray[1]+"px";
	menuDiv.style.display="block";
	menuDiv.childNodes[0].style.width=widthEl+1+"px";
	for (var i=0; i<menuDiv.childNodes[0].childNodes.length;i++)
	{
		menuDiv.childNodes[0].childNodes[i].style.width=widthEl+1+"px";
	}

	menuDiv.style.height=30+"px";
}
function hideMenu(menu) {
	var menuDiv = document.getElementById("menu_" + menu);
	menuDiv.style.display="none";
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
