// MoreInfoBox may appear more than once in a page with different content, 
// so reference with different IDs for hide and show function calls.

function getObj(ID){
	obj=document.getElementById(ID)
	return obj
}
function DisplayMoreInfoBox( e , ID){
	var mouse_coords = GetMouseCoords(e);
	if (!ID){ID='More_Info_Box'}
	var obj = getObj(ID);
	if(obj){
		obj.style.zIndex = 10;
		obj.style.display = 'block';
		obj.style.left = "" + mouse_coords[0] + "px";
		obj.style.top = "" + mouse_coords[1] + "px";
	} else {alert(ID+' does not exist in the page.\nPlease wait for the page to finish loading.')}
//	alert("running");
}

function HideMoreInfoBox(ID){
	if (!ID){ID='More_Info_Box'}
	var obj = getObj(ID);
	obj.style.display='none';
//	alert("running");
}


function GetMouseCoords ( e ){
	var posx = 0;
	var posy = 0;
	if (!e) {
		//alert("not e");
		var e = window.event;
	}
	if (e.pageX || e.pageY) 	{
		posx = e.pageX-120;
		posy = e.pageY+10;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft -120;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop + 10;
	}
	return new Array(posx, posy);
}
