(function(){
	var tt;
	
	var updateTT = function(e) {
		var tx;
		var ty;
		var x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX - document.documentElement.scrollLeft;
		var y = (document.all) ? window.event.y + document.body.scrollTop : e.pageY - document.documentElement.scrollTop;
		if (tt != null) {
			tx = (document.all) ? event.clientX : x;
			if ((tt.offsetWidth + tx + 20) > Common.Browser.innerWidth()) {
				x = x - tt.offsetWidth - 40;
			}
			
			ty = (document.all) ? event.clientY : y;
			if ((tt.offsetHeight + ty + 20) > Common.Browser.innerHeight()) {
				y = y - tt.offsetHeight - 40;
			}
			
			tt.style.left = (x + 20) + "px";
			tt.style.top = (y + 20) + "px";
		}
	}
	
	showTT = function(id) {
			document.onmousemove = updateTT;
			tt = document.getElementById(id);
			if (tt != null) {
				tt.style.display = "block";
				if (!document.all) {
					tt.style.position = "fixed";
				}
			}
	}
	
	hideTT = function() {
		if (tt != null)
			tt.style.display = "none";
			document.onmousemove = '';
		
		tt = null;
	}
})();

