/*
 * jQuery Tooltips Plugin
 * http://www.evanbot.com/article/jquery-tooltips-plugin/14
 *
 * Copyright (c) 2009 Evan Byrne (http://www.evanbot.com)
 */
jQuery.fn.tooltip = function(element,offX,offY){

	if(element == null){var element = '#tooltip';}
	
	if(offX == null){var offX = 5;}
	
	if(offY == null){var offY = 5;}
	
	$(this).each(function(){
		var title = $(this).children('img').attr('src');
		//var img = $(this).children().attr('name');
		$(this).removeAttr('title').attr('tip',title);
		
		
	});
	
	$(this).bind("mouseenter",function(){
	  $(element).show();
	});
	
	$(this).mousemove(function(e){
		var tip = $(this).attr('tip');
		$(element).css({top:e.pageY+offY,left:e.pageX+offX}).html('<img src="' + tip +'" alt="" />');
	});
	
	$(this).bind("mouseleave",function(){
		$(element).hide();
	});
	
	return this;
};
