// Author: Gareth Price - www.iamgp.com
// Contribution From: Gary Mardell

	this.tooltip = function() {
		
		// determine distance of corner from mouse
		
		x = 15;
		y = 25;
	
		
		$(".tooltip").hover(function(e) {
	
			var rel = this.rel;
			var s = $("body").find("#"+rel).html();
	
			$("body").append("<span id='tooltipx'>" + s + "</span>");
			$("#tooltipx").css("top",(e.pageY - x) + "px").css("left",(e.pageX + y) + "px").fadeIn("slow");
				
		},
	
		function() {
		
			$("#tooltipx").fadeOut("fast");
			$("#tooltipx").remove();
			
		});
	
		$("a.tooltip").mousemove( function(e){

			$("#tooltipx") .css("top",(e.pageY - x) + "px").css("left",(e.pageX + y) + "px");
			
		});
	};
	
	$(document).ready(function() {
		
		tooltip();
		
	});