This repository has been archived by the owner on Jun 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
/
jquery.qtip.min.js
83 lines (81 loc) · 32.5 KB
/
jquery.qtip.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* qTip - The jQuery tooltip plugin
* http://craigsworks.com/projects/qtip/
*
* Version: 2.0.0pre
* Copyright 2009 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPL Version 2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Nov 3 01:53:58 2010 +0000
*/
"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */
var TRUE=true,FALSE=false,NULL=null;
(function(a,E,M){function O(c,e){var i,g=a();if(!c)return FALSE;try{if("metadata"in c&&"object"!==typeof c.metadata)c.metadata={type:c.metadata};if("content"in c){if("object"!==typeof c.content||c.content.jquery)c.content={text:c.content};i=c.content.text||FALSE;if(!a.isFunction(i)&&(!i&&!i.attr||i.length<1||"object"===typeof i&&!i.jquery))i=c.content.text=FALSE;if("title"in c.content&&"object"!==typeof c.content.title)c.content.title={text:c.content.title}}if("position"in c){if("object"!==typeof c.position)c.position=
{my:c.position,at:c.position};if("object"!==typeof c.position.adjust)c.position.adjust={};if("undefined"!==typeof c.position.adjust.screen)c.position.adjust.screen=!!c.position.adjust.screen}if("show"in c){if("object"!==typeof c.show)c.show={event:c.show};if("object"!==typeof c.show)c.show=c.show.jquery?{target:c.show}:{event:c.show}}if("hide"in c)if("object"!==typeof c.hide)c.hide=c.hide.jquery?{target:c.hide}:{event:c.hide};if("style"in c&&"object"!==typeof c.style)c.style={classes:c.style}}catch(o){}if(a.isFunction(i)){c.content.text=
[];e.each(function(){var l=i.call(this);if(l){c.content.text.push(l);g=g.add(a(this))}})}else g=e;a.each(a.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(c)});return g}function R(c,e,i){function g(b){var d,h=b.split("."),k=e[h[0]];for(b=1;b<h.length;b+=1){d=k[h[b]];if(typeof d==="object"&&!d.jquery&&!d.precedance)k=k[h[b]];else break}return h[b]!==M?[k,h[b]]:[e,h[0]]}function o(b){var d=f.elements.tooltip,h=z+"-accessible",k=!d.is(":visible")?TRUE:FALSE,j=FALSE;if(!f.rendered)return FALSE;
k&&d.addClass(h);switch(b){case "dimensions":j={height:d.outerHeight(),width:d.outerWidth()};break;case "position":j=d.offset();break}k&&d.removeClass(h);return j}function l(){var b=f.elements;if(b.title){b.titlebar.remove();b.titlebar=b.title=b.button=NULL;b.tooltip.removeAttr("aria-labelledby")}}function t(){var b=f.elements,d=e.content.title.button;b.button&&b.button.remove();b.button=d.jquery?d:"string"===typeof d?a("<a />",{html:d}):a("<a />",{"class":"ui-state-default",text:"Close tooltip",
title:"Close tooltip",css:{"text-indent":"-10000em"}}).prepend(a("<span />",{"class":"ui-icon ui-icon-close"}));b.button.prependTo(b.titlebar).attr("role","button").addClass(z+"-"+(d===TRUE?"close":"button")).hover(function(h){a(this).toggleClass("ui-state-hover",h.type==="mouseenter")}).click(function(){b.tooltip.hasClass("ui-state-disabled")||f.hide();return FALSE}).bind("mousedown keydown mouseup keyup mouseout",function(h){a(this).toggleClass("ui-state-active ui-state-focus",/down$/i.test(h.type))})}
function m(){var b=f.elements;b.titlebar&&l();b.titlebar=a("<div />",{"class":z+"-titlebar "+(e.style.widget?"ui-widget-header":"")}).append(b.title=a("<div />",{id:z+"-"+i+"-title","class":z+"-title",html:e.content.title.text})).prependTo(b.wrapper);e.content.title.button&&t()}function y(b){if(!f.rendered||!b)return FALSE;if(a.isFunction(b))b=b.call(c);b.jquery&&b.length>0?f.elements.content.append(b.css({display:"block"})):f.elements.content.html(b);b=void 0;var d=f.elements.tooltip,h,k;if(f.rendered&&
a.browser.msie&&parseInt(a.browser.version.charAt(0),10)<9){d.css({width:"auto",maxWidth:"none"});b=o("dimensions").width;d.css({maxWidth:""});h=parseInt(d.css("max-width"),10)||0;k=parseInt(d.css("min-width"),10)||0;b=Math.min(Math.max(b,k),h);d.width(b)}f.rendered===TRUE&&f.reposition(f.cache.event);return f}function q(b,d,h,k){function j(B){if(n.tooltip.hasClass("ui-state-disabled"))return FALSE;n.show.trigger("qtip-"+i+"-inactive");clearTimeout(f.timers.show);clearTimeout(f.timers.hide);var C=
function(){f.show(e.position.target!=="mouse"?B:NULL)};if(e.show.delay>0)f.timers.show=setTimeout(C,e.show.delay);else C()}function p(B){if(n.tooltip.hasClass("ui-state-disabled"))return FALSE;var C=a(B.relatedTarget).parents(A)[0]==n.tooltip[0];clearTimeout(f.timers.show);clearTimeout(f.timers.hide);if(e.hide.fixed&&(e.position.target==="mouse"&&C||/mouse(out|leave|move)/.test(B.type)&&C)){B.stopPropagation();B.preventDefault();return FALSE}n.tooltip.stop(TRUE);if(e.hide.delay>0)f.timers.hide=setTimeout(function(){f.hide(B)},
e.hide.delay);else f.hide(B)}function u(B){if(n.tooltip.hasClass("ui-state-disabled"))return FALSE;clearTimeout(f.timers.inactive);f.timers.inactive=setTimeout(function(){f.hide(B)},e.hide.inactive)}function r(B){f.elements.tooltip.is(":visible")&&f.reposition(B)}var w=".qtip-"+i,n={show:e.show.target,hide:e.hide.target,tooltip:f.elements.tooltip},v={show:String(e.show.event).split(" "),hide:String(e.hide.event).split(" ")},s=a.browser.msie&&/^6\.[0-9]/.test(a.browser.version);c.bind("remove.qtip",
function(){f.destroy()});if(h&&e.hide.fixed){n.hide=n.hide.add(n.tooltip);n.tooltip.bind("mouseover"+w,function(){n.tooltip.hasClass("ui-state-disabled")||clearTimeout(f.timers.hide)})}if(d){if("number"===typeof e.hide.inactive){n.show.bind("qtip-"+i+"-inactive",u);a.each(a.fn.qtip.inactiveEvents,function(B,C){n.hide.add(f.elements.tooltip).bind(C+w+"-inactive",u)})}a.each(v.hide,function(B,C){var F=a.inArray(C,v.show);if(F>-1&&a(n.hide).add(n.show).length===a(n.hide).length||C==="unfocus"){n.show.bind(C+
w,function(K){n.tooltip.is(":visible")?p(K):j(K)});delete v.show[F]}else n.hide.bind(C+w,p)})}if(b){a.each(v.show,function(B,C){n.show.bind(C+w,j)});n.tooltip.bind("mouseover"+w,function(){f.focus()})}if(k){if(e.position.adjust.resize||e.position.adjust.screen)a(E).bind("resize"+w,r);if(e.position.adjust.screen||s&&n.tooltip.css("position")==="fixed")a(document).bind("scroll"+w,r);/unfocus/i.test(e.hide.event)&&a(document).bind("mousedown"+w,function(B){var C=f.elements.tooltip;a(B.target).parents(A).length===
0&&a(B.target).add(c).length>1&&C.is(":visible")&&!C.hasClass("ui-state-disabled")&&f.hide()});e.position.target==="mouse"&&a(document).bind("mousemove"+w,function(B){if(e.position.adjust.mouse&&!n.tooltip.hasClass("ui-state-disabled")&&n.tooltip.is(":visible"))f.reposition(B||a.fn.qtip.mouse)})}}function x(b,d,h,k){k=parseInt(k,10)!==0;var j=".qtip-"+i,p={show:b?e.show.target:a("<div/>"),hide:d?e.hide.target:a("<div/>"),tooltip:h?f.elements.tooltip:a("<div/>")};d={show:String(e.show.event).split(" "),
hide:String(e.hide.event).split(" ")};if(f.rendered){a.each(d.show,function(u,r){p.show.unbind(r+j)});p.show.unbind("mousemove"+j).unbind("mouseout"+j).unbind("qtip-"+i+"-inactive");a.each(d.hide,function(u,r){p.hide.add(p.tooltip).unbind(r+j)});a.each(a.fn.qtip.inactiveEvents,function(u,r){p.hide.add(h?f.elements.content:NULL).unbind(r+j+"-inactive")});p.hide.unbind("mouseout"+j);p.tooltip.unbind("mouseover"+j);if(k){a(E).unbind("resize"+j);a(document).unbind("mousedown"+j+" mousemove"+j)}}else b&&
p.show.unbind(d.show+j+"-create")}var f=this,z="ui-tooltip",A=".qtip."+z;f.id=i;f.rendered=FALSE;f.elements={target:c};f.cache={event:{},target:NULL,disabled:FALSE};f.timers={};f.options=e;f.plugins={};a.extend(f,{render:function(b){var d=f.elements,h=a.Event("tooltiprender");if(f.rendered)return FALSE;f.rendered=b?-2:-1;d.tooltip=a("<div/>").attr({id:z+"-"+i,role:"tooltip","class":z+" qtip ui-tooltip-accessible ui-helper-reset "+e.style.classes}).css("z-index",a.fn.qtip.zindex+a(A).length).toggleClass("ui-widget",
e.style.widget).toggleClass("ui-state-disabled",f.cache.disabled).data("qtip",f).appendTo(e.position.container);d.wrapper=a("<div />",{"class":z+"-wrapper"}).appendTo(d.tooltip);d.content=a("<div />",{"class":z+"-content "+(e.style.widget?"ui-widget-content":""),id:z+"-"+i+"-content"}).appendTo(d.wrapper);y(e.content.text);e.content.title.text&&m();a.each(a.fn.qtip.plugins,function(){this.initialize==="render"&&this(f)});f.rendered=TRUE;if(e.show.ready||b){d.tooltip.hide();f.show(f.cache.event)}q(1,
1,1,1);a.each(e.events,function(k,j){d.tooltip.bind("tooltip"+k,j)});d.tooltip.removeClass("ui-tooltip-accessible");h.originalEvent=a.extend({},f.cache.event);d.tooltip.trigger(h,[f.hash()]);return f},get:function(b){switch(b.toLowerCase()){case "offset":b=o("position");break;case "dimensions":b=o("dimensions");break;default:b=g(b.toLowerCase());b=b[0].precedance?b[0].string():b[0].jquery?b[0]:b[0][b[1]];break}return b},set:function(b,d){b=b.toLowerCase();var h=g(b),k=f.elements,j=k.tooltip,p,u,r,
w={builtin:{id:function(){var n=d===TRUE?a.fn.qtip.nextid:d,v=z+"-"+n;if(n!==FALSE&&n.length>0&&!a("#ui-tooltip-"+n).length){j[0].id=v;k.content[0].id=v+"-content";k.title[0].id=v+"-title"}},"^content.text":function(){y(d)},"^content.title.text":function(){if(f.rendered)if(!f.elements.title&&d){m();f.reposition()}else d?f.elements.title.html(d):l()},"^content.title.button":function(){var n=f.elements.button,v=f.elements.title;if(f.rendered)if(d){v||m();t()}else n.remove()},"^position.(my|at)$":function(){var n=
/my$/i.test(b)?"my":"at";if("string"===typeof d)e.position[n]=new a.fn.qtip.plugins.Corner(d)},"^position.(my|at|adjust|target)":function(){f.rendered&&f.reposition()},"^position.container$":function(){if(f.rendered===TRUE){j.appendTo(d);f.reposition()}},"^(show|hide).(event|target|fixed|delay|inactive)":function(n,v,s,B){var C=b.search(/fixed/i)>-1?[0,[0,1,1,1]]:[b.substr(0,3),b.charAt(0)==="s"?[1,0,0,0]:[0,1,0,0]];if(C[0])n[v]=B;x.apply(f,C[1]);if(C[0])n[v]=s;q.apply(f,C[1])},"^show.ready$":function(){f.rendered===
FALSE&&f.show()},"^style.classes$":function(){f.elements.tooltip.css("class",z+" qtip ui-helper-reset "+d)},"^style.widget$":function(){j.toggleClass("ui-widget",!!d);k.titlebar.toggleClass("ui-widget-header",!!d);k.content.toggleClass("ui-widget-content",!!d)},"^events.(render|show|move|hide|focus|blur)":function(n,v,s,B){a.isFunction(d)?k.tooltip.bind("tooltip"+v,s):k.tooltip.unbind("tooltip"+v,B)}}};a.each(f.plugins,function(n){if("object"===typeof this.checks)w[n]=this.checks});p=h[0][h[1]];h[0][h[1]]=
d.nodeType?a(d):d;O(e,c);for(u in w)for(r in w[u])RegExp(r,"i").test(b)&&w[u][r].call(f,h[0],h[1],d,p);return f},toggle:function(b,d){function h(){var w=a(this),n=b?"attr":"removeAttr",v=/^1|0$/.test(w.css("opacity"));f.elements.title&&c[n]("aria-labelledby",z+"-"+i+"-title");c[n]("aria-describedby",z+"-"+i+"-content");if(b){if(a.browser.msie&&this.style&&v){r=this.style;r.removeAttribute("filter");r.removeAttribute("opacity")}}else v&&w.hide()}if(f.rendered===FALSE)return FALSE;var k=b?"show":"hide",
j=f.elements.tooltip,p=e[k],u=j.is(":visible"),r;if((typeof b).search("boolean|number"))b=!j.is(":visible");if(!u&&!b||j.is(":animated"))return f;if(d){if(f.cache.event&&/over|enter/.test(d.type)&&/out|leave/.test(f.cache.event.type)&&a(d.target).add(e.show.target).length<2&&a(d.relatedTarget).parents(A).length>0)return f;f.cache.event=a.extend({},d)}u=a.Event("tooltip"+k);u.originalEvent=a.extend({},d);j.trigger(u,[f.hash(),90]);if(u.isDefaultPrevented())return f;if(b){f.focus();f.reposition(d);
p.solo&&a(A).qtip("hide")}else clearTimeout(f.timers.show);j.attr("aria-hidden",Boolean(!b));j.stop(TRUE,FALSE);if(a.isFunction(p.effect)){p.effect.call(j,f.hash());j.queue(function(){h.call(this);a(this).dequeue()})}else if(p.effect===FALSE){j[k]();h.call(j)}else j.fadeTo(90,b?1:0,h);b&&p.target.trigger("qtip-"+i+"-inactive");return f},show:function(b){f.toggle(TRUE,b)},hide:function(b){f.toggle(FALSE,b)},focus:function(b){if(f.rendered===false)return FALSE;var d=f.elements.tooltip,h=a(A),k=parseInt(d.css("z-index"),
10),j=a.fn.qtip.zindex+h.length,p=z+"-focus",u=a.extend({},b);if(!d.hasClass(p)&&k!==j){h.css("z-index",function(r,w){return w-1});a(A+"."+p).each(function(){var r=a(this),w=r.qtip(),n;if(!w||w.rendered===FALSE)return TRUE;r.removeClass(p);n=a.Event("tooltipblur");n.originalEvent=u;r.trigger(n,[w,j])});b=a.Event("tooltipfocus");b.originalEvent=u;d.trigger(b,[f.hash(),j]);b.isDefaultPrevented()||d.css({zIndex:j}).addClass(p)}return f},reposition:function(b){if(f.rendered===FALSE)return FALSE;var d=
e.position.target,h=f.elements.tooltip,k=e.position,j=k.my,p=k.at,u=f.elements.tooltip.width(),r=f.elements.tooltip.height(),w=a(k.container)[0],n=0,v=0,s={left:0,top:0},B=a.Event("tooltipmove"),C=h.css("position")==="fixed",F=a(E),K={left:function(D){var H=d==="mouse"?b.pageX:d.offset().left,I=F.scrollLeft(),G=F.width(),L=p.x==="left"?n:p.x==="right"?-n:n/2,J=j.x!==p.x&&p.x!=="center"?n:0,P=L+(j.x==="left"?-u:j.x==="right"?u:u/2)+-2*k.adjust.x;G=D+u-G-I;if(I-D>0&&!(D>=H&&D<H+n))s.left+=P-L+J;else if(G>
0&&D+u>H)s.left+=(j.x==="center"?-1:1)*(P-L-J);return s.left-D},top:function(D){var H=F.scrollTop(),I=F.height(),G=p.y==="top"?v:p.y==="bottom"?-v:0,L=j.y!==p.y&&p.y!=="center"?v:0,J=G+(j.y==="top"?-r:j.y==="bottom"?r:-r/2)+-2*k.adjust.y;I=D+r-I-H;if(H-D>0)s.top+=j.y==="center"?-J+G:J;else if(I>0)s.top+=J-G-L;return s.top-D}};if(d==="mouse"){p={x:"left",y:"top"};b=a.extend({},a.fn.qtip.mouse);s={top:b.pageY,left:b.pageX}}else{if(d==="event")d=b&&b.target&&b.type!=="scroll"&&b.type!=="resize"?f.cache.target=
a(b.target):f.cache.target;d=a(d).eq(0);if(d.length===0)return f;else if(d[0]===document||d[0]===E){n=d.width();v=d.height();if(d[0]===E)s={top:C?0:F.scrollTop(),left:C?0:F.scrollLeft()}}else if(d.is("area")&&a.fn.qtip.plugins.imagemap){s=a.fn.qtip.plugins.imagemap(d,p);n=s.width;v=s.height;s=s.offset}else{n=d.outerWidth();v=d.outerHeight();s=d.offset();if(k.adjust.offset){do{s.left-=w.offsetLeft-w.scrollLeft;s.top-=w.offsetTop-w.scrollTop}while(w=w.offsetParent)}}s.left+=p.x==="right"?n:p.x==="center"?
n/2:0;s.top+=p.y==="bottom"?v:p.y==="center"?v/2:0}s.left+=k.adjust.x+(j.x==="right"?-u:j.x==="center"?-u/2:0);s.top+=k.adjust.y+(j.y==="bottom"?-r:j.y==="center"?-r/2:0);s.adjusted=k.adjust.screen&&d[0]!==E&&d[0]!==document.body?{left:K.left(s.left),top:K.top(s.top)}:{left:0,top:0};if(k.container[0]==document.body){if(s.top+F.scrollTop()<1)s.top=0;if(s.left+F.scrollLeft()<1)s.left=0}h.attr("class",function(){return a(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(z+"-pos-"+j.abbreviation());
B.originalEvent=a.extend({},b);h.trigger(B,[f.hash(),s]);if(B.isDefaultPrevented())return f;delete s.adjusted;if(h.is(":visible")&&a.isFunction(k.effect)){k.effect.call(h,f.hash(),s);h.queue(function(){var D=a(this);D.css({opacity:"",height:""});a.browser.msie&&this.style&&this.style.removeAttribute("filter");D.dequeue()})}else isNaN(s.left,s.top)||h.css(s);return f},disable:function(b){var d=f.elements.tooltip;if(f.rendered)d.toggleClass("ui-state-disabled",b);else f.cache.disabled=!!b;return f},
destroy:function(){var b=f.elements,d=b.target.data("oldtitle");f.rendered&&a.each(f.plugins,function(){this.initialize==="render"&&this.destroy()});x(1,1,1,1);c.removeData("qtip");f.rendered&&b.tooltip.remove();d&&c.attr("title",d);c.removeAttr("aria-describedby");return c},hash:function(){var b=a.extend({},f);delete b.cache;delete b.timers;delete b.options;delete b.plugins;delete b.render;delete b.hash;return b}})}function S(c,e){var i,g=a(this);i=a(document.body);var o=g.metadata?g.metadata(e.metadata):
{};o=a.extend(TRUE,{},e,o);var l=o.position,t=this===document?i:g;if("boolean"===typeof o.content.text)if(o.content.attr!==FALSE&&g.attr(o.content.attr))o.content.text=g.attr(o.content.attr);else return FALSE;if(l.container===FALSE)l.container=i;if(l.target===FALSE)l.target=t;if(o.show.target===FALSE)o.show.target=t;if(o.hide.target===FALSE)o.hide.target=t;l.at=new a.fn.qtip.plugins.Corner(l.at);l.my=new a.fn.qtip.plugins.Corner(l.my);if(g.data("qtip"))if(o.overwrite)g.qtip("destroy");else if(o.overwrite===
FALSE)return FALSE;i=new R(g,o,c);g.data("qtip",i);return i}function T(c){var e=this;e.checks={"^content.ajax":function(){this.plugins.ajax.load(this.options.content.ajax)}};a.extend(e,{init:function(){var i=c.options.content.ajax;c.elements.tooltip.bind("tooltiprender.ajax",function(){e.load(i);c.elements.tooltip.bind("tooltipshow.ajax",function(){i.once===FALSE&&c.rendered===TRUE&&e.load(i)})})},load:function(i){a.ajax(a.extend(TRUE,{},i,{success:function(g,o){if(a.isFunction(i.success))if(i.success.call(c.hash(),
g,o)===FALSE)return;c.set("content.text",g);N.remove()},error:function(g,o,l){var t=o||l;if(a.isFunction(i.error)){g=i.error.call(c.hash(),g,o,l);if(g===FALSE)return}c.set("content.text",t)}}));return e},destroy:function(){c.elements.tooltip.unbind("tooltipshow.ajax")}});e.init()}function Q(c,e,i){var g=Math.floor(e/2),o=Math.floor(i/2);e={bottomright:[[0,0],[e,i],[e,0]],bottomleft:[[0,0],[e,0],[0,i]],topright:[[0,i],[e,0],[e,i]],topleft:[[0,0],[0,i],[e,i]],topcenter:[[0,i],[g,0],[e,i]],bottomcenter:[[0,
0],[e,0],[g,i]],rightcenter:[[0,0],[e,o],[0,i]],leftcenter:[[e,0],[e,i],[0,o]]};e.lefttop=e.bottomright;e.righttop=e.bottomleft;e.leftbottom=e.topright;e.rightbottom=e.topleft;return e[c]}function U(c){function e(b){var d=l.tip,h=["left","right"],k={left:0,right:0,top:0,bottom:0},j=0;if(o.corner===FALSE||!d)return FALSE;b=b||g.corner;d.css({top:"",bottom:"",left:"",right:"",margin:""});h[b.precedance==="y"?"push":"unshift"]("top","bottom");if(a.browser.msie)k={top:b.precedance==="y"?0:0,left:0,bottom:b.precedance===
"y"?0:0,right:0};switch(b[b.precedance==="y"?"x":"y"]){case "center":d.css(h[0],"50%").css("margin-"+h[0],-(q[b.precedance==="y"?"width":"height"]/2));break;case h[0]:d.css(h[0],k[h[0]]+z);break;case h[1]:d.css(h[1],k[h[1]]+z);break}j=q[b.precedance==="x"?"width":"height"];if(f){t.toggleClass("ui-tooltip-accessible",!t.is(":visible"));j-=parseInt(m.css("border-"+b[b.precedance]+"-width"),10)||0;t.removeClass("ui-tooltip-accessible")}d.css(b[b.precedance],-1*k[b[b.precedance]]-j)}function i(b,d,h){if(l.tip){b=
a.extend({},g.corner);d=g.mimic.adjust?a.extend({},g.mimic):NULL;var k=b.precedance==="y"?["y","top","left","height"]:["x","left","top","width"],j=h.adjusted,p=parseInt(m.css("border-"+b[k[0]]+"-width"),10)||0;a.each([b,d],function(){if(j.left)this.x=this.x==="center"?j.left>0?"left":"right":this.x==="left"?"right":"left";if(j.top)this.y=this.y==="center"?j.top>0?"top":"bottom":this.y==="top"?"bottom":"top"});h[k[1]]+=(b[k[0]]===k[1]?1:-1)*(q[k[3]]-p);h[k[2]]-=z;if(b.string()!==y.corner.string()&&
(y.top!==j.top||y.left!==j.left))g.update(b,d);y.left=j.left;y.top=j.top;y.corner=b}}var g=this,o=c.options.style.tip,l=c.elements,t=l.tooltip,m=l.wrapper,y={top:0,left:0,corner:{string:function(){}}},q={width:o.width,height:o.height},x={},f=o.border||0,z=o.adjust||0,A=o.method||FALSE;g.corner=NULL;g.mimic=NULL;g.checks={"^position.my|style.tip.(corner|mimic|method|border)":function(){f=o.border;if(g.detectCorner()){g.create();g.detectColours();g.update()}else g.tip.remove();this.get("position.target")!==
"mouse"&&this.reposition()},"^style.tip.(height|width)":function(){q={width:o.width,height:o.height};g.create();g.update();c.reposition()}};a.extend(g,{init:function(){if(A===TRUE)A=a("<canvas />")[0].getContext?"canvas":a.browser.msie&&(g.mimic&&/center/i.test(g.mimic.string())||q.height!==q.width)?"vml":"polygon";else if(A==="canvas")A=a.browser.msie?"vml":!a("<canvas />")[0].getContext?"polygon":"canvas";else if(A==="polygon")A=a.browser.msie&&/center/i.test(g.mimic.string())?"vml":A;if(g.detectCorner()){g.create();
g.detectColours();g.update();t.bind("tooltipmove.tip",i)}return g},detectCorner:function(){var b=o.corner,d=o.mimic||b,h=c.options.position.at,k=c.options.position.my;if(k.string)k=k.string();if(b===FALSE||k===FALSE&&h===FALSE)return FALSE;else{if(b===TRUE)g.corner=new a.fn.qtip.plugins.Corner(k);else if(!b.string)g.corner=new a.fn.qtip.plugins.Corner(b);if(d===TRUE)g.mimic=new a.fn.qtip.plugins.Corner(k);else if(!d.string){g.mimic=new a.fn.qtip.plugins.Corner(d);g.mimic.precedance=g.corner.precedance}}return g.corner.string()!==
"centercenter"},detectColours:function(){var b=l.tip,d=g.mimic[g.mimic.precedance],h="border-"+d+"-color";x.fill=b.css("background-color","").css("border","").css("background-color")||"transparent";x.border=b.get(0).style?b.get(0).style["border"+d.charAt(0)+d.substr(1)+"Color"]:b.css(h)||"transparent";if(/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(x.fill))x.fill=m.css(f?"background-color":h);if(!x.border||/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(x.border))x.border=m.css(h)||x.fill;a("*",b).add(b).css("background-color",
"transparent").css("border",0)},create:function(){var b=q.width,d=q.height;l.tip&&l.tip.remove();l.tip=a('<div class="ui-tooltip-tip" />').toggleClass("ui-widget-content",c.options.style.widget).css(q).prependTo(t);switch(A){case "canvas":l.tip.append('<canvas height="'+d+'" width="'+b+'" />');break;case "vml":l.tip.html('<vml:shape coordorigin="0 0" coordsize="'+b+" "+d+'" stroked="'+!!f+'" style="behavior:url(#default#VML); display:inline-block; antialias:TRUE; position: absolute; top:0; left:0; width:'+
b+"px; height:"+d+"px; vertical-align:"+g.corner.y+';"><vml:stroke weight="'+(f-2)+'px" joinstyle="miter" miterlimit="10" style="behavior:url(#default#VML); display:inline-block;" /></vml:shape>');break;case "polygon":l.tip.append('<div class="ui-tooltip-tip-inner" />').append(f?'<div class="ui-tooltip-tip-border" />':"");break}return g},update:function(b,d){var h=l.tip,k=q.width,j=q.height,p=f>0?0:1,u=Math.ceil(f/2+0.5),r;d||(d=b?b:g.mimic);if(!b)b=g.corner;if(d.x==="false")d.x=b.x;if(d.y==="false")d.y=
b.y;h=h.children();switch(A){case "canvas":h=h.get(0).getContext("2d");h.restore();h.clearRect(0,0,3E3,3E3);for(r=Q(d.string(),k,j);p<2;p++){if(p){h.save();h.translate(Math.floor((d.x==="left"?1:d.x==="right"?-1:0)*(f+1)*(d.precedance==="y"?0.5:1)),Math.floor((d.y==="top"?1:d.y==="bottom"?-1:0)*(f+1)*(d.precedance==="x"?0.5:1)))}h.beginPath();h.moveTo(r[0][0],r[0][1]);h.lineTo(r[1][0],r[1][1]);h.lineTo(r[2][0],r[2][1]);h.closePath();h.fillStyle=x[p?"fill":"border"];h.fill()}break;case "vml":r=Q(d.string(),
k,j);p="m"+r[0][0]+","+r[0][1]+" l"+r[1][0]+","+r[1][1]+" "+r[2][0]+","+r[2][1]+" xe";h.attr({path:p,fillcolor:x.fill});if(f){h.children().attr("color",x.border);if(d.precedance==="y"){h.css("top",(d.y==="top"?1:-1)*(f-2));h.css("left",d.x==="left"?1:-2)}else{h.css("left",(d.x==="left"?1:-1)*(f-2));h.css("top",d.y==="top"?1:-2)}}break;case "polygon":if(d.precedance==="y"){p=k>j?1.5:k<j?5:2.2;u=[d.x==="left"?u:d.x==="right"?-u:0,Math.floor(p*u*(d.y==="bottom"?-1:1)*(d.x==="center"?0.8:1))]}else{p=
k<j?1.5:k>j?5:2.2;u=[Math.floor(p*u*(d.x==="right"?-1:1)*(d.y==="center"?0.9:1)),d.y==="top"?u:d.y==="bottom"?-u:0]}h.removeAttr("style").each(function(w){var n={x:d.precedance==="x"?d.x==="left"?"right":"left":d.x,y:d.precedance==="y"?d.y==="top"?"bottom":"top":d.y},v=d.x==="center"?["left","right",n.y,j,k]:["top","bottom",n.x,k,j],s=x[!w&&f?"border":"fill"];w&&a(this).css({position:"absolute","z-index":1,left:u[0],top:u[1]});d.x==="center"||d.y==="center"?a(this).css("border-"+v[2],v[3]+"px solid "+
s).css("border-"+v[0],Math.floor(v[4]/2)+"px dashed transparent").css("border-"+v[1],Math.floor(v[4]/2)+"px dashed transparent"):a(this).css("border-width",Math.floor(j/2)+"px "+Math.floor(k/2)+"px").css("border-"+n.x,Math.floor(k/2)+"px solid "+s).css("border-"+n.y,Math.floor(j/2)+"px solid "+s)});break}e(b);return g},destroy:function(){l.tip&&l.tip.remove();t.unbind("tooltipmove.tip")}})}function V(c,e){var i=this,g=c.elements,o=g.tooltip;g.overlay=a("#qtip-overlay");a.extend(i,{init:function(){o.bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",
function(l,t,m){l=l.type.replace("tooltip","");a.isFunction(e[l])?e[l].call(g.overlay,m,t):i[l](m)});g.overlay.length||i.create();e.blur===TRUE&&g.overlay.bind("click.qtipmodal"+c.id,function(){c.hide.call(c)})},create:function(){g.overlay=a("<div />",{id:"qtip-overlay",css:{position:"absolute",top:0,left:0,display:"none"}}).appendTo(document.body);a(E).bind("resize.qtipmodal",function(){g.overlay.css({height:Math.max(a(E).height(),a(document).height()),width:Math.max(a(E).width(),a(document).width())})}).trigger("resize")},
toggle:function(l){var t=g.overlay,m=c.options.show.modal.effect,y=l?"show":"hide";t.stop(TRUE,FALSE);if(a.isFunction(m))m.call(t,l);else m===FALSE?t[y]():t.fadeTo(90,l?0.7:0,function(){l||a(this).hide()})},show:function(){i.toggle(TRUE)},hide:function(){i.toggle(FALSE)},destroy:function(){var l=TRUE;a("*").each(function(){var t=a(this).data("qtip");if(t&&t.id!==c.id&&t.options.show.modal)return l=FALSE});if(l){g.overlay.remove();a(E).unbind("scroll.qtipmodal resize.qtipmodal")}else g.overlay.unbind("click.qtipmodal"+
c.id);o.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});i.init()}function W(c){var e=this,i=c.elements,g=i.tooltip,o=".bgiframe-"+c.id,l="tooltipmove"+o+" tooltipshow"+o;a.extend(e,{init:function(){i.bgiframe=a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>');i.bgiframe.appendTo(g);g.bind(l,e.adjust)},adjust:function(){var t=c.get("dimensions"),m=c.plugins.tip,
y=c.elements.tip,q;q=parseInt(g.css("border-left-width"),10);q={left:-q,top:-q};if(m&&y){m=m.corner.precedance==="x"?["width","left"]:["height","top"];q[m[1]]-=y[m[0]]()}i.bgiframe.css(q).css(t)},destroy:function(){e.iframe.remove();g.unbind(l)}});e.init()}a.fn.qtip=function(c,e,i){var g=String(c).toLowerCase(),o=NULL,l=g==="disable"?[TRUE]:a.makeArray(arguments).slice(1,10),t=l[l.length-1],m=a.extend(TRUE,{},c),y;if(!arguments.length&&this.data("qtip")||g==="api")return(m=this.data("qtip"))?m.hash():
M;else if("string"===typeof c){this.each(function(){var q=a(this).data("qtip");if(!q)return TRUE;if(/option|set/.test(g)&&e)if(i!==M)q.set(e,i);else o=q.get(e);else{if(!q.rendered&&(g==="show"||g==="toggle")){if(t&&t.timeStamp)q.cache.event=t;q.render()}else if(g==="enable"){g="disable";l=[FALSE]}q[g]&&q[g].apply(q[g],l)}});return o!==NULL?o:this}else if("object"===typeof c){y=O(m,this);m=a.extend(TRUE,{},a.fn.qtip.defaults,m);return a.fn.qtip.bind.call(y,m,t)}};a.fn.qtip.bind=function(c,e){return this.each(function(i){function g(z){function A(){m.render(typeof z===
"object"||y.show.ready);q.show.unbind(x.show);q.hide.unbind(x.hide)}if(m.cache.disabled)return FALSE;m.cache.event=a.extend({},z);if(y.show.delay>0){clearTimeout(m.timers.show);m.timers.show=setTimeout(A,y.show.delay);x.show!==x.hide&&q.hide.bind(x.hide,function(){clearTimeout(m.timers.show)})}else A()}var o=a(this),l=c.id,t=c.content.text,m,y,q,x,f;c.id=l=l===FALSE||l.length<1||a("#ui-tooltip-"+l).length?a.fn.qtip.nextid++:l;f=".qtip-"+l+"-create";m=S.call(this,l,c);if(m===FALSE)return TRUE;y=m.options;
if(a.isArray(t))y.content.text=t[i];o.attr("title")&&o.data("oldtitle",o.attr("title")).removeAttr("title");a.each(a.fn.qtip.plugins,function(){this.initialize==="initialize"&&this(m)});q={show:y.show.target,hide:y.hide.target};x={show:String(y.show.event).replace(" ",f+" ")+f,hide:String(y.hide.event).replace(" ",f+" ")+f};q.show.bind(x.show,g);if(c.show.ready||c.prerender||c.show.event===FALSE)g(e)})};a.each({attr:function(c){var e=a(this).data("qtip");return arguments.length===1&&c==="title"&&
e&&e.rendered===TRUE?a(this).data("oldtitle"):NULL},remove:a.ui?NULL:function(c,e){this.each(function(){if(!e)if(!c||a.filter(c,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})},offset:!a.fn.qtip.isiPad?NULL:function(){var c=a(this).Oldoffset();c.top-=E.scrollY;c.left-=E.scrollX;return c}},function(c,e){if(!e)return TRUE;a.fn["Old"+c]=a.fn[c];a.fn[c]=function(){return e.apply(this,arguments)||a.fn["Old"+c].apply(this,arguments)}});a(document.body).attr("role",
function(c,e){return!e?"application":e});a(document).bind("mousemove.qtip",function(c){a.fn.qtip.mouse={pageX:c.pageX,pageY:c.pageY}});a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.isiPad=navigator.userAgent.indexOf("iPad")!=-1&&/OS (?:3_2|4_0)/i.test(navigator.userAgent);a.fn.qtip.plugins={Corner:function(c){this.x=(String(c).replace(/middle/i,"center").match(/left|right|center/i)||["false"])[0].toLowerCase();
this.y=(String(c).replace(/middle/i,"center").match(/top|bottom|center/i)||["false"])[0].toLowerCase();this.precedance=c.charAt(0).search(/^(t|b)/)>-1?"y":"x";this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var e=this.x.substr(0,1),i=this.y.substr(0,1);return e===i?e:e==="c"||e!=="c"&&i!=="c"?i+e:e+i}}};a.fn.qtip.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,metadata:{type:"class"},content:{text:TRUE,attr:"title",title:{text:FALSE,
button:FALSE}},position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,adjust:{x:0,y:0,mouse:TRUE,screen:FALSE,resize:TRUE,offset:FALSE},effect:TRUE},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE},style:{classes:"",widget:FALSE},events:{render:a.noop,move:a.noop,show:a.noop,hide:a.noop,focus:a.noop,blur:a.noop}};var N=a();a.fn.qtip.plugins.ajax=function(c){var e=
c.plugins.ajax,i=c.options.content.ajax;if(i&&i.url)if(e)return e;else{c.plugins.ajax=new T(c);return c.plugins.ajax}};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(c){try{var e=c.content.ajax;if(typeof e!=="object")c.content.ajax={url:e};if(c.content.text===FALSE)c.content.text="Loading...";e.once=!!e.once;e.preload=!!e.preload;if(e.preload){var i=e.url;a("#qtip-preload").length||a('<div id="qtip-preload" class="ui-tooltip-accessible" />').appendTo(document.body);
N.length||(N=a("<div />").appendTo("#qtip-preload").load(i+" img"))}}catch(g){}};a.extend(TRUE,a.fn.qtip.defaults,{content:{ajax:{once:TRUE,preload:FALSE}}});a.fn.qtip.plugins.tip=function(c){var e=c.plugins.tip,i=c.options.style.tip;if(i&&i.corner)if(e)return e;else{c.plugins.tip=new U(c);c.plugins.tip.init();return c.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(c){try{var e=c.style.tip;if(typeof e!=="object")c.style.tip={corner:!!e};if(typeof e.method!==
"string")e.method=TRUE;if(!/canvas|polygon/i.test(e.method))e.method=TRUE;if(typeof e.width!=="number")e.width=12;if(typeof e.height!=="number")e.height=12;if(typeof e.border!=="number")e.border=0}catch(i){}};a.extend(TRUE,a.fn.qtip.defaults,{style:{tip:{corner:TRUE,method:TRUE,width:12,height:12,border:0}}});a.fn.qtip.plugins.imagemap=function(c,e){function i(x,f){for(var z=0,A=1,b=1,d=0,h=0,k=x.width,j=x.height;k>0&&j>0&&A>0&&b>0;){k=Math.floor(k/2);j=Math.floor(j/2);if(e.x==="left")A=k;else if(e.x===
"right")A=x.width-k;else A+=Math.floor(k/2);if(e.y==="top")b=j;else if(e.y==="bottom")b=x.height-j;else b+=Math.floor(j/2);for(z=f.length;z--;){if(f.length<2)break;d=f[z][0]-x.offset.left;h=f[z][1]-x.offset.top;if(e.x==="left"&&d>=A||e.x==="right"&&d<=A||e.x==="center"&&(d<A||d>x.width-A)||e.y==="top"&&h>=b||e.y==="bottom"&&h<=b||e.y==="center"&&(h<b||h>x.height-b))f.splice(z,1)}}return{left:f[0][0],top:f[0][1]}}var g=c.attr("shape").toLowerCase(),o=c.attr("coords").split(","),l=[],t=a('img[usemap="#'+
c.parent("map").attr("name")+'"]').offset(),m={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},y=0,q=0;if(g==="poly")for(y=o.length;y--;){q=[parseInt(o[--y],10),parseInt(o[y+1],10)];if(q[0]>m.offset.right)m.offset.right=q[0];if(q[0]<m.offset.left)m.offset.left=q[0];if(q[1]>m.offset.bottom)m.offset.bottom=q[1];if(q[1]<m.offset.top)m.offset.top=q[1];l.push(q)}else l=a.map(o,function(x){return parseInt(x,10)});switch(g){case "rect":m={width:Math.abs(l[2]-l[0]),height:Math.abs(l[3]-l[1]),
offset:{left:l[0],top:l[1]}};break;case "circle":m={width:l[2]+2,height:l[2]+2,offset:{left:l[0],top:l[1]}};break;case "poly":a.extend(m,{width:Math.abs(m.offset.right-m.offset.left),height:Math.abs(m.offset.bottom-m.offset.top)});m.offset=e.string()==="centercenter"?{left:m.offset.left+m.width/2,top:m.offset.top+m.height/2}:i(m,l.slice());m.width=m.height=0;break}m.offset.left+=t.left;m.offset.top+=t.top;return m};a.fn.qtip.plugins.modal=function(c){var e=c.plugins.modal,i=c.options.show.modal;if(e)return e;
else if(i&&i.on===TRUE){c.plugins.modal=new V(c,i);return c.plugins.modal}};a.fn.qtip.plugins.modal.initialize="render";a.fn.qtip.plugins.modal.sanitize=function(c){if(c.show)if(typeof c.show.modal!=="object")c.show.modal={on:!!c.show.modal};else if(typeof c.show.modal.on==="undefined")c.show.modal.on=TRUE};a.extend(TRUE,a.fn.qtip.defaults,{show:{modal:{on:FALSE,effect:TRUE,blur:TRUE}}});a.fn.qtip.plugins.bgiframe=function(c){if(!(a.browser.msie&&/^6\.[0-9]/.test(a.browser.version)&&a("select, object").length))return FALSE;
var e=c.plugins.bgiframe;if(e)return e;else{c.plugins.bgiframe=new W(c);return c.plugins.bgiframe}};a.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);