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