(()=>{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){o.content||e.removeAttr(o.attribute);var f=!1;function d(){o.enter.call(this),n.html(a),i.hide().css("margin","0"),i.removeAttr("class"),r.removeAttr("style");var d=parseInt(e.offset().top),u=parseInt(e.offset().left),p=parseInt(e.outerWidth()),s=parseInt(e.outerHeight()),l=i.outerWidth(),c=i.outerHeight(),h=Math.round((p-l)/2),_=Math.round((s-c)/2),m=Math.round(u+h),v=Math.round(d+s+o.edgeOffset),g="",b="",M=Math.round(l-12)/2;"bottom"==o.defaultPosition?g="_bottom":"top"==o.defaultPosition?g="_top":"left"==o.defaultPosition?g="_left":"right"==o.defaultPosition&&(g="_right");var w=h+u<parseInt(t(window).scrollLeft()),O=l+u>parseInt(t(window).width());w&&h<0||"_right"==g&&!O||"_left"==g&&u<l+o.edgeOffset+5?(g="_right",b=Math.round(c-13)/2,M=-12,m=Math.round(u+p+o.edgeOffset),v=Math.round(d+_)):(O&&h<0||"_left"==g&&!w)&&(g="_left",b=Math.round(c-13)/2,M=Math.round(l),m=Math.round(u-(l+o.edgeOffset+5)),v=Math.round(d+_));var x=d+s+o.edgeOffset+c+8>parseInt(t(window).height()+t(window).scrollTop()),I=d+s-(o.edgeOffset+c+8)<0;x||"_bottom"==g&&x||"_top"==g&&!I?("_top"==g||"_bottom"==g?g="_top":g+="_top",b=c,v=Math.round(d-(c+5+o.edgeOffset))):(I|("_top"==g&&I)||"_bottom"==g&&!x)&&("_top"==g||"_bottom"==g?g="_bottom":g+="_bottom",b=-12,v=Math.round(d+s+o.edgeOffset)),"_right_top"==g||"_left_top"==g?v+=5:"_right_bottom"!=g&&"_left_bottom"!=g||(v-=5),"_left_top"!=g&&"_left_bottom"!=g||(m+=5),r.css({"margin-left":M+"px","margin-top":b+"px"}),i.css({"margin-left":m+"px","margin-top":v+"px"}).attr("class","tip"+g),f&&clearTimeout(f),f=setTimeout((function(){i.stop(!0,!0).fadeIn(o.fadeIn)}),o.delay)}function u(){o.exit.call(this),f&&clearTimeout(f),i.fadeOut(o.fadeOut)}"hover"==o.activation?(e.on("mouseenter",(function(){d()})).on("mouseleave",(function(){o.keepAlive&&i.is(":hover")||u()})),o.keepAlive&&i.on("mouseenter",(function(){})).on("mouseleave",(function(){u()}))):"focus"==o.activation?e.on("focus",(function(){d()})).on("blur",(function(){u()})):"click"==o.activation&&(e.on("click",(function(){return d(),!1})).on("mouseenter",(function(){})).on("mouseleave",(function(){o.keepAlive||u()})),o.keepAlive&&i.on("mouseenter",(function(){})).on("mouseleave",(function(){u()})))}}))}})();