// JavaScript Document
// ToolTip jQuery plugin.
(function($) {
	$("head").append("<link>");
	var css = $("head").children(":last");
	css.attr({
	  rel:  "stylesheet",
	  type: "text/css",
	  href: "include/images/page/FRPBookOfMemories/lib/jquery.tooltip.css"
	});	
	$.fn.tooltip = function(tipHTML) {									
		this.each(function() {
			$(this).addClass("tooltip-element");
																
			var oTip;
			
			$(this).mouseover(function(event) {	
				oTip = document.createElement("div");
				$(oTip).addClass("tooltip")
					   .hide()
				   	   .appendTo("body")
				   	   .attr("innerHTML",tipHTML);																										
				$(oTip).show();				
			});
			
			$(this).mouseout(function() {
				$(oTip).hide().remove();
			});
			
			$(this).mousemove(function(event) {
				oTip.style.left = (event.pageX) + "px";
				oTip.style.top = (event.pageY + 25) + "px";
			});
		});
	};
})(jQuery);
