 


//findPos function is from http://www.quirksmode.org/js/findpos.html;
//where its workings are explained in more detail.
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+15];
}

//Display a named <strong class="highlight">menu</strong>, at the position of another object
function display_menu(parent,named)
{
  //get the named <strong class="highlight">menu</strong>
	var menu_element = document.getElementById(named);
         
	//override the 'display:none;' style attribute
	menu_element.style.display = "";
	//get the placement of the element that invoked the <strong class="highlight">menu</strong>...
	var placement = findPos(parent);
	//...and put the <strong class="highlight">menu</strong> there
	menu_element.style.left = placement[0] + "px";
	menu_element.style.top = placement[1] + "px";	
}

//Hide a named <strong class="highlight">menu</strong>
function hide_menu(named)
{
	//get the named <strong class="highlight">menu</strong>
	var menu_element = document.getElementById(named);
	//hide it with a style attribute
	menu_element.style.display = "none";
}
 


 
 
