

$(document).ready(function(){

 
    	/* CONFIG */
		xOffset = -70;
		yOffset = -20;
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
	/* END CONFIG */
	$("a.fb").filter(".tool").hover(function(e){

		$("#tooltip").html($(this).children("span").html()).css({
                    "top":(e.pageY - yOffset) + "px",
                    "left":(e.pageX + xOffset) + "px"
                }).fadeIn("fast");
    }).mouseout(function(){
                $("#tooltip").hide();
    });
	$("a.fb").filter(".tool").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});

    $("a.fb").each(function (){
        $(this).fancybox({
                'orig'          : $(this),
                'href'		: $(this).attr("href"),
		'titleShow'     : true,
                'titlePosition' : 'over',
                'title'         : $(this).children("span").html(),
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack'
        });
    });
});
