(function(k){var g={},d,c,i,b=k.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),a=false;k.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){k.tooltip.blocked=!k.tooltip.blocked}};k.fn.extend({tooltip:function(p){p=k.extend({},k.tooltip.defaults,p);n(p);return this.each(function(){k.data(this,"tooltip",p);this.tOpacity=g.parent.css("opacity");this.tooltipText=this.title;k(this).removeAttr("title");this.alt=""}).mouseover(f).mouseout(l).click(l)},fixPNG:b?function(){return this.each(function(){var p=k(this).css("backgroundImage");if(p.match(/^url\(["']?(.*\.png)["']?\)$/i)){p=RegExp.$1;k(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+p+"')"}).each(function(){var q=k(this).css("position");if(q!="absolute"&&q!="relative"){k(this).css("position","relative")}})}})}:function(){return this},unfixPNG:b?function(){return this.each(function(){k(this).css({filter:"",backgroundImage:""})
})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){k(this)[k(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function n(p){if(g.parent){return}g.parent=k('<div id="'+p.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if(k.fn.bgiframe){g.parent.bgiframe()}g.title=k("h3",g.parent);g.body=k("div.body",g.parent);g.url=k("div.url",g.parent)}function h(p){return k.data(p,"tooltip")}function m(p){if(h(this).delay){i=setTimeout(e,h(this).delay)}else{e()}a=!!h(this).track;k(document.body).bind("mousemove",j);j(p)}function f(){if(k.tooltip.blocked||this==d||(!this.tooltipText&&!h(this).bodyHandler)){return}d=this;c=this.tooltipText;if(h(this).bodyHandler){g.title.hide();var s=h(this).bodyHandler.call(this);if(s.nodeType||s.jquery){g.body.empty().append(s)}else{g.body.html(s)}g.body.show()}else{if(h(this).showBody){var r=c.split(h(this).showBody);g.title.html(r.shift()).show();
g.body.empty();for(var q=0,p;(p=r[q]);q++){if(q>0){g.body.append("<br/>")}g.body.append(p)}g.body.hideWhenEmpty()}else{g.title.html(c).show();g.body.hide()}}if(h(this).showURL&&k(this).url()){g.url.html(k(this).url().replace("http://","")).show()}else{g.url.hide()}g.parent.addClass(h(this).extraClass);if(h(this).fixPNG){g.parent.fixPNG()}m.apply(this,arguments)}function e(){i=null;if((!b||!k.fn.bgiframe)&&h(d).fade){if(g.parent.is(":animated")){g.parent.stop().show().fadeTo(h(d).fade,d.tOpacity)}else{g.parent.is(":visible")?g.parent.fadeTo(h(d).fade,d.tOpacity):g.parent.fadeIn(h(d).fade)}}else{g.parent.show()}j()}function j(q){if(k.tooltip.blocked){return}if(q&&q.target.tagName=="OPTION"){return}if(!a&&g.parent.is(":visible")){k(document.body).unbind("mousemove",j)}if(d==null){k(document.body).unbind("mousemove",j);return}g.parent.removeClass("viewport-right").removeClass("viewport-bottom");var s=g.parent[0].offsetLeft;var r=g.parent[0].offsetTop;if(q){s=q.pageX+h(d).left;r=q.pageY+h(d).top;
var u="auto";if(h(d).positionLeft){u=k(window).width()-s;s="auto"}g.parent.css({left:s,right:u,top:r})}var t=o(),p=g.parent[0];if(t.x+t.cx<p.offsetLeft+p.offsetWidth){s-=p.offsetWidth+20+h(d).left;g.parent.css({left:s+"px"}).addClass("viewport-right")}if(t.y+t.cy<p.offsetTop+p.offsetHeight){r-=p.offsetHeight+20+h(d).top;g.parent.css({top:r+"px"}).addClass("viewport-bottom")}}function o(){return{x:k(window).scrollLeft(),y:k(window).scrollTop(),cx:k(window).width(),cy:k(window).height()}}function l(p){if(k.tooltip.blocked){return}if(i){clearTimeout(i)}d=null;var r=h(this);function q(){g.parent.removeClass(r.extraClass).hide().css("opacity","")}if((!b||!k.fn.bgiframe)&&r.fade){if(g.parent.is(":animated")){g.parent.stop().fadeTo(r.fade,0,q)}else{g.parent.stop().fadeOut(r.fade,q)}}else{q()}if(h(this).fixPNG){g.parent.unfixPNG()}}})(jQuery);