//config of all submenu's
menu = new Array();
menu['menu_1'] = "&nbsp;&nbsp; <a href=\"sortiment-1.html\">Innenbereich</a><br />&nbsp;&nbsp; <a href=\"grabmale.html\">Grabmalbereich</a>";


/**
* VOID getSubMenu(OBJECT_EVENT e)
*	Checks the object below the mouse pointer and determins
*	if the subMenuDiv should be shown with what content.
*/
function getSubMenu(e){
	//get object from mouse position.
	subObj = obj = document.all ? event.srcElement : e.target;
	//get submenu object.
	subMenuObj = document.getElementById ? document.getElementById('subMenuDiv') : document.all.subMenuDiv;
	
	//check if the pointer is in an menu object or not.
	foundSubDiv = false;
	while(obj){
		if(obj.id == subMenuObj.id)
			foundSubDiv = true;
		obj = obj.offsetParent;
	}
			
	if(foundSubDiv == false){
		if(menu[subObj.id]){
			//determin width, top position and left position.
			t = subObj.offsetTop + subObj.offsetHeight;
			l = subObj.offsetLeft;
			
			//patch top and left when we are in an other object.
			obj = subObj;
			while(obj.offsetParent){
				t += obj.offsetParent.offsetTop;
				l += obj.offsetParent.offsetLeft;
				obj = obj.offsetParent;
			}
			
			//set DIV mesurements and position.
			subMenuObj.style.top = t-6;
			subMenuObj.style.left = l;
			//subMenuObj.style.width = subObj.offsetWidth; //remark this line and set the width in the DIV style, for static width.
			
			//push right content and make DIV visible
			subMenuObj.innerHTML = menu[subObj.id];
			subMenuObj.style.visibility = 'visible';
		}else{
			//hide the thing and clean up.
			subMenuObj.style.visibility = document.all ? 'hidden' : 'hide';
			subMenuObj.innerHTML = "";
		}
	}
}

//read mouse position.
document.onmousemove = getSubMenu;
