This repository has been archived by the owner on Jun 14, 2020. It is now read-only.
/
jquery.qtip.min.js
83 lines (81 loc) · 32.7 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: Sun Nov 28 23:14:08 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 N(d,c){var h,g=a();if(!d)return FALSE;try{if("metadata"in d&&"object"!==typeof d.metadata)d.metadata={type:d.metadata};if("content"in d){if("object"!==typeof d.content||d.content.jquery)d.content={text:d.content};h=d.content.text||FALSE;if(!a.isFunction(h)&&(!h&&!h.attr||h.length<1||"object"===typeof h&&!h.jquery))h=d.content.text=FALSE;if("title"in d.content&&"object"!==typeof d.content.title)d.content.title={text:d.content.title}}if("position"in d){if("object"!==typeof d.position)d.position=
{my:d.position,at:d.position};if("object"!==typeof d.position.adjust)d.position.adjust={};if("undefined"!==typeof d.position.adjust.screen)d.position.adjust.screen=!!d.position.adjust.screen}if("show"in d){if("object"!==typeof d.show)d.show={event:d.show};if("object"!==typeof d.show)d.show=d.show.jquery?{target:d.show}:{event:d.show}}if("hide"in d)if("object"!==typeof d.hide)d.hide=d.hide.jquery?{target:d.hide}:{event:d.hide};if("style"in d&&"object"!==typeof d.style)d.style={classes:d.style}}catch(p){}if(a.isFunction(h)){d.content.text=
[];c.each(function(){var l=h.call(this);if(l){d.content.text.push(l);g=g.add(a(this))}})}else g=c;a.each(a.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(d)});return c?g:d}function P(d,c,h){function g(b){var e,i=b.split("."),j=c[i[0]];for(b=1;b<i.length;b+=1){e=j[i[b]];if(typeof e==="object"&&!e.jquery&&!e.precedance)j=j[i[b]];else break}return i[b]!==M?[j,i[b]]:[c,i[0]]}function p(b){b=b[0];var e={left:0,top:0},i=!c.position.adjust.container;if(b.offsetParent){do{e.left+=b.offsetLeft;e.top+=
b.offsetTop}while(b=i?b.offsetParent:0)}return e}function l(b){var e=f.elements.tooltip,i=x+"-accessible",j=!e.is(":visible")?TRUE:FALSE,k=FALSE;if(!f.rendered)return FALSE;j&&e.addClass(i);switch(b){case "dimensions":k={height:e.outerHeight(),width:e.outerWidth()};break;case "position":k=p(e);break}j&&e.removeClass(i);return k}function v(){var b=f.elements;if(b.title){b.titlebar.remove();b.titlebar=b.title=b.button=NULL;b.tooltip.removeAttr("aria-labelledby")}}function m(){var b=f.elements,e=c.content.title.button;
b.button&&b.button.remove();b.button=e.jquery?e:"string"===typeof e?a("<a />",{html:e}):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(x+"-"+(e===TRUE?"close":"button")).hover(function(i){a(this).toggleClass("ui-state-hover",i.type==="mouseenter")}).click(function(){b.tooltip.hasClass("ui-state-disabled")||f.hide();
return FALSE}).bind("mousedown keydown mouseup keyup mouseout",function(i){a(this).toggleClass("ui-state-active ui-state-focus",/down$/i.test(i.type))})}function z(){var b=f.elements;b.titlebar&&v();b.titlebar=a("<div />",{"class":x+"-titlebar "+(c.style.widget?"ui-widget-header":"")}).append(b.title=a("<div />",{id:x+"-"+h+"-title","class":x+"-title",html:c.content.title.text})).prependTo(b.wrapper);c.content.title.button&&m()}function t(b){var e=f.elements;if(!f.rendered||!b)return FALSE;if(a.isFunction(b))b=
b.call(d);b.jquery&&b.length>0?e.content.empty().append(b.css({display:"block"})):e.content.html(b);e.tooltip.queue("fx",function(i){function j(o){k=k.not(o);if(k.length===0){o=void 0;var s=f.elements.tooltip,w,u;if(f.rendered&&a.browser.msie&&parseInt(a.browser.version.charAt(0),10)<9){s.css({width:"auto",maxWidth:"none"});o=l("dimensions").width;s.css({maxWidth:""});w=parseInt(s.css("max-width"),10)||0;u=parseInt(s.css("min-width"),10)||0;o=w+u?Math.min(Math.max(o,u),w):o;s.width(o)}f.rendered===
TRUE&&f.reposition(f.cache.event);i()}}var k=a("img:not([height]):not([width])",f.elements.content);k.each(function(o,s){var w=["abort","error","load","unload",""].join(".qtip-image ");a(this).bind(w,function(){clearTimeout(f.timers.img[o]);j(this)});(function u(){if(s.height)return j(s);f.timers.img[o]=setTimeout(u,20)})();return TRUE});k.length===0&&j(k)});return f}function y(b,e,i,j){function k(C){if(q.tooltip.hasClass("ui-state-disabled"))return FALSE;q.show.trigger("qtip-"+h+"-inactive");clearTimeout(f.timers.show);
clearTimeout(f.timers.hide);var A=function(){f.show(c.position.target!=="mouse"?C:NULL)};if(c.show.delay>0)f.timers.show=setTimeout(A,c.show.delay);else A()}function o(C){if(q.tooltip.hasClass("ui-state-disabled"))return FALSE;var A=a(C.relatedTarget||C.target).parents(n)[0]==q.tooltip[0];clearTimeout(f.timers.show);clearTimeout(f.timers.hide);if(c.hide.fixed&&(c.position.target==="mouse"&&A||/mouse(out|leave|move)/.test(C.type)&&A)){C.stopPropagation();C.preventDefault();return FALSE}q.tooltip.stop(TRUE);
if(c.hide.delay>0)f.timers.hide=setTimeout(function(){f.hide(C)},c.hide.delay);else f.hide(C)}function s(C){if(q.tooltip.hasClass("ui-state-disabled"))return FALSE;clearTimeout(f.timers.inactive);f.timers.inactive=setTimeout(function(){f.hide(C)},c.hide.inactive)}function w(C){f.elements.tooltip.is(":visible")&&f.reposition(C)}var u=".qtip-"+h,q={show:c.show.target,hide:c.hide.target,tooltip:f.elements.tooltip},r={show:String(c.show.event).split(" "),hide:String(c.hide.event).split(" ")},F=a.browser.msie&&
/^6\.[0-9]/.test(a.browser.version);d.bind("remove.qtip",function(){f.destroy()});if(i&&c.hide.fixed){q.hide=q.hide.add(q.tooltip);q.tooltip.bind("mouseover"+u,function(){q.tooltip.hasClass("ui-state-disabled")||clearTimeout(f.timers.hide)})}if(e){if("number"===typeof c.hide.inactive){q.show.bind("qtip-"+h+"-inactive",s);a.each(a.fn.qtip.inactiveEvents,function(C,A){q.hide.add(f.elements.tooltip).bind(A+u+"-inactive",s)})}a.each(r.hide,function(C,A){var H=a.inArray(A,r.show);if(H>-1&&a(q.hide).add(q.show).length===
a(q.hide).length||A==="unfocus"){q.show.bind(A+u,function(D){q.tooltip.is(":visible")?o(D):k(D)});delete r.show[H]}else q.hide.bind(A+u,o)})}if(b){a.each(r.show,function(C,A){q.show.bind(A+u,k)});q.tooltip.bind("mouseover"+u,function(){f.focus()})}if(j){if(c.position.adjust.resize||c.position.adjust.screen)a(E).bind("resize"+u,w);if(c.position.adjust.screen||F&&q.tooltip.css("position")==="fixed")a(document).bind("scroll"+u,w);/unfocus/i.test(c.hide.event)&&a(document).bind("mousedown"+u,function(C){var A=
f.elements.tooltip;a(C.target).parents(n).length===0&&a(C.target).add(d).length>1&&A.is(":visible")&&!A.hasClass("ui-state-disabled")&&f.hide()});c.position.target==="mouse"&&a(document).bind("mousemove"+u,function(C){if(c.position.adjust.mouse&&!q.tooltip.hasClass("ui-state-disabled")&&q.tooltip.is(":visible"))f.reposition(C||a.fn.qtip.mouse)})}}function B(b,e,i,j){j=parseInt(j,10)!==0;var k=".qtip-"+h,o={show:b?c.show.target:a("<div/>"),hide:e?c.hide.target:a("<div/>"),tooltip:i?f.elements.tooltip:
a("<div/>")};e={show:String(c.show.event).split(" "),hide:String(c.hide.event).split(" ")};if(f.rendered){a.each(e.show,function(s,w){o.show.unbind(w+k)});o.show.unbind("mousemove"+k).unbind("mouseout"+k).unbind("qtip-"+h+"-inactive");a.each(e.hide,function(s,w){o.hide.add(o.tooltip).unbind(w+k)});a.each(a.fn.qtip.inactiveEvents,function(s,w){o.hide.add(i?f.elements.content:NULL).unbind(w+k+"-inactive")});o.hide.unbind("mouseout"+k);o.tooltip.unbind("mouseover"+k);if(j){a(E).unbind("resize"+k);a(document).unbind("mousedown"+
k+" mousemove"+k)}}else b&&o.show.unbind(e.show+k+"-create")}var f=this,x="ui-tooltip",n=".qtip."+x;f.id=h;f.rendered=FALSE;f.elements={target:d};f.cache={event:{},target:NULL,disabled:FALSE};f.timers={img:[]};f.options=c;f.plugins={};a.extend(f,{render:function(b){var e=f.elements,i=a.Event("tooltiprender");if(f.rendered)return FALSE;f.rendered=b?-2:-1;e.tooltip=a("<div/>").attr({id:x+"-"+h,role:"tooltip","class":x+" qtip ui-tooltip-accessible ui-helper-reset "+c.style.classes}).css("z-index",a.fn.qtip.zindex+
a(n).length).toggleClass("ui-widget",c.style.widget).toggleClass("ui-state-disabled",f.cache.disabled).data("qtip",f).appendTo(c.position.container);e.wrapper=a("<div />",{"class":x+"-wrapper"}).appendTo(e.tooltip);e.content=a("<div />",{"class":x+"-content "+(c.style.widget?"ui-widget-content":""),id:x+"-"+h+"-content"}).appendTo(e.wrapper);t(c.content.text);c.content.title.text&&z();a.each(a.fn.qtip.plugins,function(){this.initialize==="render"&&this(f)});f.rendered=TRUE;y(1,1,1,1);a.each(c.events,
function(j,k){e.tooltip.bind("tooltip"+j,k)});e.tooltip.queue("fx",function(j){if(c.show.ready||b){e.tooltip.hide();f.show(f.cache.event)}e.tooltip.removeClass("ui-tooltip-accessible");i.originalEvent=a.extend({},f.cache.event);e.tooltip.trigger(i,[f.hash()]);j()});return f},get:function(b){switch(b.toLowerCase()){case "offset":b=l("position");break;case "dimensions":b=l("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,
e){b=b.toLowerCase();var i=g(b),j=f.elements,k=j.tooltip,o,s,w,u={builtin:{id:function(){var q=e===TRUE?a.fn.qtip.nextid:e,r=x+"-"+q;if(q!==FALSE&&q.length>0&&!a("#ui-tooltip-"+q).length){k[0].id=r;j.content[0].id=r+"-content";j.title[0].id=r+"-title"}},"^content.text":function(){t(e)},"^content.title.text":function(){if(f.rendered)if(!f.elements.title&&e){z();f.reposition()}else e?f.elements.title.html(e):v()},"^content.title.button":function(){var q=f.elements.button,r=f.elements.title;if(f.rendered)if(e){r||
z();m()}else q.remove()},"^position.(my|at)$":function(){var q=/my$/i.test(b)?"my":"at";if("string"===typeof e)c.position[q]=new a.fn.qtip.plugins.Corner(e)},"^position.(my|at|adjust|target)":function(){f.rendered&&f.reposition()},"^position.container$":function(){if(f.rendered===TRUE){k.appendTo(e);f.reposition()}},"^(show|hide).(event|target|fixed|delay|inactive)":function(q,r,F,C){var A=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(A[0])q[r]=C;B.apply(f,
A[1]);if(A[0])q[r]=F;y.apply(f,A[1])},"^show.ready$":function(){f.rendered===FALSE&&f.show()},"^style.classes$":function(){f.elements.tooltip.css("class",x+" qtip ui-helper-reset "+e)},"^style.widget$":function(){k.toggleClass("ui-widget",!!e);j.titlebar.toggleClass("ui-widget-header",!!e);j.content.toggleClass("ui-widget-content",!!e)},"^events.(render|show|move|hide|focus|blur)":function(q,r,F,C){a.isFunction(e)?j.tooltip.bind("tooltip"+r,F):j.tooltip.unbind("tooltip"+r,C)}}};a.each(f.plugins,function(q){if("object"===
typeof this.checks)u[q]=this.checks});o=i[0][i[1]];i[0][i[1]]=e.nodeType?a(e):e;N(c,d);for(s in u)for(w in u[s])RegExp(w,"i").test(b)&&u[s][w].call(f,i[0],i[1],e,o);return f},toggle:function(b,e){function i(){var u=a(this),q=b?"attr":"removeAttr",r=/^1|0$/.test(u.css("opacity"));f.elements.title&&d[q]("aria-labelledby",x+"-"+h+"-title");d[q]("aria-describedby",x+"-"+h+"-content");if(b){if(a.browser.msie&&this.style&&r){w=this.style;w.removeAttribute("filter");w.removeAttribute("opacity")}}else r&&
u.hide()}if(f.rendered===FALSE)return FALSE;var j=b?"show":"hide",k=f.elements.tooltip,o=c[j],s=k.is(":visible"),w;if((typeof b).search("boolean|number"))b=!k.is(":visible");if(!s&&!b||k.is(":animated"))return f;if(e){if(f.cache.event&&/over|enter/.test(e.type)&&/out|leave/.test(f.cache.event.type)&&a(e.target).add(c.show.target).length<2&&a(e.relatedTarget).parents(n).length>0)return f;f.cache.event=a.extend({},e)}s=a.Event("tooltip"+j);s.originalEvent=a.extend({},e);k.trigger(s,[f.hash(),90]);if(s.isDefaultPrevented())return f;
if(b){f.focus();f.reposition(e);o.solo&&a(n).qtip("hide")}else clearTimeout(f.timers.show);k.attr("aria-hidden",Boolean(!b));k.stop(TRUE,FALSE);if(a.isFunction(o.effect)){o.effect.call(k,f.hash());k.queue(function(){i.call(this);a(this).dequeue()})}else if(o.effect===FALSE){k[j]();i.call(k)}else k.fadeTo(90,b?1:0,i);b&&o.target.trigger("qtip-"+h+"-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 e=
f.elements.tooltip,i=a(n),j=parseInt(e.css("z-index"),10),k=a.fn.qtip.zindex+i.length,o=x+"-focus",s=a.extend({},b);if(!e.hasClass(o)&&j!==k){i.css("z-index",function(w,u){return u-1});a(n+"."+o).each(function(){var w=a(this),u=w.qtip(),q;if(!u||u.rendered===FALSE)return TRUE;w.removeClass(o);q=a.Event("tooltipblur");q.originalEvent=s;w.trigger(q,[u,k])});b=a.Event("tooltipfocus");b.originalEvent=s;e.trigger(b,[f.hash(),k]);b.isDefaultPrevented()||e.css({zIndex:k}).addClass(o)}return f},reposition:function(b){if(f.rendered===
FALSE)return FALSE;var e=c.position.target,i=f.elements.tooltip,j=c.position,k=j.my,o=j.at,s=f.elements.tooltip.width(),w=f.elements.tooltip.height();a(j.container);var u=0,q=0,r={left:0,top:0},F=a.Event("tooltipmove"),C=i.css("position")==="fixed",A=a(E),H={left:function(D){var I=A.scrollLeft(),J=A.width(),G=o.x==="left"?u:o.x==="right"?-u:u/2,K=k.x!==o.x&&o.x!=="center"?u:0,L=G+(k.x==="left"?-s:k.x==="right"?s:s/2)+-2*j.adjust.x,Q=I-D;if(D+s-J-I>0)r.left+=(k.x==="center"?-1:1)*(L-G-K);else if(Q>
0)r.left+=L-G+K;return r.left-D},top:function(D){var I=A.scrollTop(),J=A.height(),G=o.y==="top"?q:o.y==="bottom"?-q:0,K=k.y!==o.y&&o.y!=="center"?q:0,L=G+(k.y==="top"?-w:k.y==="bottom"?w:-w/2)+-2*j.adjust.y;J=D+w-J-I;if(I-D>0)r.top+=(k.y==="center"?-1:1)*(L-G-K);else if(J>0)r.top+=L-G-K;return r.top-D}};if(e==="mouse"){o={x:"left",y:"top"};b=a.extend({},a.fn.qtip.mouse);r={top:b.pageY,left:b.pageX}}else{if(e==="event")e=b&&b.target&&b.type!=="scroll"&&b.type!=="resize"?f.cache.target=a(b.target):
f.cache.target;e=a(e).eq(0);if(e.length===0)return f;else if(e[0]===document||e[0]===E){u=e.width();q=e.height();if(e[0]===E)r={top:C?0:A.scrollTop(),left:C?0:A.scrollLeft()}}else if(e.is("area")&&a.fn.qtip.plugins.imagemap){r=a.fn.qtip.plugins.imagemap(e,o);u=r.width;q=r.height;r=r.offset}else{u=e.outerWidth();q=e.outerHeight();r=p(e)}r.left+=o.x==="right"?u:o.x==="center"?u/2:0;r.top+=o.y==="bottom"?q:o.y==="center"?q/2:0}r.left+=j.adjust.x+(k.x==="right"?-s:k.x==="center"?-s/2:0);r.top+=j.adjust.y+
(k.y==="bottom"?-w:k.y==="center"?-w/2:0);r.adjusted=j.adjust.screen&&e[0]!==E&&e[0]!==document.body?{left:H.left(r.left),top:H.top(r.top)}:{left:0,top:0};i.attr("class",function(){return a(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(x+"-pos-"+k.abbreviation());F.originalEvent=a.extend({},b);i.trigger(F,[f.hash(),r]);if(F.isDefaultPrevented())return f;delete r.adjusted;if(j.container[0]==document.body){if(r.top+A.scrollTop()<1)r.top=0;if(r.left+A.scrollLeft()<1)r.left=0}if(i.is(":visible")&&
a.isFunction(j.effect)){j.effect.call(i,f.hash(),r);i.queue(function(){var D=a(this);D.css({opacity:"",height:""});a.browser.msie&&this.style&&this.style.removeAttribute("filter");D.dequeue()})}else isNaN(r.left,r.top)||i.css(r);return f},disable:function(b){var e=f.elements.tooltip;if(f.rendered)e.toggleClass("ui-state-disabled",b);else f.cache.disabled=!!b;return f},destroy:function(){var b=f.elements,e=b.target.data("oldtitle");f.rendered&&a.each(f.plugins,function(){this.initialize==="render"&&
this.destroy()});B(1,1,1,1);d.removeData("qtip");f.rendered&&b.tooltip.remove();e&&d.attr("title",e);d.removeAttr("aria-describedby");return d},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 R(d,c){var h,g=a(this);h=a(document.body);var p=g.metadata?g.metadata(c.metadata):{};p=a.extend(TRUE,{},c,N(a.extend(TRUE,{},(p&&c.metadata.type==="html5"?p[c.metadata.name]:{})||p)));var l=p.position,v=this===
document?h:g;g.removeData("metadata");if("boolean"===typeof p.content.text)if(p.content.attr!==FALSE&&g.attr(p.content.attr))p.content.text=g.attr(p.content.attr);else return FALSE;if(l.container===FALSE)l.container=h;if(l.target===FALSE)l.target=v;if(p.show.target===FALSE)p.show.target=v;if(p.hide.target===FALSE)p.hide.target=v;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(p.overwrite)g.qtip("destroy");else if(p.overwrite===FALSE)return FALSE;
h=new P(g,p,d);g.data("qtip",h);return h}function S(d){var c=this;c.checks={"^content.ajax":function(){this.plugins.ajax.load(this.options.content.ajax)}};a.extend(c,{init:function(){var h=d.options.content.ajax;d.elements.tooltip.bind("tooltiprender.ajax",function(){c.load(h);d.elements.tooltip.bind("tooltipshow.ajax",function(){h.once===FALSE&&d.rendered===TRUE&&c.load(h)})})},load:function(h){a.ajax(a.extend(TRUE,{},h,{success:function(g,p){if(a.isFunction(h.success))if(h.success.call(d.hash(),
g,p)===FALSE)return;d.set("content.text",g)},error:function(g,p,l){var v=p||l;if(a.isFunction(h.error)){g=h.error.call(d.hash(),g,p,l);if(g===FALSE)return}d.set("content.text",v)}}));return c},destroy:function(){d.elements.tooltip.unbind("tooltipshow.ajax")}});c.init()}function O(d,c,h){var g=Math.floor(c/2),p=Math.floor(h/2);c={bottomright:[[0,0],[c,h],[c,0]],bottomleft:[[0,0],[c,0],[0,h]],topright:[[0,h],[c,0],[c,h]],topleft:[[0,0],[0,h],[c,h]],topcenter:[[0,h],[g,0],[c,h]],bottomcenter:[[0,0],
[c,0],[g,h]],rightcenter:[[0,0],[c,p],[0,h]],leftcenter:[[c,0],[c,h],[0,p]]};c.lefttop=c.bottomright;c.righttop=c.bottomleft;c.leftbottom=c.topright;c.rightbottom=c.topleft;return c[d]}function T(d){function c(n){var b=l.tip,e=["left","right"],i=p.offset,j,k;if(p.corner===FALSE||!b)return FALSE;n=n||g.corner;j=n.precedance;b.css({top:"",bottom:"",left:"",right:"",margin:""});e[j==="y"?"push":"unshift"]("top","bottom");k=j==="y"?"x":"y";i=Math.max(n[k]==="center"?i:0,i)-x[k];switch(n[j==="y"?"x":"y"]){case "center":b.css(e[0],
"50%").css("margin-"+e[0],-(t[j==="y"?"width":"height"]/2)+i);break;case e[0]:b.css(e[0],i);break;case e[1]:b.css(e[1],i);break}i=t[j==="x"?"width":"height"];if(B){v.toggleClass("ui-tooltip-accessible",!v.is(":visible"));i-=parseInt(m.css("border-"+n[j]+"-width"),10)||0;v.removeClass("ui-tooltip-accessible")}b.css(n[j],-i)}function h(n,b,e){if(l.tip){n=a.extend({},g.corner);b=g.mimic.adjust?a.extend({},g.mimic):NULL;var i=n.precedance==="y"?["y","top","left","height","x"]:["x","left","top","width",
"y"],j=e.adjusted,k=[parseInt(m.css("border-"+n[i[0]]+"-width"),10)||0,0],o=[n,b],s=a(E);a.each(o,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"});k[1]=Math.max(n[i[4]]==="center"?p.offset:0,p.offset);e[i[1]]+=(n[i[0]]===i[1]?1:-1)*(t[i[3]]-k[0]);e[i[2]]-=(n[i[4]]===i[2]||n[i[4]]==="center"?1:-1)*k[1];x.x=Math.max(-e.left-s.scrollLeft(),0);x.y=Math.max(-e.top-
s.scrollTop(),0);if(n.string()!==z.corner.string()&&(z.top!==j.top||z.left!==j.left))g.update(n,b);else Math.max(x.x,x.y,0)&&c();z.left=j.left;z.top=j.top;z.corner=n}}var g=this,p=d.options.style.tip,l=d.elements,v=l.tooltip,m=l.wrapper,z={top:0,left:0,corner:{string:function(){}}},t={width:p.width,height:p.height},y={},B=p.border||0,f=p.method||FALSE,x={x:0,y:0};g.corner=NULL;g.mimic=NULL;g.checks={"^position.my|style.tip.(corner|mimic|method|border)":function(){B=p.border;if(g.init())this.get("position.target")!==
"mouse"&&this.reposition();else g.destroy()},"^style.tip.(height|width)":function(){t={width:p.width,height:p.height};g.create();g.update();d.reposition()}};a.extend(g,{init:function(){var n=a.browser.msie,b=g.mimic&&/center/i.test(g.mimic.string()),e=g.detectCorner();if(e){if(f===TRUE)f=a("<canvas />")[0].getContext?"canvas":n&&(b||t.height!==t.width)?"vml":"polygon";else if(f==="canvas")f=n?"vml":!a("<canvas />")[0].getContext?"polygon":"canvas";else if(f==="polygon")f=n&&b?"vml":f;g.create();g.detectColours();
g.update();v.bind("tooltipmove.tip",h)}return e},detectCorner:function(){var n=p.corner,b=p.mimic||n,e=d.options.position.at,i=d.options.position.my;if(i.string)i=i.string();if(n===FALSE||i===FALSE&&e===FALSE)return FALSE;else{if(n===TRUE)g.corner=new a.fn.qtip.plugins.Corner(i);else if(!n.string)g.corner=new a.fn.qtip.plugins.Corner(n);if(b===TRUE)g.mimic=new a.fn.qtip.plugins.Corner(i);else if(!b.string){g.mimic=new a.fn.qtip.plugins.Corner(b);g.mimic.precedance=g.corner.precedance}}return g.corner.string()!==
"centercenter"},detectColours:function(){var n=l.tip,b=g.mimic[g.mimic.precedance],e="border-"+b+"-color";y.fill=n.css("background-color","").css("border","").css("background-color")||"transparent";y.border=n.get(0).style?n.get(0).style["border"+b.charAt(0)+b.substr(1)+"Color"]:n.css(e)||"transparent";if(/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(y.fill))y.fill=m.css(B?"background-color":e);if(!y.border||/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(y.border))y.border=m.css(e)||y.fill;a("*",n).add(n).css("background-color",
"transparent").css("border",0)},create:function(){var n=t.width,b=t.height;l.tip&&l.tip.remove();l.tip=a('<div class="ui-tooltip-tip" />').toggleClass("ui-widget-content",d.options.style.widget).css(t).prependTo(v);switch(f){case "canvas":l.tip.append('<canvas height="'+b+'" width="'+n+'" />');break;case "vml":l.tip.html('<vml:shape coordorigin="0 0" coordsize="'+n+" "+b+'" stroked="'+!!B+'" style="behavior:url(#default#VML); display:inline-block; antialias:TRUE; position: absolute; top:0; left:0; width:'+
n+"px; height:"+b+"px; vertical-align:"+g.corner.y+';"><vml:stroke weight="'+(B-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(B?'<div class="ui-tooltip-tip-border" />':"");break}return g},update:function(n,b){var e=l.tip,i=t.width,j=t.height,k=B>0?0:1,o=Math.ceil(B/2+0.5),s;b||(b=n?n:g.mimic);if(!n)n=g.corner;if(b.x==="false")b.x=n.x;if(b.y==="false")b.y=
n.y;e=e.children();switch(f){case "canvas":e=e.get(0).getContext("2d");e.restore();e.clearRect(0,0,3E3,3E3);for(s=O(b.string(),i,j);k<2;k++){if(k){e.save();e.translate(Math.floor((b.x==="left"?1:b.x==="right"?-1:0)*(B+1)*(b.precedance==="y"?0.5:1)),Math.floor((b.y==="top"?1:b.y==="bottom"?-1:0)*(B+1)*(b.precedance==="x"?0.5:1)))}e.beginPath();e.moveTo(s[0][0],s[0][1]);e.lineTo(s[1][0],s[1][1]);e.lineTo(s[2][0],s[2][1]);e.closePath();e.fillStyle=y[k?"fill":"border"];e.fill()}break;case "vml":s=O(b.string(),
i,j);k="m"+s[0][0]+","+s[0][1]+" l"+s[1][0]+","+s[1][1]+" "+s[2][0]+","+s[2][1]+" xe";e.attr({path:k,fillcolor:y.fill});if(B){e.children().attr("color",y.border);if(b.precedance==="y"){e.css("top",(b.y==="top"?1:-1)*(B-2));e.css("left",b.x==="left"?1:-2)}else{e.css("left",(b.x==="left"?1:-1)*(B-2));e.css("top",b.y==="top"?1:-2)}}break;case "polygon":if(b.precedance==="y"){k=i>j?1.5:i<j?5:2.2;o=[b.x==="left"?o:b.x==="right"?-o:0,Math.floor(k*o*(b.y==="bottom"?-1:1)*(b.x==="center"?0.8:1))]}else{k=
i<j?1.5:i>j?5:2.2;o=[Math.floor(k*o*(b.x==="right"?-1:1)*(b.y==="center"?0.9:1)),b.y==="top"?o:b.y==="bottom"?-o:0]}e.removeAttr("style").each(function(w){var u={x:b.precedance==="x"?b.x==="left"?"right":"left":b.x,y:b.precedance==="y"?b.y==="top"?"bottom":"top":b.y},q=b.x==="center"?["left","right",u.y,j,i]:["top","bottom",u.x,i,j],r=y[!w&&B?"border":"fill"];w&&a(this).css({position:"absolute","z-index":1,left:o[0],top:o[1]});b.x==="center"||b.y==="center"?a(this).css("border-"+q[2],q[3]+"px solid "+
r).css("border-"+q[0],Math.floor(q[4]/2)+"px dashed transparent").css("border-"+q[1],Math.floor(q[4]/2)+"px dashed transparent"):a(this).css("border-width",Math.floor(j/2)+"px "+Math.floor(i/2)+"px").css("border-"+u.x,Math.floor(i/2)+"px solid "+r).css("border-"+u.y,Math.floor(j/2)+"px solid "+r)});break}c(n);return g},destroy:function(){l.tip&&l.tip.remove();v.unbind("tooltipmove.tip")}})}function U(d,c){var h=this,g=d.elements,p=g.tooltip;g.overlay=a("#qtip-overlay");a.extend(h,{init:function(){p.bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",
function(l,v,m){l=l.type.replace("tooltip","");a.isFunction(c[l])?c[l].call(g.overlay,m,v):h[l](m)});g.overlay.length||h.create();c.blur===TRUE&&g.overlay.bind("click.qtipmodal"+d.id,function(){d.hide.call(d)})},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 v=g.overlay,m=d.options.show.modal.effect,z=l?"show":"hide";v.stop(TRUE,FALSE);if(a.isFunction(m))m.call(v,l);else m===FALSE?v[z]():v.fadeTo(90,l?0.7:0,function(){l||a(this).hide()})},show:function(){h.toggle(TRUE)},hide:function(){h.toggle(FALSE)},destroy:function(){var l=TRUE;a("*").each(function(){var v=a(this).data("qtip");if(v&&v.id!==d.id&&v.options.show.modal)return l=FALSE});if(l){g.overlay.remove();a(E).unbind("scroll.qtipmodal resize.qtipmodal")}else g.overlay.unbind("click.qtipmodal"+
d.id);p.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});h.init()}function V(d){var c=this,h=d.elements,g=h.tooltip,p=".bgiframe-"+d.id,l="tooltipmove"+p+" tooltipshow"+p;a.extend(c,{init:function(){h.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>');h.bgiframe.appendTo(g);g.bind(l,c.adjust)},adjust:function(){var v=d.get("dimensions"),m=d.plugins.tip,
z=d.elements.tip,t;t=parseInt(g.css("border-left-width"),10)||0;t={left:-t,top:-t};if(m&&z){m=m.corner.precedance==="x"?["width","left"]:["height","top"];t[m[1]]-=z[m[0]]()}h.bgiframe.css(t).css(v)},destroy:function(){c.iframe.remove();g.unbind(l)}});c.init()}a.fn.qtip=function(d,c,h){var g=String(d).toLowerCase(),p=NULL,l=g==="disable"?[TRUE]:a.makeArray(arguments).slice(1,10),v=l[l.length-1],m=a.extend(TRUE,{},d),z;if(!arguments.length&&this.data("qtip")||g==="api")return(m=this.data("qtip"))?m.hash():
M;else if("string"===typeof d){this.each(function(){var t=a(this).data("qtip");if(!t)return TRUE;if(/option|set/.test(g)&&c)if(h!==M)t.set(c,h);else p=t.get(c);else{if(!t.rendered&&(g==="show"||g==="toggle")){if(v&&v.timeStamp)t.cache.event=v;t.render(1)}else if(g==="enable"){g="disable";l=[FALSE]}t[g]&&t[g].apply(t[g],l)}});return p!==NULL?p:this}else if("object"===typeof d||!arguments.length){z=N(m,this);m=a.extend(TRUE,{},a.fn.qtip.defaults,m);return a.fn.qtip.bind.call(z,m,v)}};a.fn.qtip.bind=
function(d,c){return this.each(function(h){function g(f){function x(){m.render(typeof f==="object"||z.show.ready);t.show.unbind(y.show);t.hide.unbind(y.hide)}if(m.cache.disabled)return FALSE;m.cache.event=a.extend({},f);if(z.show.delay>0){clearTimeout(m.timers.show);m.timers.show=setTimeout(x,z.show.delay);y.show!==y.hide&&t.hide.bind(y.hide,function(){clearTimeout(m.timers.show)})}else x()}var p=a(this),l=d.id,v=d.content.text,m,z,t,y,B;d.id=l=l===FALSE||l.length<1||a("#ui-tooltip-"+l).length?a.fn.qtip.nextid++:
l;B=".qtip-"+l+"-create";m=R.call(this,l,d);if(m===FALSE)return TRUE;z=m.options;if(a.isArray(v))z.content.text=v[h];p.attr("title")&&p.data("oldtitle",p.attr("title")).removeAttr("title");a.each(a.fn.qtip.plugins,function(){this.initialize==="initialize"&&this(m)});t={show:z.show.target,hide:z.hide.target};y={show:String(z.show.event).replace(" ",B+" ")+B,hide:String(z.hide.event).replace(" ",B+" ")+B};t.show.bind(y.show,g);if(d.show.ready||d.prerender)g(c)})};a.each({attr:function(d){var c=a(this),
h=c.data("qtip");return arguments.length===1&&d==="title"&&h&&h.rendered===TRUE?c.data("oldtitle"):NULL},remove:a.ui?NULL:function(d,c){a(this).each(function(){if(!c)if(!d||a.filter(d,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}},function(d,c){if(!c)return TRUE;a.fn["Old"+d]=a.fn[d];a.fn[d]=function(){return c.apply(this,arguments)||a.fn["Old"+d].apply(this,arguments)}});a(document.body).attr("role",function(d,c){return!c?"application":c});a(document).bind("mousemove.qtip",
function(d){a.fn.qtip.mouse={pageX:d.pageX,pageY:d.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.plugins={Corner:function(d){this.x=(String(d).replace(/middle/i,"center").match(/left|right|center/i)||["false"])[0].toLowerCase();this.y=(String(d).replace(/middle/i,"center").match(/top|bottom|center/i)||["false"])[0].toLowerCase();this.precedance=d.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 c=this.x.substr(0,1),h=this.y.substr(0,1);return c===h?c:c==="c"||c!=="c"&&h!=="c"?h+c:c+h}}};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,container: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}};a.fn.qtip.plugins.ajax=function(d){var c=d.plugins.ajax,h=d.options.content.ajax;if(h&&h.url)if(c)return c;else{d.plugins.ajax=new S(d);return d.plugins.ajax}};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=
function(d){try{var c=d.content.ajax;if(typeof c!=="object")c=d.content.ajax={url:c};if("boolean"!==typeof c.once&&c.once)c.once=!!c.once}catch(h){}};a.extend(TRUE,a.fn.qtip.defaults,{content:{ajax:{once:TRUE}}});a.fn.qtip.plugins.tip=function(d){var c=d.plugins.tip,h=d.options.style.tip;if(h&&h.corner)if(c)return c;else{d.plugins.tip=new T(d);d.plugins.tip.init();return d.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(d){try{var c=d.style.tip;if(typeof c!==
"object")d.style.tip={corner:c};if(!/string|boolean/i.test(typeof c.corner))c.corner=true;if(typeof c.method!=="string")c.method=TRUE;if(!/canvas|polygon/i.test(c.method))c.method=TRUE;typeof c.width!=="number"&&delete c.width;typeof c.height!=="number"&&delete c.height;typeof c.border!=="number"&&delete c.border;typeof c.offset!=="number"&&delete c.offset}catch(h){}};a.extend(TRUE,a.fn.qtip.defaults,{style:{tip:{corner:TRUE,method:TRUE,width:9,height:9,border:0,offset:0}}});a.fn.qtip.plugins.imagemap=
function(d,c){function h(y,B){for(var f=0,x=1,n=1,b=0,e=0,i=y.width,j=y.height;i>0&&j>0&&x>0&&n>0;){i=Math.floor(i/2);j=Math.floor(j/2);if(c.x==="left")x=i;else if(c.x==="right")x=y.width-i;else x+=Math.floor(i/2);if(c.y==="top")n=j;else if(c.y==="bottom")n=y.height-j;else n+=Math.floor(j/2);for(f=B.length;f--;){if(B.length<2)break;b=B[f][0]-y.offset.left;e=B[f][1]-y.offset.top;if(c.x==="left"&&b>=x||c.x==="right"&&b<=x||c.x==="center"&&(b<x||b>y.width-x)||c.y==="top"&&e>=n||c.y==="bottom"&&e<=n||
c.y==="center"&&(e<n||e>y.height-n))B.splice(f,1)}}return{left:B[0][0],top:B[0][1]}}var g=d.attr("shape").toLowerCase(),p=d.attr("coords").split(","),l=[],v=a('img[usemap="#'+d.parent("map").attr("name")+'"]').offset(),m={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},z=0,t=0;if(g==="poly")for(z=p.length;z--;){t=[parseInt(p[--z],10),parseInt(p[z+1],10)];if(t[0]>m.offset.right)m.offset.right=t[0];if(t[0]<m.offset.left)m.offset.left=t[0];if(t[1]>m.offset.bottom)m.offset.bottom=t[1];
if(t[1]<m.offset.top)m.offset.top=t[1];l.push(t)}else l=a.map(p,function(y){return parseInt(y,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=c.string()==="centercenter"?{left:m.offset.left+m.width/2,top:m.offset.top+m.height/
2}:h(m,l.slice());m.width=m.height=0;break}m.offset.left+=v.left;m.offset.top+=v.top;return m};a.fn.qtip.plugins.modal=function(d){var c=d.plugins.modal,h=d.options.show.modal;if(c)return c;else if(h&&h.on===TRUE){d.plugins.modal=new U(d,h);return d.plugins.modal}};a.fn.qtip.plugins.modal.initialize="render";a.fn.qtip.plugins.modal.sanitize=function(d){if(d.show)if(typeof d.show.modal!=="object")d.show.modal={on:!!d.show.modal};else if(typeof d.show.modal.on==="undefined")d.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(d){if(!(a.browser.msie&&/^6\.[0-9]/.test(a.browser.version)&&a("select, object").length))return FALSE;var c=d.plugins.bgiframe;if(c)return c;else{d.plugins.bgiframe=new V(d);return d.plugins.bgiframe}};a.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);