$(document).ready(function(){
  
 
	//tooltip preview - normal
	$("a.tooltip").live('mouseover', function(e) { 

		var xOffset = 10;
		var yOffset = -170;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		

//		$(this).live("hover", function(e) { 
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");


		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    });
	
	$("a.tooltip").live('mouseout', function(e) {
			this.title = this.t;		
			$("#tooltip").remove();
	    });	
	
	$("a.tooltip").live('mousemove', function(e){
		var xOffset = 10;
		var yOffset = -170;		

		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			

	//remove tooltip after click
	$("a").live('click', function(){
		$("#tooltip, #tooltip1").remove();
	});




	//tooltip preview for normal table
    $("a.tooltip1").live('mouseover', function(e) { 

		var xOffset = 40;
		var yOffset = -5;		

		var id = $(this).attr('rel');
        
		this.t = this.title;
		this.title = "";									  
		$("body").append('<p id="tooltip1">'+ this.t +'</p>');


		$("#tooltip1")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    });
	
	$("a.tooltip1").live('mouseout', function(e) {
			this.title = this.t;		
			$("#tooltip1").remove();
	    });	
	
	$("a.tooltip1").live('mousemove', function(e){
		var xOffset = 40;
		var yOffset = -5;		

		$("#tooltip1")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			



});

 

