this.tooltip = function()
{	
	/* CONFIG */		
		tt_xOffset = 10;
		tt_yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */
	
	$(".tooltip").unbind('mouseenter').unbind('mouseleave');
	$(".tooltip").hover(function(e)
	{
		removeToolTip();
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - tt_xOffset) + "px")
			.css("left",(e.pageX + tt_yOffset) + "px")
			.show();
    },
	function()
	{
		this.title = this.t;		
		$("#tooltip").remove();
    });	
    
    $(".tooltip").unbind('onmousemove');
	$(".tooltip").mousemove(function(e)
	{
		$("#tooltip")
			.css("top",(e.pageY - tt_xOffset) + "px")
			.css("left",(e.pageX + tt_yOffset) + "px");
	});
};


this.displayToolTip=function(e,message)
{
	//alert(window.event.clientX);
	if(!e) e = window.event;
	if(e.pageX===undefined) {
	e.pageX = window.event.clientX;
	e.pageY = window.event.clientY;
	}

	
	removeToolTip();
	tt_xOffset = 10;
	tt_yOffset = 20;
	
	this.t = message;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - tt_xOffset) + "px")
			.css("left",(e.pageX + tt_yOffset) + "px")
			.show();
			
}

this.removeToolTip=function()
{
	//this.title = this.t;		
	$("#tooltip").html('');
	$("#tooltip").remove();
}


