(function($){
	$.fn.tooltip = function(options) {
		var
		  defaults = { },
		  settings = $.extend({}, defaults, options);
		  
		  this.each(function() {
		  	var $this = $(this);			
			
			if($this.attr('tooltip') != '') {				
				$this.hover(function(e) {					
					$("body").append('<div id="tooltip" ><div class="tt_left">&nbsp;</div><div class="tt_middle"><div class="tt_content">'+$this.attr("tooltip")+'</div></div><div class="tt_right">&nbsp;</div></div>');
				
					var w= $("#tooltip").width();					
					var t= parseInt(e.pageY)+"px";
					var l= parseInt(e.pageX)+"px";					
					$("#tooltip").css({ 'top': t, 'left': e.pageX, 'margin-left': -w-20 });
										
					$("#tooltip").fadeIn(350, function(){});					
				}, function() { $('#tooltip').remove(); });	
			}
			
			$this.mousemove(function(e) {
				$('#tooltip').css({
					top: e.pageY + 10,
					left: e.pageX + 20
			     });
			});			
		  });		  
		  return this;
	}
})(jQuery);

