//Init tooltip
	function init_tooltip() {
		//Look for element
		if (!$('.tooltip').length){
			//If element does not exist return
			return;
		}
		
		//Insert tooltip, by appending a div to the body. But keep it hidden
		$('body').append('<div id="tooltip"><div id="tooltip_inner"></div></div>');
		
		//Initialize variables(empty)
		var $tt_title, $tt_alt;
		
		//Assing the emty variable to the tooltip div created above
		var $tt = $('#tooltip');
		var $tt_i = $('#tooltip_inner');
		  
		//Watch for the hover. Is this a lister?  
		$('.tooltip').hover(function() {
		   
		   //Store the title and empty it
		   if ($(this).attr('title')) {
			   $tt_title = $(this).attr('title');
			   $(this).attr('title', '');
		   }
		   //Store the alt and empty it
		   if ($(this).attr('alt')) {
			   $tt_alt = $(this).attr('alt');
			   $(this).attr('alt', '');
		   }
		   //Insert text
		   $tt_i.html($tt_title);
		   
		   //Show tool tip
		   $tt.show();
		   },
			function() {
			   //Hide tooltip
			   $tt.hide();
			   
			   //Empty text
			   $tt_i.html('');
			   
			   //Fix title
			   if ($tt_title) {
				   $(this).attr('title', $tt_title);
			   }
			   //Fix alt
			   if ($tt_alt) {
				   $(this).attr('alt', $tt_alt);
			   }
			}).mousemove(function(ev) {
				
				//Event coordinates
				var $ev_x = ev.pageX;
				var $ev_y = ev.pageY;
				//Tool tip coordinates
				var $tt_x = $tt.outerWidth();
				var $tt_y = $tt.outerHeight();
				//Body coordinates
				var $bd_x = $('body').outerWidth();
				var $bd_y = $('body').outerHeight();
				//Move tooltip
				$tt.css({
						'top': $ev_y + $tt_y > $bd_y ? $ev_y - $tt_y : $ev_y, 
						'left': $ev_x + $tt_x + 20 > $bd_x ? $ev_x - $tt_x - 10 : $ev_x + 15
				});
			});
	}
	
	$(document).ready(function() {
		   init_tooltip();
		   });
