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