 
 function hoverMenu(obj, color) {
 	obj.style.backgroundColor = '#' + color;
 }
 function unhoverMenu(obj) {
 	obj.style.backgroundColor = '';
 }
 
function showMenu() {
	var parent = document.getElementById(this["parent"]);
  	var child = document.getElementById(this["child" ]);
  	
  	//if(child.id == "submenulegende") {
  		
  		var top  = parent.offsetHeight+2;
  		var left = 0;
  		var a = parent;
 		
  		for (; a; a = a.offsetParent) {
    		top  += a.offsetTop;
    		left += a.offsetLeft;
  		}
  		left = left + 1;
  		top = top - 2;
  		child.style.top        = top +'px';
  		child.style.left       = left+'px';
  		
  	//}  	
  	
  	child.style.display = '';
  	parent.style.backgroundColor = '#494949';
  	clearTimeout(child["timeout"]);
}

function hideMenu() {
	var parent = document.getElementById(this["parent"]);
  	var child = document.getElementById(this["child"]);
  	parent.style.backgroundColor = '';
  	child["timeout"] = setTimeout("document.getElementById('"+child.id+"').style.display = 'none'", 115);
} 
 
 function handleMenu(parent, child) { 	
  
 	var p = document.getElementById(parent);
  	var c = document.getElementById(child);
  	 	
  	p["parent"]     = p.id;
  	c["parent"]     = p.id;
  	p["child"]      = c.id;
  	c["child"]      = c.id;
  	
  	//c.style.display = "none";  	
 	
    p.onmouseover = showMenu;
    p.onmouseout  = hideMenu;
    c.onmouseover = showMenu;
    c.onmouseout  = hideMenu;
 }