__ = jQuery.noConflict();

ShowTooltip = function(e)
{
    var text = __(this).next('.show-tooltip-text');
    if (text.attr('class') != 'show-tooltip-text')
        return false;

    text.fadeIn()
        .css('top', e.pageY)
        .css('left', e.pageX+10);

    return false;
}
HideTooltip = function(e)
{
    var text = __(this).next('.show-tooltip-text');
    if (text.attr('class') != 'show-tooltip-text')
        return false;

    text.fadeOut();
}

SetupTooltips = function()
{
    __('.ToolTipTextBox')
        .each(function(){
	        __(this)
		        .after(__('<span/>')
			        .attr('class', 'show-tooltip-text')
			        .html(__(this).attr('title')))
		        .attr('title', '');
        })
        .hover(ShowTooltip, HideTooltip);
}

__(document).ready(function()
{
    SetupTooltips();
});

