
// Hafont.com
// Hint JavaScript Algorythm
// By Meir Sadan, 2004

var tempX = 0;
var tempY = 0;
var temp;
var functionname;

document.onmousemove = getMouseXY;

function getMouseXY(e) {
	if (window.event) {
		tempX = window.event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		tempY = window.event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	} else {
		tempX = e.clientX + window.scrollX;
		tempY = e.clientY + window.scrollY;
	}  
	if (tempX < 0) { tempX = 0; }
	if (tempY < 0) { tempY = 0; }  
	return true;
}

function showhint(hintID) {
	document.getElementById(hintID).style.left = tempX + "px";
	document.getElementById(hintID).style.top = tempY + "px";
	document.getElementById(hintID).style.visibility = 'visible';
	functionname = "updatehint('" + hintID + "')";
	temp = setTimeout(functionname, 10);
	return false;
}

function updatehint(hintID) {
	document.getElementById(hintID).style.left = tempX + "px";
	document.getElementById(hintID).style.top = tempY + "px";
	temp = setTimeout(functionname, 10);
	return false;
}

function hidehint(hintID) {
	clearTimeout(temp);
	document.getElementById(hintID).style.visibility = 'hidden';
	return false;
}
