(function ($) {
$.fn.vtip = function (options) {

    var settings = {
        xOffset: -15,
        yOffset: 30
    };
    if (options) $.extend(settings, options);

    return this.live('mouseover mouseout mousemove', function(a){
        
        if(a.type == 'mouseover'){
            
            this.t = this.title;
            this.title = "";
            this.top = (a.pageY + settings.yOffset);
            this.left = (a.pageX + settings.xOffset);
            $("body").append('<p id="vtip"><span class="vtip-arrow-border"></span><span class="vtip-arrow"></span>' + this.t + "</p>");
            $("p#vtip").css("top", this.top + "px").css("left", this.left + "px").fadeIn("fast");
            
        }else if (a.type == 'mouseout'){
            
            this.title = this.t;
            $("p#vtip").fadeOut("fast").remove();
            
        }else if (a.type == 'mousemove'){
            
            this.top = (a.pageY + settings.yOffset);
            this.left = (a.pageX + settings.xOffset);
            $("p#vtip").css("top", this.top + "px").css("left", this.left + "px");
            
        }

    });
};
})(jQuery);

