function show_menu(table_element,nav_element,subnav) {

	var menu;
	menu = document.getElementById('top_nav_about');
	if(nav_element != menu)
		menu.style.display = 'none';
	menu = document.getElementById('top_nav_patients');
	if(nav_element != menu)
		menu.style.display = 'none';
	menu = document.getElementById('top_nav_medical_professionals');
	if(nav_element != menu)
		menu.style.display = 'none';

	menu = document.getElementById(table_element);
	var location = findPos(nav_element);

	location[0] = location[0] + 1;
	location[1] = location[1] + 40;
	
	if(subnav) {
		 location[0]+=201;
		 location[1]-=40;
	}

	menu.style.position = 'absolute';
	menu.style.left = location[0] + 'px';
	menu.style.top = location[1] + 'px';
	menu.style.display = 'inline';
}

function hide_menu(table_element) {
	setTimeout("document.getElementById('" + table_element +"').style.display = 'none';",4000);
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return [curleft,curtop];
	}
}
