(function($) {

	$.fn.tooltip = function(settings) {
		
		var defaults = {
			after : 0
		};
		
		var settings = $.extend(defaults,settings);
		
		return this.each(function() {

			var thisDiv = $(this);

			thisDiv.hover(function() {
				var tooltip = $('<div />');
				thisDiv.css({
					'cursor'	:	'pointer'
				});
				tooltip
					.addClass('tooltip')
					.html(thisDiv.attr('title'));
				if(settings.after) { thisDiv.after(tooltip); }
				else { thisDiv.append(tooltip); }
			},function() {
				thisDiv.css({
					'cursor'	:	'default'
				});
				if(settings.after) { $('.tooltip',thisDiv.parent()).remove(); }
				else { $('.tooltip',thisDiv).remove(); }
			});

		});

	};

}) (jQuery);
