var wmtt = null;

document.onmousemove = updateWMTT;
function updateWMTT(e) {
	x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
	y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
	if (wmtt != null) {
		wmtt.style.left = (x + 20) + "px";
		wmtt.style.top 	= (y + 20) + "px";
	}
}

function showWMTT(id) {
	wmtt = document.getElementById(id);
	t = setTimeout(function() { show(wmtt); }, 500);
}

function show(wmtt) {
	wmtt.style.display = "block"
	clearTimeout(t);
	highlighting = setInterval(function() { highlightit(wmtt) }, 50);
}

function highlightit(cur2) {
	if(navigator.appName == "Microsoft Internet Explorer") {
		if(cur2.filters.alpha.opacity < 100) {
			cur2.filters.alpha.opacity += 5;
		}
		else if(window.highlighting) {
			clearInterval(highlighting);
		}
	} else if(cur2.style.opacity) {
		if(Number(cur2.style.opacity) < 1) {
			cur2.style.opacity = String(Number(cur2.style.opacity) + 0.3);
		} else if(window.highlighting) {
			clearInterval(highlighting);
		}
	}
}

function hideWMTT(id) {
	clearTimeout(t);
	clearInterval(highlighting);
	wmtt = document.getElementById(id);
	wmtt.style.display = "none";
	wmtt.style.opacity = "0";
	if(navigator.appName == "Microsoft Internet Explorer") {
		wmtt.filters.alpha.opacity = "40";
	}
	//lowing = setInterval(function() { lowit(wmtt) }, 50);
}

function lowit(cur2) {
	if(navigator.appName == "Microsoft Internet Explorer") {
		if(cur2.filters.alpha.opacity >= 0) {
			cur2.filters.alpha.opacity -= 5;
		}
		else if(window.lowing) {
			clearInterval(lowing);
		}
	} else if(cur2.style.opacity) {
		if(Number(cur2.style.opacity) >= 0) {
			cur2.style.opacity = String(Number(cur2.style.opacity) - 0.3);
		} else if(window.lowing) {
			clearInterval(lowing);
		}
	}
}