/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = -180;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
    $("td.sms").hover(function(e) {
        if (this.title != "undefined") {
            this.t = this.title;
            this.title = "";
            $(this).addClass('resaltado');
            $("body").append("<p id='tooltip'>"+ this.t +"</p>");
			
		
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX+yOffset) + "px")
			.fadeIn("fast");		
        }
    }, function(){ if(this.t) { this.title =this.t; } $("#tooltip").remove(); $(this).removeClass('resaltado'); })
};



jQuery.each(jQuery.browser, function(i, val) {
    version = parseInt(jQuery.browser.version.substr(0,3));
    usetooltip = true;
    if (i=="msie" && version==6) 
     usetooltip = false;     
});

// starting the script on page load
if (usetooltip) {
    $(document).ready(function(){
	tooltip();
    });
}


