
$(document).ready(function(){


	// init tooltip
	tooltip();
 
});

this.tooltip = function(){	

	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("#prev_case, #next_case, #overview").hover(function(e){											  
		
	if ($(this).attr("id") == "overview"){
		this.t = $(this).attr("tooltip") //"Back to selection"
	}else{
		this.t = "<i>" + $(this).attr("tooltip") + "</i>: " +  $(this).find("a").html() 
	}
										  
		$("#tooltip").html("<p>"+ this.t +"</p>");
		$("#tooltip").customFadeIn("fast");	
			//.css("top",(e.pageY - xOffset) + "px")
			//.css("left",(e.pageX + yOffset) + "px")
				
    },
	function(){
			$("#tooltip").fadeOut("fast");
		//$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			//.css("top",(e.pageY - xOffset -200) + "px")
			//.css("left",(e.pageX + yOffset -50) + "px");
	});		


	
};
