﻿(function($) {
    // TOOL TIP
    $.fn.tip = function() {
        return this.each(function(i) {
            var placenode = $(this);
            var tipnode = $(this).children("div");

            // fade behaviour
            var fade = {
                showTip: function(box) {
                    $(box).fadeIn(200);
                },
                hideTip: function(box, callback) {
                    $(box).animate({ opacity: 0 }, 200, callback);
                },
                shrinkToFit: true,
                hoverIntentOpts: {
                    interval: 0,
                    timeout: 0
                }
            };

            // create anchor
            placenode.css('border-bottom', '3px green double');
            placenode.css('display', 'inline');
            var tip = tipnode.html()
            placenode.bt(tip);
            tipnode.hide();
        });
    };
})(jQuery);