var tempX = 0
var tempY = 0

function getMouseXY(e)
{
	var IE = document.all?true:false

	if (IE)
	{
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}
	else
	{
		tempX = e.pageX;
		tempY = e.pageY;
	}

	// catch possible negative values in NS4
	if (tempX < 0) {tempX = 0;}
	if (tempY < 0) {tempY = 0;}

	return true
}
function getInfoElement()
{
   	if (document.getElementById)
   		obj = document.getElementById('div_info');
   	else
   		obj = document.all["div_info"];

	return obj;
}
function setInfo(obj, str)
{
	obj.innerHTML='<FONT CLASS=classic><B> '+str+' </B></FONT>';
}
function show_info(str, event)
{
	obj = getInfoElement();
	setInfo(obj, str);
	getMouseXY(event);
	show_infoxy(str, tempX, tempY);
}
function show_info_oncenter(str, event)
{
	obj = getInfoElement();
	setInfo(obj, str);
	getMouseXY(event);
	show_infoxy(str, tempX-(obj.offsetWidth/2), tempY-(obj.offsetHeight/2));
}
function show_info_upcenter(str, event)
{
	obj = getInfoElement();
	setInfo(obj, str);
	getMouseXY(event);
	show_infoxy(str, tempX-(obj.offsetWidth/2), tempY-obj.offsetHeight-20);
}
function show_info_upleft(str, event)
{
	obj = getInfoElement();
	setInfo(obj, str);
	getMouseXY(event);
	show_infoxy(str, tempX-obj.offsetWidth-20, tempY-obj.offsetHeight-20);
}
function show_info_upright(str, event)
{
	obj = getInfoElement();
	setInfo(obj, str);
	getMouseXY(event);
	show_infoxy(str, tempX+20, tempY-obj.offsetHeight-20);
}
function show_infoxy(str, x, y)
{
	obj = getInfoElement();
	if ((x+obj.offsetWidth+20) > document.body.clientWidth) x=document.body.clientWidth-obj.offsetWidth-20;
	if ((y+obj.offsetHeight+20) > document.body.clientHeight) y=document.body.clientHeight-obj.offsetHeight-20;
	if (x < 0) x = 10;
	if (y < 0) y = 10;
	obj.style.left=x+'px';
	obj.style.top=y+'px';
	obj.style.visibility='visible';
}
function close_info()
{
	obj = getInfoElement();
	obj.style.visibility='hidden';
}
