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