ShowTooltip = function(e) {
	var text = $(this).next('.tooltip');
	if (text.attr('class') != 'tooltip') return false;

	var offset = $(this).position();
	text
		.css('top', offset.top + 15)
		.css('left', offset.left + 5)
		.fadeIn();

	return false;
}

HideTooltip = function(e) {
	var text = $(this).next('.tooltip');
	if (text.attr('class') != 'tooltip') return false;

	text.fadeOut();
}

SetupTooltips = function() {
	$('.info')
		.each(function(){
			$(this)
				.after($('<span/>')
				.attr('class', 'tooltip')
				.html('<b>' + $(this).text() + '</b><br/>' + $(this).attr('title')))
				.attr('title', '');
		})
		.hover(ShowTooltip, HideTooltip);
}

$(document).ready(function() {
	SetupTooltips();
});
