(()=>{var t;(t=jQuery).fn.tipTip=function(e){var o=t.extend({activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},e);if(t("#tiptip_holder").length<=0){var i=t('<div id="tiptip_holder" style="max-width:'+o.maxWidth+';"></div>'),n=t('<div id="tiptip_content"></div>'),r=t('<div id="tiptip_arrow"></div>');t("body").append(i.html(n).prepend(r.html('<div id="tiptip_arrow_inner"></div>')))}else i=t("#tiptip_holder"),n=t("#tiptip_content"),r=t("#tiptip_arrow");return this.each((function(){var e=t(this);if(o.content)var a=o.content;else a=e.attr(o.attribute);if(""!=a){var f=function(){o.enter.call(this),n.html(a),i.hide().removeAttr("class").css("margin","0"),r.removeAttr("style");var f=parseInt(e.offset().top),d=parseInt(e.offset().left),u=parseInt(e.outerWidth()),l=parseInt(e.outerHeight()),h=i.outerWidth(),s=i.outerHeight(),c=Math.round((u-h)/2),_=Math.round((l-s)/2),v=Math.round(d+c),m=Math.round(f+l+o.edgeOffset),g="",b="",M=Math.round(h-12)/2;"bottom"==o.defaultPosition?g="_bottom":"top"==o.defaultPosition?g="_top":"left"==o.defaultPosition?g="_left":"right"==o.defaultPosition&&(g="_right");var w=c+d<parseInt(t(window).scrollLeft()),O=h+d>parseInt(t(window).width());w&&c<0||"_right"==g&&!O||"_left"==g&&d<h+o.edgeOffset+5?(g="_right",b=Math.round(s-13)/2,M=-12,v=Math.round(d+u+o.edgeOffset),m=Math.round(f+_)):(O&&c<0||"_left"==g&&!w)&&(g="_left",b=Math.round(s-13)/2,M=Math.round(h),v=Math.round(d-(h+o.edgeOffset+5)),m=Math.round(f+_));var x=f+l+o.edgeOffset+s+8>parseInt(t(window).height()+t(window).scrollTop()),I=f+l-(o.edgeOffset+s+8)<0;x||"_bottom"==g&&x||"_top"==g&&!I?("_top"==g||"_bottom"==g?g="_top":g+="_top",b=s,m=Math.round(f-(s+5+o.edgeOffset))):(I|("_top"==g&&I)||"_bottom"==g&&!x)&&("_top"==g||"_bottom"==g?g="_bottom":g+="_bottom",b=-12,m=Math.round(f+l+o.edgeOffset)),"_right_top"==g||"_left_top"==g?m+=5:"_right_bottom"!=g&&"_left_bottom"!=g||(m-=5),"_left_top"!=g&&"_left_bottom"!=g||(v+=5),r.css({"margin-left":M+"px","margin-top":b+"px"}),i.css({"margin-left":v+"px","margin-top":m+"px"}).attr("class","tip"+g),p&&clearTimeout(p),p=setTimeout((function(){i.stop(!0,!0).fadeIn(o.fadeIn)}),o.delay)},d=function(){o.exit.call(this),p&&clearTimeout(p),i.fadeOut(o.fadeOut)};o.content||e.removeAttr(o.attribute);var p=!1;"hover"==o.activation?(e.hover((function(){f()}),(function(){o.keepAlive||d()})),o.keepAlive&&i.hover((function(){}),(function(){d()}))):"focus"==o.activation?e.focus((function(){f()})).blur((function(){d()})):"click"==o.activation&&(e.click((function(){return f(),!1})).hover((function(){}),(function(){o.keepAlive||d()})),o.keepAlive&&i.hover((function(){}),(function(){d()})))}}))}})();