wmtt = null;

document.onmousemove = updateTT;

var x; var y;
var wmtt_width; var wmtt_height;

function updateTT(e) {
	x = (document.all) ? window.event.x + document.documentElement.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.documentElement.scrollTop  : e.pageY;
	if (wmtt != null) {
		if (x > screen.availWidth/2) {
			wmtt.style.left = (x - wmtt_width - 15) + "px";		
		}
		else {
			wmtt.style.left = (x + 15) + "px";
		}
		//wmtt.style.top 	= (y + 15) + "px";
		wmtt.style.top 	= (y - wmtt_height -5) + "px";
	}
}

function showTT(id,fixw,fixh) {
	wmtt = document.getElementById(id);
	wmtt.style.display = "block";
	wmtt_width = wmtt.offsetWidth;
	wmtt_height = wmtt.offsetHeight;
	if(fixw && fixh){
		wmtt_width = fixw;
		wmtt_height = fixh;
	}
}

function hideTT() {
	wmtt.style.display = "none";
}