tooltip = null;

document.onmousemove = update_tool;

function update_tool(e) {
	if (tooltip != null) {
		x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
		y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
		tooltip.style.left = (x + 20) + "px";
		tooltip.style.top 	= (y + 20) + "px";
	}
}

function show_tool(text) {
	tooltip = document.getElementById('tooltip');
	tooltip.innerHTML = text;
	tooltip.style.display = "block"
}

function hide_tool() {
	tooltip.style.display = "none";
	tooltip = null;
}
