/*
 * jQuery Tooltips Plugin
 * http://www.evanbot.com/article/jquery-tooltips-plugin/14
 *
 * Copyright (c) 2009 Evan Byrne (http://www.evanbot.com)
 */
jQuery.fn.tooltip = function(element,offX,offY){

    if(element == null){var element = '#tooltip';}
    
    if(offX == null){var offX = 5;}
    
    if(offY == null){var offY = 5;}
    
    jQuery(this).each(function(){
        var title = jQuery(this).children('img').attr('src');
        //var img = jQuery(this).children().attr('name');
        jQuery(this).removeAttr('title').attr('tip',title);
    });
    
    jQuery(this).bind("mouseenter",function(){
      jQuery(element).show();
    });
    
    jQuery(this).mousemove(function(e){
        var tip = jQuery(this).attr('tip');
        jQuery(element).css({top:e.pageY+offY,left:e.pageX+offX}).html('<img src="' + tip +'" alt="" />');
    });
    
    jQuery(this).bind("mouseleave",function(){
        jQuery(element).hide();
    });
    
    return this;
};
