var tt = null;
var c = 0;
var o = 0;
var cl = 0;
var ct = 0;

function initTT()
{
	c = $('#content');
	o = c.offset();
	cl = o.left;
	ct = o.top;
}

function showTT(id) 
{
	if (tt != null) {
		hideTT();
	}
	
	tt = document.getElementById('tooltip_'+id.substr(3));
	
	$('#tooltip_'+id.substr(3)).fadeIn(100);
}

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

$(document).ready(function(){
	initTT();
	
	$(".tt").mouseover(function() {
		showTT($(this).attr("id"));
	});
	
	$(".tt").mouseout(function() {
		hideTT();
	});
	
	$().mousemove(function(e){
		if (tt) {
			tt.style.left = e.pageX - cl + 20 + "px";
			tt.style.top = e.pageY - ct + "px";
		}
	}); 
});

window.onresize = function() { initTT(); };

