// JavaScript Document

(function ($) {
	this.tooltip = function(selector){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// Esta son las variables a configurar la distancia del tooltip al cursor. 
	/* END CONFIG */		


	$(selector).hover(function(e){											  
		var Texto = $(this).attr("title");
		if (!Texto) Texto = $(this).attr("alt");
		if (!Texto) Texto = $(this).attr("href"); 
		if (!Texto) Texto = $(this).attr("src"); 
//		this.title = "";									  

		$("body").append("<p id='tooltip'>"+ Texto +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
//		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$(selector).mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
}
								  
}) (jQuery); 
