This repository has been archived by the owner on Jun 14, 2020. It is now read-only.
/
jquery.qtip.min.js
79 lines (77 loc) · 31 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
/*
* qTip2 - Pretty powerful 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: Wed Jan 12 21:12:16 2011 +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 */
(function(b,L,Q){function V(e){var a;if(!e)return m;if("object"!==typeof e.metadata)e.metadata={type:e.metadata};if("content"in e){if("object"!==typeof e.content||e.content.jquery)e.content={text:e.content};a=e.content.text||m;if(!b.isFunction(a)&&(!a&&!a.attr||a.length<1||"object"===typeof a&&!a.jquery))a=e.content.text=m;if("title"in e.content&&"object"!==typeof e.content.title)e.content.title={text:e.content.title}}if("position"in e)if("object"!==typeof e.position)e.position={my:e.position,at:e.position};
if("show"in e)if("object"!==typeof e.show)e.show=e.show.jquery?{target:e.show}:{event:e.show};if("hide"in e)if("object"!==typeof e.hide)e.hide=e.hide.jquery?{target:e.hide}:{event:e.hide};if("style"in e)if("object"!==typeof e.style)e.style={classes:e.style};b.each(b.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(e)});return e}function Y(e,a,n){function h(d){var g,i=d.split("."),q=a[i[0]];for(d=1;d<i.length;d+=1){g=q[i[d]];if(typeof g==="object"&&!g.jquery&&!g.precedance)q=q[i[d]];else break}return i[d]!==
Q?[q,i[d]]:[a,i[0]]}function o(d,g){var i={left:0,top:0},q=!b.fn.qtip.plugins.iOS,k,v;if(g&&b(g).css("position")!=="static"){i=o(g);i.left*=-1;i.top*=-1}if(d.offsetParent){do{k=d.offsetParent;v=k===g;i.left+=d.offsetLeft-(q&&k&&!v?k.scrollLeft:0);i.top+=d.offsetTop-(q&&k&&!v?k.scrollTop:0)}while(d=k)}return i}function j(){return f.css("left")!==Z}function x(){var d=c.elements,g=a.style.widget;f.toggleClass(W,g);d.content.toggleClass(W+"-content",g);d.titlebar&&d.titlebar.toggleClass(W+"-header",g);
d.button&&d.button.toggleClass(I+"-icon",!g)}function r(){var d=c.elements;if(d.title){d.titlebar.remove();d.titlebar=d.title=d.button=D;c.reposition()}}function p(){var d=c.elements,g=a.content.title.button;d.button&&d.button.remove();d.button=g.jquery?g:b("<a />",{"class":"ui-state-default "+(a.style.widget?"":I+"-icon"),title:"Close tooltip","aria-label":"Close tooltip"}).prepend(b("<span />",{"class":"ui-icon ui-icon-close",html:"×"}));d.button.appendTo(d.titlebar).attr("role","button").hover(function(i){b(this).toggleClass("ui-state-hover",
i.type==="mouseenter")}).click(function(i){f.hasClass(N)||c.hide(i);return m}).bind("mousedown keydown mouseup keyup mouseout",function(i){b(this).toggleClass("ui-state-active ui-state-focus",i.type.substr(-4)==="down")});c.redraw()}function z(){var d=c.elements,g=s+"-title";d.titlebar&&r();d.titlebar=b("<div />",{"class":I+"-titlebar "+(a.style.widget?"ui-widget-header":"")}).append(d.title=b("<div />",{id:g,"class":I+"-title",html:a.content.title.text,"aria-atomic":t})).insertBefore(d.content);
if(a.content.title.button)p();else c.rendered===t&&c.redraw()}function C(d){var g=c.elements;if(!c.rendered||!d)return m;if(b.isFunction(d))d=d.call(e);d.jquery&&d.length>0?g.content.empty().append(d.css({display:"block"})):g.content.html(d);f.queue("fx",function(i){function q(v){k=k.not(v);if(k.length===0){c.redraw();c.rendered===t&&c.reposition(c.cache.event);i()}}var k=b("img:not([height]):not([width])",c.elements.content);k.each(function(v,F){var G=["abort","error","load","unload",""].join(".qtip-image ");
b(this).bind(G,function(){clearTimeout(c.timers.img[v]);q(this)});(function A(){if(F.height)return q(F);c.timers.img[v]=setTimeout(A,20)})();return t});k.length===0&&q(k)});return c}function H(d,g,i,q){function k(w){if(f.hasClass(N))return m;E.show.trigger("qtip-"+n+"-inactive");clearTimeout(c.timers.show);clearTimeout(c.timers.hide);var u=function(){c.show(w)};if(a.show.delay>0)c.timers.show=setTimeout(u,a.show.delay);else u()}function v(w){if(f.hasClass(N))return m;var u=b(w.relatedTarget||w.target).parents(S)[0]===
f[0],R=b(w.relatedTarget||w.target)[0]===E.show[0];clearTimeout(c.timers.show);clearTimeout(c.timers.hide);if(a.hide.fixed&&(B.target==="mouse"&&u||/mouse(out|leave|move)/.test(w.type)&&(u||R))){w.stopPropagation();w.preventDefault();return m}f.stop(1,1);if(a.hide.delay>0)c.timers.hide=setTimeout(function(){c.hide(w)},a.hide.delay);else c.hide(w)}function F(w){if(f.hasClass(N))return m;clearTimeout(c.timers.inactive);c.timers.inactive=setTimeout(function(){c.hide(w)},a.hide.inactive)}function G(w){if(!c.cache.processing){c.cache.processing=
1;j()&&c.reposition(w);c.cache.processing=0}}var A=".qtip-"+n,B=a.position,E={show:a.show.target,hide:a.hide.target,container:B.container[0]===y?document:B.container},M={show:String(a.show.event).split(" "),hide:String(a.hide.event).split(" ")},O=b.browser.msie&&parseInt(b.browser.version,10)===6;if(i){if(a.hide.fixed){E.hide=E.hide.add(f);f.bind("mouseover"+A,function(){f.hasClass(N)||clearTimeout(c.timers.hide)})}f.bind("mouseenter"+A+" mouseleave"+A,function(w){c[w.type==="mouseenter"?"focus":
"blur"](w)})}if(g){if("number"===typeof a.hide.inactive){E.show.bind("qtip-"+n+"-inactive",F);b.each(b.fn.qtip.inactiveEvents,function(w,u){E.hide.add(c.elements.tooltip).bind(u+A+"-inactive",F)})}b.each(M.hide,function(w,u){var R=b.inArray(u,M.show);if(R>-1&&b(E.hide).add(E.show).length===b(E.hide).length||u==="unfocus"){E.show.bind(u+A,function(J){j()?v(J):k(J)});delete M.show[R]}else E.hide.bind(u+A,v)})}d&&b.each(M.show,function(w,u){E.show.bind(u+A,k)});if(q){if(B.adjust.resize||B.viewport)b(b.event.special.resize?
B.viewport:L).bind("resize"+A,G);if(B.viewport||O&&f.css("position")==="fixed")b(B.viewport).bind("scroll"+A,G);/unfocus/i.test(a.hide.event)&&b(document).bind("mousedown"+A,function(w){b(w.target).parents(S).length===0&&b(w.target).add(e).length>1&&j()&&!f.hasClass(N)&&c.hide(w)});B.target==="mouse"&&b(document).bind("mousemove"+A,function(w){if(B.adjust.mouse&&!f.hasClass(N)&&j())c.reposition(w||b.fn.qtip.mouse)})}}function l(d,g,i,q){q=parseInt(q,10)!==0;var k=".qtip-"+n;g={show:d?a.show.target:
D,hide:g?a.hide.target:D,tooltip:i?c.elements.tooltip:D,content:i?c.elements.content:D,container:q?a.position.container[0]===y?document:a.position.container:D,window:q?L:D};if(c.rendered)b([]).pushStack(b.grep([g.show,g.hide,g.tooltip,g.container,g.content,g.window],function(){return this!==null})).unbind(k);else d&&g.show.unbind(k+"-create")}var c=this,y=document.body,s=I+"-"+n,f;c.id=n;c.rendered=m;c.elements={target:e};c.timers={img:[]};c.options=a;c.plugins={};c.cache={event:{},target:D,disabled:m,
lastFocus:y};b.extend(c,{render:function(d){if(c.rendered)return m;var g=c.elements,i=b.Event("tooltiprender");e.attr({"aria-owns":s,"aria-controls":s,"aria-haspopup":t,"aria-describedby":s});f=g.tooltip=b("<div/>").attr({id:s,"class":I+" qtip ui-helper-reset "+a.style.classes,role:"alert","aria-live":"polite","aria-atomic":m,"aria-describedby":s+"-content","aria-hidden":t}).toggleClass(N,c.cache.disabled).data("qtip",c).appendTo(a.position.container).append(g.content=b("<div />",{"class":I+"-content",
id:s+"-content","aria-atomic":t}));c.rendered=t;a.content.title.text&&z();C(a.content.text);b.each(b.fn.qtip.plugins,function(){this.initialize==="render"&&this(c)});H(1,1,1,1);b.each(a.events,function(q,k){if(k)f.bind(q==="toggle"?"tooltipshow tooltiphide":"tooltip"+q,k)});f.queue("fx",function(q){i.originalEvent=c.cache.event;f.trigger(i,[c]);if(a.show.ready||d){f.hide();c.show(c.cache.event)}q()});return c},get:function(d){switch(d.toLowerCase()){case "dimensions":d={height:f.outerHeight(),width:f.outerWidth()};
break;case "offset":d=o(f[0],a.position.container[0]);break;default:d=h(d.toLowerCase());d=d[0].precedance?d[0].string():d[0].jquery?d[0]:d[0][d[1]];break}return d},set:function(d,g){d=d.toLowerCase();var i=h(d),q=c.elements,k,v,F,G={builtin:{"^id$":function(){var A=g===t?b.fn.qtip.nextid:g,B=I+"-"+A;if(A!==m&&A.length>0&&!b("#"+B).length){f[0].id=B;q.content[0].id=B+"-content";q.title[0].id=B+"-title"}},"^content.text$":function(){C(g)},"^content.title.text$":function(){if(c.rendered)if(!c.elements.title&&
g){z();c.reposition()}else g?c.elements.title.html(g):r()},"^content.title.button$":function(){var A=c.elements.button,B=c.elements.title;if(c.rendered)if(g){B||z();p()}else A.remove()},"^position.(my|at)$":function(){var A=/my$/i.test(d)?"my":"at";if("string"===typeof g)a.position[A]=new b.fn.qtip.plugins.Corner(g)},"^position.container$":function(){c.rendered===t&&f.appendTo(g)},"^(show|hide).(event|target|fixed|delay|inactive)$":function(A,B,E,M){var O=d.search(/fixed/i)>-1?[0,[0,1,1,1]]:[d.substr(0,
3),d.charAt(0)==="s"?[1,0,0,0]:[0,1,0,0]];if(O[0])A[B]=M;l.apply(c,O[1]);if(O[0])A[B]=E;H.apply(c,O[1])},"^show.ready$":function(){c.rendered===m&&c.show()},"^style.classes$":function(){f.attr("class",I+" qtip ui-helper-reset "+g)},"^style.widget|content.title":x,"^events.(render|show|move|hide|focus|blur)$":function(A,B,E){q.tooltip[(b.isFunction(g)?"":"un")+"bind"]("tooltip"+B,E)},"^position.(my|at|adjust|target|container)|style|content":function(){c.reposition()}}};b.each(c.plugins,function(A){if("object"===
typeof this.checks)G[A]=this.checks});k=i[0][i[1]];i[0][i[1]]=g.nodeType?b(g):g;V(a);for(v in G)for(F in G[v])RegExp(F,"i").test(d)&&G[v][F].call(c,i[0],i[1],g,k);return c},toggle:function(d,g){function i(){if(d)b.browser.msie&&f[0].style.removeAttribute("filter");else f.css({display:"",visibility:"hidden",width:"",opacity:"",left:"",top:""})}if(c.rendered===m)return m;var q=d?"show":"hide",k=a[q],v=j();if((typeof d).search("boolean|number"))d=!v;if(!v&&!d||f.is(":animated"))return c;if(g){if(/over|enter/.test(g.type)&&
/out|leave/.test(c.cache.event.type)&&g.target===a.show.target[0]&&f.has(g.relatedTarget).length)return c;c.cache.event=b.extend({},g)}v=b.Event("tooltip"+q);v.originalEvent=g?c.cache.event:D;f.trigger(v,[c,90]);if(v.isDefaultPrevented())return c;f.attr("aria-hidden",!!!d);if(d){f.hide().css({visibility:""});c.focus(g);c.reposition(g,0);k.solo&&b(S).not(f).qtip("hide")}else{clearTimeout(c.timers.show);c.blur(g)}f.stop(1,1);if(b.isFunction(k.effect)){k.effect.call(f,c);f.queue("fx",function(F){i.call(this,
F);F()})}else if(k.effect===m){f[q]();i.call(f)}else f.fadeTo(90,d?1:0,i);d&&k.target.trigger("qtip-"+n+"-inactive");return b.fn.qtip.lastShown=c},show:function(d){c.toggle(t,d)},hide:function(d){c.toggle(m,d)},focus:function(d){if(c.rendered===m)return m;var g=b(S),i=parseInt(f[0].style.zIndex,10),q=b.fn.qtip.zindex+g.length;d=b.extend({},d);if(!f.hasClass(U)){if(i!==q){g.each(function(){if(this.style.zIndex>i)this.style.zIndex-=1});b(S+"."+U).qtip("blur",d)}c.cache.lastFocus=document.activeElement;
g=b.Event("tooltipfocus");g.originalEvent=d;f.trigger(g,[c,q]);if(!g.isDefaultPrevented())f.addClass(U)[0].style.zIndex=q}return c},blur:function(d){d=b.extend({},d);var g;f.removeClass(U);g=b.Event("tooltipblur");g.originalEvent=d;f.trigger(g,[c])},reposition:function(d,g){if(c.rendered===m)return m;var i=a.position.target,q=a.position,k=q.my,v=q.at,F=q.adjust,G=f.outerWidth(),A=f.outerHeight(),B=0,E=0,M=b.Event("tooltipmove"),O=f.css("position")==="fixed",w=q.viewport.jquery?q.viewport:b(L),u={left:0,
top:0},R={left:function(J){var K=w.scrollLeft,P=v.x==="left"?B:v.x==="right"?-B:-B/2,T=K-J;K=J+G-w.width-K;P=(k.x==="left"?G:k.x==="right"?-G:-G/2)-(k.precedance==="x"||k.x===k.y?P:0);if(T>0&&(k.x!=="left"||K>0))u.left-=P;else if(K>0&&(k.x!=="right"||T>0))u.left-=(k.x==="center"?-1:1)*P+2*F.x;if(u.left<0&&-u.left>K)u.left=J;return u.left-J},top:function(J){var K=w.scrollTop,P=v.y==="top"?E:v.y==="bottom"?-E:-E/2,T=K-J;K=J+A-w.height-K;P=(k.y==="top"?A:k.y==="bottom"?-A:-A/2)-(k.precedance==="y"||
k.x===k.y?P:0);if(T>0&&(k.y!=="top"||K>0))u.top-=P;else if(K>0&&(k.y!=="bottom"||T>0))u.top-=(k.y==="center"?-1:1)*P+2*F.y;if(u.top<0&&-u.top>K)u.top=J;return u.top-J}};g=g===Q||!!g||m;w=!w?m:{elem:w,height:w[(w[0]===L?"h":"outerH")+"eight"](),width:w[(w[0]===L?"w":"outerW")+"idth"](),scrollLeft:w.scrollLeft(),scrollTop:w.scrollTop()};if(i==="mouse"){v={x:"left",y:"top"};d=d&&(d.type==="resize"||d.type==="scroll")?c.cache.event:F.mouse||!d||!d.pageX?b.extend({},b.fn.qtip.mouse):d;u={top:d.pageY,left:d.pageX}}else{if(i===
"event")i=d&&d.target&&d.type!=="scroll"&&d.type!=="resize"?c.cache.target=b(d.target):c.cache.target;i=b(i).eq(0);if(i.length===0)return c;else if(i[0]===document||i[0]===L){B=i.width();E=i.height();if(i[0]===L)u={top:O?0:w.scrollTop,left:O?0:w.scrollLeft}}else if(i.is("area")&&b.fn.qtip.plugins.imagemap){u=b.fn.qtip.plugins.imagemap(i,v);B=u.width;E=u.height;u=u.offset}else{B=i.outerWidth();E=i.outerHeight();u=o(i[0],q.container[0])}u.left+=v.x==="right"?B:v.x==="center"?B/2:0;u.top+=v.y==="bottom"?
E:v.y==="center"?E/2:0}u.left+=F.x+(k.x==="right"?-G:k.x==="center"?-G/2:0);u.top+=F.y+(k.y==="bottom"?-A:k.y==="center"?-A/2:0);u.adjusted=q.viewport.jquery&&i[0]!==L&&i[0]!==y?{left:R.left(u.left),top:R.top(u.top)}:{left:0,top:0};f.attr("class",function(){return b(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(I+"-pos-"+k.abbreviation());M.originalEvent=b.extend({},d);f.trigger(M,[c,u,w.elem]);if(M.isDefaultPrevented())return c;delete u.adjusted;if(!g||!isNaN(u.left,u.top))f.css(u);
else if(j()&&b.isFunction(q.effect)){q.effect.call(f,c,u);f.queue(function(J){b(this).css({opacity:"",height:""});b.browser.msie&&this.style&&this.style.removeAttribute("filter");J()})}return c},redraw:function(){if(!c.rendered||!(b.browser.msie&&b.browser.version<8))return m;var d=I+"-fluid",g;f.css({width:"auto",height:"auto"}).addClass(d);g={height:f.outerHeight(),width:f.outerWidth()};b.each(["width","height"],function(i,q){var k=parseInt(f.css("max-"+q),10)||0,v=parseInt(f.css("min-"+q),10)||
0;g[q]=k+v?Math.min(Math.max(g[q],v),k):g[q]});f.css(g).removeClass(d)},disable:function(d){var g=N;if("boolean"!==typeof d)d=!(f.hasClass(g)||c.cache.disabled);if(c.rendered){f.toggleClass(g,d);f.attr("aria-disabled",d)}else c.cache.disabled=!!d;return c},destroy:function(){var d=e.data("oldtitle");if(c.rendered){f.remove();b.each(c.plugins,function(){this.initialize==="render"&&this.destroy()})}clearTimeout(c.timers.show);clearTimeout(c.timers.hide);l(1,1,1,1);e.removeData("qtip");d&&e.attr("title",
d);e.removeAttr("aria-describedby");return e}})}function $(e,a){var n,h,o=b(this),j=b(document.body),x=this===document?j:o;h=o.metadata?o.metadata(a.metadata):D;var r=b.extend(t,{},b.fn.qtip.defaults,a,V((h&&a.metadata.type==="html5"?h[a.metadata.name]:D)||h));o.removeData("metadata");h=r.position;if("boolean"===typeof r.content.text)if(r.content.attr!==m&&o.attr(r.content.attr))r.content.text=o.attr(r.content.attr);else return m;if(h.container===m)h.container=j;if(h.target===m)h.target=x;if(r.show.target===
m)r.show.target=x;if(r.hide.target===m)r.hide.target=x;if(r.position.viewport===t)r.position.viewport=h.container;h.at=new b.fn.qtip.plugins.Corner(h.at);h.my=new b.fn.qtip.plugins.Corner(h.my);if(o.data("qtip"))if(r.overwrite)o.qtip("destroy");else if(r.overwrite===m)return m;o.attr("title")&&o.data("oldtitle",o.attr("title")).removeAttr("title");n=new Y(o,r,e);o.data("qtip",n);o.bind("remove.qtip",function(){n.destroy()});return n}function aa(e){var a=this,n=e.elements.tooltip,h=e.options.content.ajax;
a.checks={"^content.ajax":function(o,j){if(j==="once")a.once();else h&&h.url&&a.load()}};b.extend(a,{init:function(){if(h&&h.url){a.load();n.one("tooltipshow",a.once)}},once:function(){h.once?a.destroy():n.bind("tooltipshow.qtip-ajax",a.load)},load:function(){b.ajax(b.extend({success:function(o){e.set("content.text",o)},error:function(o,j,x){e.set("content.text",j+": "+x)},context:e},h));return a},destroy:function(){n.unbind(".qtip-ajax")}});a.init()}function X(e,a,n){var h=Math.ceil(a/2),o=Math.ceil(n/
2);a={bottomright:[[0,0],[a,n],[a,0]],bottomleft:[[0,0],[a,0],[0,n]],topright:[[0,n],[a,0],[a,n]],topleft:[[0,0],[0,n],[a,n]],topcenter:[[0,n],[h,0],[a,n]],bottomcenter:[[0,0],[a,0],[h,n]],rightcenter:[[0,0],[a,o],[0,n]],leftcenter:[[a,0],[a,n],[0,o]]};a.lefttop=a.bottomright;a.righttop=a.bottomleft;a.leftbottom=a.topright;a.rightbottom=a.topleft;return a[e.string()]}function ba(e){function a(l,c,y){if(j.tip){l=b.extend({},h.corner);c=y.adjusted;var s;if(h.corner.fixed!==t){if(c.left)l.x=l.x==="center"?
c.left>0?"left":"right":l.x==="left"?"right":"left";if(c.top)l.y=l.y==="center"?c.top>0?"top":"bottom":l.y==="top"?"bottom":"top";if(l.string()!==r.corner&&(r.top!==c.top||r.left!==c.left))s=h.update(l)}s||(s=h.position(l,0));if(s.right!==Q)s.left=s.right;if(s.bottom!==Q)s.top=s.bottom;s.option=Math.max(0,o.offset);y.left-=s.left.charAt?s.option:(s.right?-1:1)*s.left;y.top-=s.top.charAt?s.option:(s.bottom?-1:1)*s.top;r.left=c.left;r.top=c.top;r.corner=l.string()}}function n(l,c,y){c=!c?l[l.precedance]:
c;c="border-"+c+"-width";l=parseInt((j.titlebar&&l.y==="top"?j.titlebar:j.content).css(c),10);return(y?l||parseInt(x.css(c),10):l)||0}var h=this,o=e.options.style.tip,j=e.elements,x=j.tooltip,r={top:0,left:0,corner:""},p={width:o.width,height:o.height},z={},C=o.border||0,H=o.method||m;h.corner=D;h.mimic=D;h.checks={"^position.my|style.tip.(corner|mimic|method|border)$":function(){h.init()||h.destroy();e.reposition()},"^style.tip.(height|width)$":function(){p={width:o.width,height:o.height};h.create();
h.update();e.reposition()},"^content.title.text|style.(classes|widget)$":function(){j.tip&&h.update()}};b.extend(h,{init:function(){var l=h.detectCorner();if(l){if(H!=="polygon")H=b("<canvas />")[0].getContext?"canvas":b.browser.msie?"vml":"polygon";h.create();h.update();x.unbind(".qtip-tip").bind("tooltipmove.qtip-tip",a)}return l},detectCorner:function(){var l=o.corner,c=e.options.position,y=c.at;c=c.my.string?c.my.string():c.my;if(l===m||c===m&&y===m)return m;else if(l===t)h.corner=new b.fn.qtip.plugins.Corner(c);
else if(!l.string){h.corner=new b.fn.qtip.plugins.Corner(l);h.corner.fixed=t}return h.corner.string()!=="centercenter"},detectColours:function(){var l=j.tip.css({backgroundColor:"",border:""}),c=h.corner,y=c[c.precedance],s="border-"+y+"-color";y="border"+y.charAt(0)+y.substr(1)+"Color";var f=/rgba?\(0, 0, 0(, 0)?\)|transparent/i;c=j.titlebar&&(c.y==="top"||c.y==="center"&&l.position().top+p.height/2+o.offset<j.titlebar.outerHeight(1))?j.titlebar:j.content;z.fill=l.css("background-color")||"transparent";
z.border=l[0].style[y];if(!z.fill||f.test(z.fill)){z.fill=c.css("background-color");if(f.test(z.fill))z.fill=x.css("background-color")}if(!z.border||f.test(z.border)){z.border=x.css(s);if(f.test(z.border)||z.border===b(document.body).css("color"))z.border=c.css(s)||z.fill}b("*",l).add(l).css("background-color","transparent").css("border",0)},create:function(){var l=p.width,c=p.height;j.tip&&j.tip.remove();j.tip=b("<div />",{"class":"ui-tooltip-tip"}).css(p).prependTo(x);switch(H){case "canvas":b('<canvas height="'+
c+'" width="'+l+'" />').appendTo(j.tip)[0].getContext("2d").save();break;case "vml":l='<vml:shape coordorigin="0,0" coordsize="'+l+" "+c+'" stroked="false" style="behavior:url(#default#VML); display:inline-block; position:absolute; antialias:false; left: 0; top: 0; width:'+l+"px; height:"+c+'px;"></vml:shape>';j.tip.html(C?l+=l:l);break;case "polygon":j.tip.append('<div class="ui-tooltip-tip-inner" />').append(C?'<div class="ui-tooltip-tip-border" />':"");break}},update:function(l){var c=j.tip.children(),
y=p.width,s=p.height,f=o.mimic,d,g,i,q,k;if(!l)l=h.corner;if(f===m)f=l;else{f=new b.fn.qtip.plugins.Corner(f);f.precedance=l.precedance;if(f.x==="inherit")f.x=l.x;else if(f.y==="inherit")f.y=l.y;else if(f.x===f.y)f[l.precedance]=l[l.precedance]}C=o.border===t?n(l,D,t):o.border;d=C>0?0:1;q=f.string().indexOf("center")>-1;k=Math[/b|r/.test(f[f.precedance==="y"?"x":"y"])?"ceil":"floor"];l=h.position(l,1);h.detectColours();switch(H){case "canvas":g=c[0].getContext("2d");g.restore&&g.restore();g.clearRect(0,
0,3E3,3E3);for(i=X(f,y,s);d<2;d++){if(d){g.save();g.translate(k((f.x==="left"?1:f.x==="right"?-1:0)*(C+1)*(f.precedance==="y"?0.5:1)),k((f.y==="top"?1:f.y==="bottom"?-1:0)*(C+1)*(f.precedance==="x"?0.5:1)))}g.beginPath();g.moveTo(i[0][0],i[0][1]);g.lineTo(i[1][0],i[1][1]);g.lineTo(i[2][0],i[2][1]);g.closePath();g.fillStyle=z[d?"fill":"border"];g.fill()}break;case "vml":i=X(f,y,s);i="m"+i[0][0]+","+i[0][1]+" l"+i[1][0]+","+i[1][1]+" "+i[2][0]+","+i[2][1]+" xe";c.each(function(v){b(this).attr({path:i,
fillcolor:z[v||!C?"fill":"border"]}).css("antialias",""+q)});break;case "polygon":c.removeAttr("style").css({position:"absolute",left:0,top:0}).each(function(v){var F={x:f.precedance==="x"?f.x==="left"?"right":"left":f.x,y:f.precedance==="y"?f.y==="top"?"bottom":"top":f.y},G=f.x==="center"?["left","right",F.y,s,y]:["top","bottom",F.x,y,s];v=z[!v&&C?"border":"fill"];f.x==="center"||f.y==="center"?b(this).css("border-"+G[2],G[3]+"px solid "+v).css("border-"+G[0],k(G[4]/2)+"px dashed transparent").css("border-"+
G[1],k(G[4]/2)+"px dashed transparent"):b(this).css("border-width",k(s/2)+"px "+k(y/2)+"px").css("border-"+F.x,k(y/2)+"px solid "+v).css("border-"+F.y,k(s/2)+"px solid "+v)});break}if(H!=="canvas"&&C){d=[C*2.75,C];d=f.precedance==="y"?[f.x==="left"?d[1]:f.x==="right"?-d[1]:0,f.y==="bottom"?-d[0]:d[0]]:[f.x==="left"?d[0]:-d[0],f.y==="bottom"?-d[1]:f.y==="top"?d[1]:0];c.eq(1).css({left:d[0],top:d[1]})}return l},position:function(l,c){var y=j.tip,s={},f=Math.max(0,o.offset),d,g;if(o.corner===m||!y)return m;
l=l||h.corner;d=l.precedance;g=p[d==="x"?"width":"height"];b.each(d==="y"?[l.x,l.y]:[l.y,l.x],function(i,q){var k;if(q==="center"){k=d==="y"?"left":"top";s[k]="50%";s["margin-"+k]=-Math.floor(g/2)+f}else{n(l,q,t);if(i||C===Q)k=n(l,q);else{k=b.browser.mozilla;var v=l.y+(k?"":"-")+l.x;k=(k?"-moz-":b.browser.webkit?"-webkit-":"")+(k?"border-radius-"+v:"border-"+v+"-radius");k=parseInt((j.titlebar&&l.y==="top"?j.titlebar:j.content).css(k),10)||parseInt(x.css(k),10)||0;k=f+k}s[q]=k}});s[l[d]]-=g;c&&y.css({top:"",
bottom:"",left:"",right:"",margin:""}).css(s);return s},destroy:function(){j.tip&&j.tip.remove();x.unbind(".qtip-tip")}});h.init()}function ca(e){var a=this,n=e.options.show.modal,h=e.elements,o=h.tooltip;a.checks={"^show.modal.(on|blur)$":function(){a.init();h.overlay.toggle(o.is(":visible"))}};b.extend(a,{init:function(){if(n.on){o.unbind(".qtipmodal").bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(j,x,r){j=j.type.replace("tooltip","");b.isFunction(n[j])?n[j].call(h.overlay,r,x):a[j](r)});
a.create();n.blur===t&&h.overlay.unbind(".qtipmodal"+e.id).bind("click.qtipmodal"+e.id,function(){e.hide.call(e)})}},create:function(){var j=b("#qtip-overlay");if(j.length)h.overlay=j;else{h.overlay=b("<div />",{id:"#qtip-overlay".substr(1),css:{position:"absolute",top:0,left:0,display:"none",zIndex:parseInt(o.css("z-index"),10)-1}}).appendTo(document.body);b(L).bind("resize.qtipmodal",function(){h.overlay.css({height:Math.max(b(L).height(),b(document).height()),width:Math.max(b(L).width(),b(document).width())})}).trigger("resize")}},
toggle:function(j){var x=h.overlay,r=e.options.show.modal.effect,p=j?"show":"hide";x.stop(t,m);if(b.isFunction(r))r.call(x,j);else r===m?x[p]():x.fadeTo(90,j?0.7:0,function(){j||b(this).hide()})},show:function(){a.toggle(t)},hide:function(){a.toggle(m)},destroy:function(){var j=t;b("*").each(function(){var x=b(this).data("qtip");if(x&&x.id!==e.id&&x.options.show.modal)return j=m});if(j){h.overlay.remove();b(L).unbind(".qtipmodal")}else h.overlay.unbind(".qtipmodal"+e.id);o.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});
a.init()}function da(e){var a=this,n=e.elements,h=n.tooltip,o=".bgiframe-"+e.id,j="tooltipmove"+o+" tooltipshow"+o;b.extend(a,{init:function(){n.bgiframe=b('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>');n.bgiframe.appendTo(h);h.bind(j,a.adjust)},adjust:function(){var x=e.get("dimensions"),r=e.plugins.tip,p=e.elements.tip,z;z=parseInt(h.css("border-left-width"),10)||
0;z={left:-z,top:-z};if(r&&p){r=r.corner.precedance==="x"?["width","left"]:["height","top"];z[r[1]]-=p[r[0]]()}n.bgiframe.css(z).css(x)},destroy:function(){a.iframe.remove();h.unbind(j)}});a.init()}var t=true,m=false,D=null,I="ui-tooltip",W="ui-widget",N="ui-state-disabled",S=".qtip."+I,U=I+"-focus",Z="-31000px";b.fn.qtip=function(e,a,n){var h=String(e).toLowerCase(),o=D,j=h==="disable"?[t]:b.makeArray(arguments).slice(1,10),x=j[j.length-1],r;if(!arguments.length&&this.data("qtip")||h==="api")return(r=
this.data("qtip"))?r:Q;else if("string"===typeof e){this.each(function(){var p=b(this).data("qtip");if(!p)return t;if(/option|set/.test(h)&&a)if(n!==Q)p.set(a,n);else o=p.get(a);else{if(!p.rendered&&(h==="show"||h==="toggle")){if(x&&x.timeStamp)p.cache.event=x;p.render(1)}else if(h==="enable"){h="disable";j=[m]}p[h]&&p[h].apply(p[h],j)}});return o!==D?o:this}else if("object"===typeof e||!arguments.length){r=V(b.extend(t,{},e));return b.fn.qtip.bind.call(this,r,x)}};b.fn.qtip.bind=function(e,a){return this.each(function(){function n(z){function C(){p.render(typeof z===
"object"||h.show.ready);o.show.unbind(j.show);o.hide.unbind(j.hide)}if(p.cache.disabled)return m;p.cache.event=b.extend({},z);if(h.show.delay>0){clearTimeout(p.timers.show);p.timers.show=setTimeout(C,h.show.delay);j.show!==j.hide&&o.hide.bind(j.hide,function(){clearTimeout(p.timers.show)})}else C()}var h,o,j,x=e.id=!e.id||e.id===m||e.id.length<1||b("#"+I+"-"+e.id).length?b.fn.qtip.nextid++:e.id,r=".qtip-"+x+"-create",p=$.call(this,x,e);if(p===m)return t;h=p.options;b.each(b.fn.qtip.plugins,function(){this.initialize===
"initialize"&&this(p)});o={show:h.show.target,hide:h.hide.target};j={show:String(h.show.event).replace(" ",r+" ")+r,hide:String(h.hide.event).replace(" ",r+" ")+r};o.show.bind(j.show,n);if(h.show.ready||h.prerender)n(a)})};b.each({attr:function(e){var a=b(this),n=a.data("qtip");return arguments.length===1&&e==="title"&&n&&n.rendered===t?a.data("oldtitle"):D},remove:b.ui?D:function(e,a){b(this).each(function(){if(!a)if(!e||b.filter(e,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")})})}},
function(e,a){if(!a)return t;b.fn["Old"+e]=b.fn[e];b.fn[e]=function(){return a.apply(this,arguments)||b.fn["Old"+e].apply(this,arguments)}});b(document).ready(function(){var e=document,a=e.body;b(e).bind("mousemove.qtip",function(n){b.fn.qtip.mouse={pageX:n.pageX,pageY:n.pageY}});e.activeElement===Q&&e.addEventListener("focus",function(n){if(n&&n.target)e.activeElement=n.target===e?a:n.target},true)});b.fn.qtip.version="2.0.0pre";b.fn.qtip.nextid=0;b.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");
b.fn.qtip.zindex=15E3;b.fn.qtip.plugins={Corner:function(e){e=String(e).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(e.match(/left|right/i)||e.match(/center/)||["inherit"])[0].toLowerCase();this.y=(e.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.precedance=e.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 a=this.x.substr(0,1),n=this.y.substr(0,1);
return a===n?a:a==="c"||a!=="c"&&n!=="c"?n+a:a+n}},iOS:parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1};b.fn.qtip.defaults={prerender:m,id:m,overwrite:t,metadata:{type:"class"},content:{text:t,attr:"title",title:{text:m,button:m}},position:{my:"top left",at:"bottom right",target:m,container:m,viewport:m,adjust:{x:0,y:0,mouse:t,resize:t},effect:t},show:{target:m,event:"mouseenter",effect:t,delay:90,solo:m,ready:m},hide:{target:m,
event:"mouseleave",effect:t,delay:0,fixed:m,inactive:m},style:{classes:"",widget:m},events:{render:D,move:D,show:D,hide:D,toggle:D,focus:D,blur:D}};b.fn.qtip.plugins.ajax=function(e){var a=e.plugins.ajax;return"object"===typeof a?a:e.plugins.ajax=new aa(e)};b.fn.qtip.plugins.ajax.initialize="render";b.fn.qtip.plugins.ajax.sanitize=function(e){var a=e.content;if(a&&"ajax"in a){a=a.ajax;if(typeof a!=="object")a=e.content.ajax={url:a};if("boolean"!==typeof a.once&&a.once)a.once=!!a.once}};b.extend(t,
b.fn.qtip.defaults,{content:{ajax:{once:t}}});b.fn.qtip.plugins.tip=function(e){var a=e.plugins.tip;return"object"===typeof a?a:e.plugins.tip=new ba(e)};b.fn.qtip.plugins.tip.initialize="render";b.fn.qtip.plugins.tip.sanitize=function(e){var a=e.style;if(a&&"tip"in a){a=e.style.tip;if(typeof a!=="object")e.style.tip={corner:a};if(!/string|boolean/i.test(typeof a.corner))a.corner=t;if(typeof a.method!=="string")a.method=t;if(!/canvas|polygon/i.test(a.method))a.method=t;typeof a.width!=="number"&&delete a.width;
typeof a.height!=="number"&&delete a.height;typeof a.border!=="number"&&a.border!==t&&delete a.border;typeof a.offset!=="number"&&delete a.offset}};b.extend(t,b.fn.qtip.defaults,{style:{tip:{corner:t,mimic:m,method:t,width:8,height:8,border:t,offset:0}}});b.fn.qtip.plugins.imagemap=function(e,a){function n(H,l){for(var c=0,y=1,s=1,f=0,d=0,g=H.width,i=H.height;g>0&&i>0&&y>0&&s>0;){g=Math.floor(g/2);i=Math.floor(i/2);if(a.x==="left")y=g;else if(a.x==="right")y=H.width-g;else y+=Math.floor(g/2);if(a.y===
"top")s=i;else if(a.y==="bottom")s=H.height-i;else s+=Math.floor(i/2);for(c=l.length;c--;){if(l.length<2)break;f=l[c][0]-H.offset.left;d=l[c][1]-H.offset.top;if(a.x==="left"&&f>=y||a.x==="right"&&f<=y||a.x==="center"&&(f<y||f>H.width-y)||a.y==="top"&&d>=s||a.y==="bottom"&&d<=s||a.y==="center"&&(d<s||d>H.height-s))l.splice(c,1)}}return{left:l[0][0],top:l[0][1]}}var h=e.attr("shape").toLowerCase(),o=e.attr("coords").split(","),j=[],x=b('img[usemap="#'+e.parent("map").attr("name")+'"]'),r=x.offset(),
p={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},z=0,C=0;r.left+=Math.ceil((x.outerWidth()-x.width())/2);r.top+=Math.ceil((x.outerHeight()-x.height())/2);if(h==="poly")for(z=o.length;z--;){C=[parseInt(o[--z],10),parseInt(o[z+1],10)];if(C[0]>p.offset.right)p.offset.right=C[0];if(C[0]<p.offset.left)p.offset.left=C[0];if(C[1]>p.offset.bottom)p.offset.bottom=C[1];if(C[1]<p.offset.top)p.offset.top=C[1];j.push(C)}else j=b.map(o,function(H){return parseInt(H,10)});switch(h){case "rect":p=
{width:Math.abs(j[2]-j[0]),height:Math.abs(j[3]-j[1]),offset:{left:j[0],top:j[1]}};break;case "circle":p={width:j[2]+2,height:j[2]+2,offset:{left:j[0],top:j[1]}};break;case "poly":b.extend(p,{width:Math.abs(p.offset.right-p.offset.left),height:Math.abs(p.offset.bottom-p.offset.top)});p.offset=a.string()==="centercenter"?{left:p.offset.left+p.width/2,top:p.offset.top+p.height/2}:n(p,j.slice());p.width=p.height=0;break}p.offset.left+=r.left;p.offset.top+=r.top;return p};b.fn.qtip.plugins.modal=function(e){var a=
e.plugins.modal;return"object"===typeof a?a:e.plugins.modal=new ca(e)};b.fn.qtip.plugins.modal.initialize="render";b.fn.qtip.plugins.modal.sanitize=function(e){if(e.show)if(typeof e.show.modal!=="object")e.show.modal={on:!!e.show.modal};else if(typeof e.show.modal.on==="undefined")e.show.modal.on=t};b.extend(t,b.fn.qtip.defaults,{show:{modal:{on:m,effect:t,blur:t}}});b.fn.qtip.plugins.bgiframe=function(e){if(!(b.browser.msie&&/^6\.[0-9]/.test(b.browser.version)&&b("select, object").length))return m;
var a=e.plugins.bgiframe;if(a)return a;else{e.plugins.bgiframe=new da(e);return e.plugins.bgiframe}};b.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);