/*
 * jQuery Tooltip plugin 1.2
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
 * http://docs.jquery.com/Plugins/Tooltip
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.tooltip.js 4569 2008-01-31 19:36:35Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function(E){var G={},J,M,O,K=E.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),B=false;E.tooltip={blocked:false,defaults:{delay:200,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){E.tooltip.blocked=!E.tooltip.blocked}};E.fn.extend({tooltip:function(P){P=E.extend({},E.tooltip.defaults,P);H(P);return this.each(function(){E.data(this,"tooltip-settings",P);this.tooltipText=this.title;E(this).removeAttr("title");this.alt=""}).hover(L,F).click(F)},fixPNG:K?function(){return this.each(function(){var P=E(this).css("backgroundImage");if(P.match(/^url\(["']?(.*\.png)["']?\)$/i)){P=RegExp.$1;E(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+P+"')"}).each(function(){var Q=E(this).css("position");if(Q!="absolute"&&Q!="relative"){E(this).css("position","relative")}})}})}:function(){return this},unfixPNG:K?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 H(P){if(G.parent){return }G.parent=E('<div id="'+P.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(E("#principal").parent()).hide();if(E.fn.bgiframe){G.parent.bgiframe()}G.title=E("h3",G.parent);G.body=E("div.body",G.parent);G.url=E("div.url",G.parent)}function C(P){return E.data(P,"tooltip-settings")}function A(P){if(C(this).delay){O=setTimeout(N,C(this).delay)}else{N()}B=!!C(this).track;E(document.body).bind("mousemove",D);D(P)}function L(){if(E.tooltip.blocked||this==J||(!this.tooltipText&&!C(this).bodyHandler)){return }J=this;M=this.tooltipText;if(C(this).bodyHandler){G.title.hide();var S=C(this).bodyHandler.call(this);if(S.nodeType||S.jquery){G.body.empty().append(S)}else{G.body.html(S)}G.body.show()}else{if(C(this).showBody){var R=M.split(C(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(M).show();G.body.hide()}}if(C(this).showURL&&E(this).url()){G.url.html(E(this).url().replace("http://","")).show()}else{G.url.hide()}G.parent.addClass(C(this).extraClass);if(C(this).fixPNG){G.parent.fixPNG()}A.apply(this,arguments)}function N(){O=null;G.parent.show();D()}function D(R){if(E.tooltip.blocked){return }if(!B&&G.parent.is(":visible")){E(document.body).unbind("mousemove",D)}if(J==null){E(document.body).unbind("mousemove",D);return }G.parent.removeClass("viewport-right").removeClass("viewport-bottom");var T=G.parent[0].offsetLeft;var S=G.parent[0].offsetTop;if(R){T=R.pageX+C(J).left;S=R.pageY+C(J).top;G.parent.css({left:T+"px",top:S+"px"})}var P=I(),Q=G.parent[0];if(P.x+P.cx<Q.offsetLeft+Q.offsetWidth){T-=Q.offsetWidth+20+C(J).left;G.parent.css({left:T+"px"}).addClass("viewport-right")}if(P.y+P.cy<Q.offsetTop+Q.offsetHeight){S-=Q.offsetHeight+20+C(J).top;G.parent.css({top:S+"px"}).addClass("viewport-bottom")}}function I(){return{x:E(window).scrollLeft(),y:E(window).scrollTop(),cx:E(window).width(),cy:E(window).height()}}function F(P){if(E.tooltip.blocked){return }if(O){clearTimeout(O)}J=null;G.parent.hide().removeClass(C(this).extraClass);if(C(this).fixPNG){G.parent.unfixPNG()}}E.fn.Tooltip=E.fn.tooltip})(jQuery);