/**
*	Creates a tooltip for each element with the class tri_init_tooltip.
*	Uses the value of the attribute tri_tooltip to fill the true terrific tricoma tooltip text.
*
*	@author		IPR_PJ		
*	@version	1.337				
*	@requires	jquery.livequery.js		(http://docs.jquery.com/Plugins/livequery)
*
**/

(function($){
	$.fn.tri_tooltip = function(text) {
	
		this.init = function(){
		
			$(this).hover(
				function (event) {
				    $('body').append($("<div></div>").addClass('tri_tooltip').css('left',event.pageX+10).css('top',event.pageY-30).append($("<div></div>").html(text)).fadeIn(500));
				}, 
				function () {
			    	$('body').find(".tri_tooltip").fadeOut(500).remove();
			  	}
			)
		}
		
		this.init();
		
		return this;
	}
})(jQuery);

$(function() {

	$('.tri_init_tooltip').each(function(index){
		$(this).tri_tooltip($(this).attr('tri_tooltip'));
	});
	/*
	$('.tri_init_tooltip').livequery(function(){
		$(this).tri_tooltip($(this).attr('tri_tooltip'));
	});
	*/
});
