!function(){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().removeAttr("class").css("margin","0"),r.removeAttr("style");var d=parseInt(e.offset().top),u=parseInt(e.offset().left),p=parseInt(e.outerWidth()),l=parseInt(e.outerHeight()),h=i.outerWidth(),c=i.outerHeight(),s=Math.round((p-h)/2),_=Math.round((l-c)/2),v=Math.round(u+s),m=Math.round(d+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=s+u<parseInt(t(window).scrollLeft()),O=h+u>parseInt(t(window).width());w&&s<0||"_right"==g&&!O||"_left"==g&&u<h+o.edgeOffset+5?(g="_right",b=Math.round(c-13)/2,M=-12,v=Math.round(u+p+o.edgeOffset),m=Math.round(d+_)):(O&&s<0||"_left"==g&&!w)&&(g="_left",b=Math.round(c-13)/2,M=Math.round(h),v=Math.round(u-(h+o.edgeOffset+5)),m=Math.round(d+_));var x=d+l+o.edgeOffset+c+8>parseInt(t(window).height()+t(window).scrollTop()),I=d+l-(o.edgeOffset+c+8)<0;x||"_bottom"==g&&x||"_top"==g&&!I?("_top"==g||"_bottom"==g?g="_top":g+="_top",b=c,m=Math.round(d-(c+5+o.edgeOffset))):(I|("_top"==g&&I)||"_bottom"==g&&!x)&&("_top"==g||"_bottom"==g?g="_bottom":g+="_bottom",b=-12,m=Math.round(d+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),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.hover((function(){d()}),(function(){o.keepAlive||u()})),o.keepAlive&&i.hover((function(){}),(function(){u()}))):"focus"==o.activation?e.focus((function(){d()})).blur((function(){u()})):"click"==o.activation&&(e.click((function(){return d(),!1})).hover((function(){}),(function(){o.keepAlive||u()})),o.keepAlive&&i.hover((function(){}),(function(){u()})))}}))}}();