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