$.fn.tooltip = function(options){
	if (options) {
	
		var tips = [
			"Previous Project",
			"Next Project"
		];
	
		$(this).mouseenter(function(){ showTip(); });
		$(this).mouseleave(function(){ hideTip(); });
		
		function showTip(){
			var tiptext = tips[options.id];
			$('body').prepend('<div id="tooltip"><div id="tooltip-content"><p></p></div></div>');
			$('#tooltip-content p').html(tiptext);
			$('#tooltip').fadeIn(250);
			$(document.body).bind('mousemove', update);		
			// update at least once
			update(event);
		}
		
		function hideTip(){
			$('#tooltip').hide();
			$('#tooltip').remove();
			$(document.body).unbind('mousemove', update);
		}
		
		function update(event){
			var left = $('#tooltip').offsetLeft;
			var top = $('#tooltip').offsetTop;
			if (event) {
				// position the helper 15 pixel to bottom right, starting from mouse position
				left = event.pageX - 18;
				top = event.pageY + 12;
				var right='auto';
		
				$('#tooltip').css({
					left: left,
					right: right,
					top: top
				});
			}
		}

	};

}
