/*
 * jQuery Tooltip plugin 1.3
 */

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(1($){$.l({m:\'n\',o:\'p\'},1(a,3){$.2.b[3]={q:1(){c($.f.g)6 h;7.r(a,$.2.b[3].8,i)},s:1(){c($.f.g)6 h;7.t(a,$.2.b[3].8,i)},8:1(e){9[0]=$.2.3(e);9[0].4=3;6 $.2.u.j(7,9)}}});$.v($.w,{d:1(4,d,8){6 7.x(4,1(2){y 5=$(2.5);c(5.z(d)){6 8.j(5,9)}})},A:1(4,5){6 7.B(4,[k.2.3({4:4,5:5})])}})})(k);',38,38,'|function|event|fix|type|target|return|this|handler|arguments|original|special|if|delegate||browser|msie|false|true|apply|jQuery|each|focus|focusin|blur|focusout|setup|addEventListener|teardown|removeEventListener|handle|extend|fn|bind|var|is|triggerEvent|triggerHandler'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(a($){n q=$.X.q,r=$.X.r;$.X.u({q:a(){5(1[0]==b)7 J.19||$.A&&9.K.1a||9.c.1a;5(1[0]==9)7 1b.1c(9.c.1B,9.c.Y);7 q.1d(1,1e)},r:a(){5(1[0]==b)7 J.1f||$.A&&9.K.1g||9.c.1g;5(1[0]==9)7 1b.1c(9.c.1C,9.c.Z);7 r.1d(1,1e)},19:a(){7 1[0]==b||1[0]==9?1.q():1.L(\':B\')?1[0].Y-4(1,\'g\')-4(1,\'1h\'):1.q()+4(1,\'10\')+4(1,\'1i\')},1f:a(){7 1[0]==b||1[0]==9?1.r():1.L(\':B\')?1[0].Z-4(1,\'h\')-4(1,\'1j\'):1.r()+4(1,\'11\')+4(1,\'1k\')},1D:a(){7 1[0]==b||1[0]==9?1.q():1.L(\':B\')?1[0].Y:1.q()+4(1,\'g\')+4(1,\'1h\')+4(1,\'10\')+4(1,\'1i\')},1E:a(){7 1[0]==b||1[0]==9?1.r():1.L(\':B\')?1[0].Z:1.r()+4(1,\'h\')+4(1,\'1j\')+4(1,\'11\')+4(1,\'1k\')},i:a(s){5(s!=1l)7 1.1m(a(){5(1==b||1==9)b.1n(s,$(b).j());o 1.i=s});5(1[0]==b||1[0]==9)7 J.1F||$.A&&9.K.i||9.c.i;7 1[0].i},j:a(s){5(s!=1l)7 1.1m(a(){5(1==b||1==9)b.1n($(b).i(),s);o 1.j=s});5(1[0]==b||1[0]==9)7 J.1G||$.A&&9.K.j||9.c.j;7 1[0].j},12:a(8,l){n 6=1[0],3=6.M,m=6.13,8=$.u({N:k,E:k,O:k,t:k},8||{}),x=6.P,y=6.Q,d=6.i,e=6.j;5($.f.R||$.f.1o){x+=4(6,\'h\');y+=4(6,\'g\')}5($.f.R){F{5($.f.R&&3!=6&&$.G(3,\'1p\')!=\'B\'){x+=4(3,\'h\');y+=4(3,\'g\')}5(3==m)1q}H((3=3.M)&&(3.v.w()!=\'c\'||3.v.w()!=\'14\'))}n p=S(6,8,x,y,d,e);5(l){$.u(l,p);7 1}o{7 p}},1H:a(8,l){n x=0,y=0,d=0,e=0,6=1[0],3=1[0],m,T,I=$.G(6,\'12\'),z=$.f.R,C=$.f.1o,1r=$.f.15,1s=$.f.16,17=k,18=k,8=$.u({N:D,E:k,O:k,t:D,1t:k},8||{});5(8.1t)7 1.1u(8,l);5(6.v.w()==\'c\'){x=6.P;y=6.Q;5(z){x+=4(6,\'U\')+(4(6,\'h\')*2);y+=4(6,\'V\')+(4(6,\'g\')*2)}o 5(1s){x+=4(6,\'U\');y+=4(6,\'V\')}o 5(C&&1v.A){x+=4(6,\'h\');y+=4(6,\'g\')}}o{F{T=$.G(3,\'12\');x+=3.P;y+=3.Q;5(z||C){x+=4(3,\'h\');y+=4(3,\'g\');5(z&&T==\'1w\')17=D;5(C&&T==\'1I\')18=D}m=3.13;5(8.t||z){F{5(8.t){d+=3.i;e+=3.j}5(z&&3!=6&&$.G(3,\'1p\')!=\'B\'){x+=4(3,\'h\');y+=4(3,\'g\')}3=3.M}H(3!=m)}3=m;5(3.v.w()==\'c\'||3.v.w()==\'14\'){5((1r||(C&&$.A))&&I!=\'1w\'&&I!=\'1x\'){x+=4(3,\'U\');y+=4(3,\'V\')}5((z&&!17&&I!=\'1x\')||(C&&I==\'1J\'&&!18)){x+=4(3,\'h\');y+=4(3,\'g\')}1q}}H(3)}n p=S(6,8,x,y,d,e);5(l){$.u(l,p);7 1}o{7 p}},1u:a(8,l){n x=0,y=0,d=0,e=0,3=1[0],m,8=$.u({N:D,E:k,O:k,t:D},8||{});F{x+=3.P;y+=3.Q;m=3.13;5(8.t){F{d+=3.i;e+=3.j;3=3.M}H(3!=m)}3=m}H(3&&3.v.w()!=\'c\'&&3.v.w()!=\'14\');n p=S(1[0],8,x,y,d,e);5(l){$.u(l,p);7 1}o{7 p}}});n 4=a(W,1y){7 1K($.G(W.1L?W[0]:W,1y))||0};n S=a(6,8,x,y,d,e){5(!8.N){x-=4(6,\'U\');y-=4(6,\'V\')}5(8.E&&($.f.15||$.f.16)){x+=4(6,\'h\');y+=4(6,\'g\')}o 5(!8.E&&!($.f.15||$.f.16)){x-=4(6,\'h\');y-=4(6,\'g\')}5(8.O){x+=4(6,\'11\');y+=4(6,\'10\')}5(8.t){d-=6.i;e-=6.j}7 8.t?{1z:y-e,1A:x-d,j:e,i:d}:{1z:y,1A:x}}})(1v);',62,110,'|this||parent|num|if|elem|return|options|document|function|window|body|sl|st|browser|borderTopWidth|borderLeftWidth|scrollLeft|scrollTop|false|returnObject|op|var|else|returnValue|height|width|val|scroll|extend|tagName|toLowerCase|||mo|boxModel|visible|ie|true|border|do|css|while|elemPos|self|documentElement|is|parentNode|margin|padding|offsetLeft|offsetTop|mozilla|handleOffsetReturn|parPos|marginLeft|marginTop|el|fn|offsetHeight|offsetWidth|paddingTop|paddingLeft|position|offsetParent|html|safari|opera|absparent|relparent|innerHeight|clientHeight|Math|max|apply|arguments|innerWidth|clientWidth|borderBottomWidth|paddingBottom|borderRightWidth|paddingRight|undefined|each|scrollTo|msie|overflow|break|sf|oa|lite|offsetLite|jQuery|absolute|fixed|prop|top|left|scrollHeight|scrollWidth|outerHeight|outerWidth|pageXOffset|pageYOffset|offset|relative|static|parseInt|jquery'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.m.u=$.m.g=7(s){h($.8.v&&i($.8.j)<=6){s=$.w({9:\'3\',a:\'3\',b:\'3\',c:\'3\',o:x,k:\'y:p;\'},s||{});A 4=7(n){l n&&n.B==C?n+\'5\':n},q=\'<r D="g"E="0"F="-1"k="\'+s.k+\'"\'+\'G="H:I;J:K;z-L:-1;\'+(s.o!==p?\'M:N(O=\\\'0\\\');\':\'\')+\'9:\'+(s.9==\'3\'?\'e(((i(2.f.t.P)||0)*-1)+\\\'5\\\')\':4(s.9))+\';\'+\'a:\'+(s.a==\'3\'?\'e(((i(2.f.t.Q)||0)*-1)+\\\'5\\\')\':4(s.a))+\';\'+\'b:\'+(s.b==\'3\'?\'e(2.f.R+\\\'5\\\')\':4(s.b))+\';\'+\'c:\'+(s.c==\'3\'?\'e(2.f.S+\\\'5\\\')\':4(s.c))+\';\'+\'"/>\';l 2.T(7(){h($(\'> r.g\',2).U==0)2.V(W.X(q),2.Y)})}l 2};h(!$.8.j)$.8.j=Z.10.11().12(/.+(?:13|14|15|16)[\\/: ]([\\d.]+)/)[1]})(17);',62,70,'||this|auto|prop|px||function|browser|top|left|width|height||expression|parentNode|bgiframe|if|parseInt|version|src|return|fn||opacity|false|html|iframe||currentStyle|bgIframe|msie|extend|true|javascript||var|constructor|Number|class|frameborder|tabindex|style|display|block|position|absolute|index|filter|Alpha|Opacity|borderTopWidth|borderLeftWidth|offsetWidth|offsetHeight|each|length|insertBefore|document|createElement|firstChild|navigator|userAgent|toLowerCase|match|rv|it|ra|ie|jQuery'.split('|'),0,{}))
/*
 * jQuery Tooltip plugin 1.3
 *
 * 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 5741 2008-06-21 15:22:16Z 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($) {
	
		// the tooltip element
	var helper = {},
		// the current tooltipped element
		current,
		// the title of the current element, used for restoring
		title,
		// timeout id for delayed tooltips
		tID,
		// IE 5.5 or 6
		IE = $.browser.msie && /MSIE\s(5\.5|6\.)/.test(navigator.userAgent),
		// flag for mouse tracking
		track = false;
	
	$.tooltip = {
		blocked: false,
		defaults: {
			delay: 200,
			fade: false,
			showURL: true,
			extraClass: "",
			top: 15,
			left: 15,
			id: "tooltip"
		},
		block: function() {
			$.tooltip.blocked = !$.tooltip.blocked;
		}
	};
	
	$.fn.extend({
		tooltip: function(settings) {
			settings = $.extend({}, $.tooltip.defaults, settings);
			createHelper(settings);
			return this.each(function() {
					$.data(this, "tooltip", settings);
					this.tOpacity = helper.parent.css("opacity");
					// copy tooltip into its own expando and remove the title
					this.tooltipText = this.title;
					$(this).removeAttr("title");
					// also remove alt attribute to prevent default tooltip in IE
					this.alt = "";
				})
				.mouseover(save)
				.mouseout(hide)
				.click(hide);
		},
		fixPNG: IE ? function() {
			return this.each(function () {
				var image = $(this).css('backgroundImage');
				if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
					image = RegExp.$1;
					$(this).css({
						'backgroundImage': 'none',
						'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
					}).each(function () {
						var position = $(this).css('position');
						if (position != 'absolute' && position != 'relative')
							$(this).css('position', 'relative');
					});
				}
			});
		} : function() { return this; },
		unfixPNG: IE ? function() {
			return this.each(function () {
				$(this).css({'filter': '', backgroundImage: ''});
			});
		} : function() { return this; },
		hideWhenEmpty: function() {
			return this.each(function() {
				$(this)[ $(this).html() ? "show" : "hide" ]();
			});
		},
		url: function() {
			return this.attr('href') || this.attr('src');
		}
	});
	
	function createHelper(settings) {
		// there can be only one tooltip helper
		if( helper.parent )
			return;
		// create the helper, h3 for title, div for url
		helper.parent = $('<div style="position:absolute; bottom:-5px; left:9px; width:9px; height:6px; z-index:9999; margin-left:8px; margin-top:24px "><img src="../../imagens/geral/blt_seta_tooltip.gif" width="9" height="6" alt="" /></div><div id="' + settings.id + '"><h3></h3><div class="body"></div><div class="url"></div></div>')
			// add to document
			.appendTo(document.body)
			// hide it at first
			.hide();
			
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			helper.parent.bgiframe();
		
		// save references to title and url elements
		helper.title = $('h3', helper.parent);
		helper.body = $('div.body', helper.parent);
		helper.url = $('div.url', helper.parent);
	}
	
	function settings(element) {
		return $.data(element, "tooltip");
	}
	
	// main event handler to start showing tooltips
	function handle(event) {
		// show helper, either with timeout or on instant
		if( settings(this).delay )
			tID = setTimeout(show, settings(this).delay);
		else
			show();
		
		// if selected, update the helper position when the mouse moves
		track = !!settings(this).track;
		$(document.body).bind('mousemove', update);
			
		// update at least once
		update(event);
	}
	
	// save elements title before the tooltip is displayed
	function save() {
		// if this is the current source, or it has no title (occurs with click event), stop
		if ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )
			return;

		// save current
		current = this;
		title = this.tooltipText;
		
		if ( settings(this).bodyHandler ) {
			helper.title.hide();
			var bodyContent = settings(this).bodyHandler.call(this);
			if (bodyContent.nodeType || bodyContent.jquery) {
				helper.body.empty().append(bodyContent)
			} else {
				helper.body.html( bodyContent );
			}
			helper.body.show();
		} else if ( settings(this).showBody ) {
			var parts = title.split(settings(this).showBody);
			helper.title.html(parts.shift()).show();
			helper.body.empty();
			for(var i = 0, part; (part = parts[i]); i++) {
				if(i > 0)
					helper.body.append("<br/>");
				helper.body.append(part);
			}
			helper.body.hideWhenEmpty();
		} else {
			helper.title.html(title).show();
			helper.body.hide();
		}
		
		// if element has href or src, add and show it, otherwise hide it
		if( settings(this).showURL && $(this).url() )
			helper.url.html( $(this).url().replace('http://', '') ).show();
		else 
			helper.url.hide();
		
		// add an optional class for this tip
		helper.parent.addClass(settings(this).extraClass);

		// fix PNG background for IE
		if (settings(this).fixPNG )
			helper.parent.fixPNG();
			
		handle.apply(this, arguments);
	}
	
	// delete timeout and show helper
	function show() {
		tID = null;
		if ((!IE || !$.fn.bgiframe) && settings(current).fade) {
			if (helper.parent.is(":animated"))
				helper.parent.stop().show().fadeTo(settings(current).fade, current.tOpacity);
			else
				helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, current.tOpacity) : helper.parent.fadeIn(settings(current).fade);
		} else {
			helper.parent.show();
		}
		update();
	}
	
	/**
	 * callback for mousemove
	 * updates the helper position
	 * removes itself when no current element
	 */
	function update(event)	{
		if($.tooltip.blocked)
			return;
		
		if (event && event.target.tagName == "OPTION") {
			return;
		}
		
		// stop updating when tracking is disabled and the tooltip is visible
		if ( !track && helper.parent.is(":visible")) {
			$(document.body).unbind('mousemove', update)
		}
		
		// if no current element is available, remove this listener
		if( current == null ) {
			$(document.body).unbind('mousemove', update);
			return;	
		}
		
		// remove position helper classes
		helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
		
		var left = helper.parent[0].offsetLeft;
		var top = helper.parent[0].offsetTop;
		if (event) {
			// position the helper 15 pixel to bottom right, starting from mouse position
			left = event.pageX + settings(current).left;
			top = event.pageY + settings(current).top;
			var right='auto';
			if (settings(current).positionLeft) {
				right = $(window).width() - left;
				left = 'auto';
			}
			helper.parent.css({
				left: left,
				right: right,
				top: top
			});
		}
		
		var v = viewport(),
			h = helper.parent[0];
		// check horizontal position
		if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
			left -= h.offsetWidth + 20 + settings(current).left;
			helper.parent.css({left: left + 'px'}).addClass("viewport-right");
		}
		// check vertical position
		if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
			top -= h.offsetHeight + 20 + settings(current).top;
			helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
		}
	}
	
	function viewport() {
		return {
			x: $(window).scrollLeft(),
			y: $(window).scrollTop(),
			cx: $(window).width(),
			cy: $(window).height()
		};
	}
	
	// hide helper and restore added classes and the title
	function hide(event) {
		if($.tooltip.blocked)
			return;
		// clear timeout if possible
		if(tID)
			clearTimeout(tID);
		// no more current element
		current = null;
		
		var tsettings = settings(this);
		function complete() {
			helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
		}
		if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
			if (helper.parent.is(':animated'))
				helper.parent.stop().fadeTo(tsettings.fade, 0, complete);
			else
				helper.parent.stop().fadeOut(tsettings.fade, complete);
		} else
			complete();
		
		if( settings(this).fixPNG )
			helper.parent.unfixPNG();
	}
	
})(jQuery);


