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