-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjquery.qtip.min.js
77 lines (77 loc) · 38.2 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
(function(J,K,N){var ea=function(d){function ca(b){var a=function(a){return a===C||"object"!==typeof a},j=function(a){return!d.isFunction(a)&&(!a&&!a.attr||1>a.length||"object"===typeof a&&!a.jquery)};if(!b||"object"!==typeof b)return f;a(b.metadata)&&(b.metadata={type:b.metadata});if("content"in b){if(a(b.content)||b.content.jquery)b.content={text:b.content};if(j(b.content.text||f))b.content.text=f;if("title"in b.content&&(a(b.content.title)&&(b.content.title={text:b.content.title}),j(b.content.title.text||
f)))b.content.title.text=f}"position"in b&&a(b.position)&&(b.position={my:b.position,at:b.position});"show"in b&&a(b.show)&&(b.show=b.show.jquery?{target:b.show}:{event:b.show});"hide"in b&&a(b.hide)&&(b.hide=b.hide.jquery?{target:b.hide}:{event:b.hide});"style"in b&&a(b.style)&&(b.style={classes:b.style});d.each(s,function(){this.sanitize&&this.sanitize(b)});return b}function ea(b,a,j,r){function u(e){for(var c=0,d,b=a,e=e.split(".");b=b[e[c++]];)c<e.length&&(d=b);return[d||a,e.pop()]}function q(e,
a,b){e=d.Event("tooltip"+e);e.originalEvent=(b?d.extend({},b):C)||B.event||C;k.trigger(e,[c].concat(a||[]));return!e.isDefaultPrevented()}function l(){var e=a.style.widget;k.toggleClass("ui-helper-reset "+fa,e).toggleClass(ia,a.style.def&&!e);n.content&&n.content.toggleClass(fa+"-content",e);n.titlebar&&n.titlebar.toggleClass(fa+"-header",e);n.button&&n.button.toggleClass(F+"-icon",!e)}function m(e){n.title&&(n.titlebar.remove(),n.titlebar=n.title=n.button=C,e!==f&&c.reposition())}function g(){var e=
a.content.title.button,b="string"===typeof e?e:"Close tooltip";n.button&&n.button.remove();n.button=e.jquery?e:d("<a />",{"class":"ui-state-default ui-tooltip-close "+(a.style.widget?"":F+"-icon"),title:b,"aria-label":b}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"×"}));n.button.appendTo(n.titlebar).attr("role","button").click(function(e){k.hasClass(O)||c.hide(e);return f});c.redraw()}function z(){var e=y+"-title";n.titlebar&&m();n.titlebar=d("<div />",{"class":F+"-titlebar "+
(a.style.widget?"ui-widget-header":"")}).append(n.title=d("<div />",{id:e,"class":F+"-title","aria-atomic":i})).insertBefore(n.content).delegate(".ui-tooltip-close","mousedown keydown mouseup keyup mouseout",function(e){d(this).toggleClass("ui-state-active ui-state-focus","down"===e.type.substr(-4))}).delegate(".ui-tooltip-close","mouseover mouseout",function(e){d(this).toggleClass("ui-state-hover","mouseover"===e.type)});a.content.title.button?g():c.rendered&&c.redraw()}function h(e,a){var p=n.title;
if(!c.rendered||!e)return f;d.isFunction(e)&&(e=e.call(b,B.event,c));if(e===f||!e&&""!==e)return m(f);e.jquery&&0<e.length?p.empty().append(e.css({display:"block"})):p.html(e);c.redraw();a!==f&&(c.rendered&&0<k[0].offsetWidth)&&c.reposition(B.event)}function A(e,a){function g(e){function b(k){k&&(delete p[k.src],clearTimeout(c.timers.img[k.src]),d(k).unbind(t));d.isEmptyObject(p)&&(c.redraw(),a!==f&&c.reposition(B.event),e())}var k,p={};if(0===(k=j.find("img[src]:not([height]):not([width])")).length)return b();
k.each(function(e,a){if(p[a.src]===N){var k=0;(function M(){if(a.height||a.width||3<k)return b(a);k+=1;c.timers.img[a.src]=setTimeout(M,700)})();d(a).bind("error"+t+" load"+t,function(){b(this)});p[a.src]=a}})}var j=n.content;if(!c.rendered||!e)return f;d.isFunction(e)&&(e=e.call(b,B.event,c)||"");e.jquery&&0<e.length?j.empty().append(e.css({display:"block"})):j.html(e);0>c.rendered?k.queue("fx",g):(p=0,g(d.noop));return c}function o(){function e(e){if(k.hasClass(O))return f;clearTimeout(c.timers.show);
clearTimeout(c.timers.hide);var b=function(){c.toggle(i,e)};0<a.show.delay?c.timers.show=setTimeout(b,a.show.delay):b()}function g(e){if(k.hasClass(O)||x||p)return f;var b=d(e.relatedTarget||e.target),aa=b.closest(P)[0]===k[0],b=b[0]===h.show[0];clearTimeout(c.timers.show);clearTimeout(c.timers.hide);if("mouse"===v.target&&aa||a.hide.fixed&&/mouse(out|leave|move)/.test(e.type)&&(aa||b))try{e.preventDefault(),e.stopImmediatePropagation()}catch(j){}else 0<a.hide.delay?c.timers.hide=setTimeout(function(){c.hide(e)},
a.hide.delay):c.hide(e)}function aa(e){if(k.hasClass(O))return f;clearTimeout(c.timers.inactive);c.timers.inactive=setTimeout(function(){c.hide(e)},a.hide.inactive)}function I(e){c.rendered&&0<k[0].offsetWidth&&c.reposition(e)}var v=a.position,h={show:a.show.target,hide:a.hide.target,viewport:d(v.viewport),document:d(K),body:d(K.body),window:d(J)},r=d.trim(""+a.show.event).split(" "),l=d.trim(""+a.hide.event).split(" "),m=d.browser.msie&&6===parseInt(d.browser.version,10);k.bind("mouseenter"+t+" mouseleave"+
t,function(e){var a="mouseenter"===e.type;a&&c.focus(e);k.toggleClass(ja,a)});/mouse(out|leave)/i.test(a.hide.event)&&"window"===a.hide.leave&&h.window.bind("mouseout"+t+" blur"+t,function(e){!/select|option/.test(e.target.nodeName)&&!e.relatedTarget&&c.hide(e)});a.hide.fixed?(h.hide=h.hide.add(k),k.bind("mouseover"+t,function(){k.hasClass(O)||clearTimeout(c.timers.hide)})):/mouse(over|enter)/i.test(a.show.event)&&h.hide.bind("mouseleave"+t,function(){clearTimeout(c.timers.show)});-1<(""+a.hide.event).indexOf("unfocus")&&
v.container.closest("html").bind("mousedown"+t,function(e){var a=d(e.target);c.rendered&&k.hasClass(O);var p=a.parents(P).filter(k[0]).length>0;a[0]!==b[0]&&(a[0]!==k[0]&&!p&&!b.has(a[0]).length&&!a.attr("disabled"))&&c.hide(e)});"number"===typeof a.hide.inactive&&(h.show.bind("qtip-"+j+"-inactive",aa),d.each(D.inactiveEvents,function(e,a){h.hide.add(n.tooltip).bind(a+t+"-inactive",aa)}));d.each(l,function(a,c){var b=d.inArray(c,r),p=d(h.hide);if(b>-1&&p.add(h.show).length===p.length||c==="unfocus"){h.show.bind(c+
t,function(a){k[0].offsetWidth>0?g(a):e(a)});delete r[b]}else h.hide.bind(c+t,g)});d.each(r,function(a,c){h.show.bind(c+t,e)});"number"===typeof a.hide.distance&&h.show.add(k).bind("mousemove"+t,function(e){var b=B.origin||{},d=a.hide.distance,k=Math.abs;(k(e.pageX-b.pageX)>=d||k(e.pageY-b.pageY)>=d)&&c.hide(e)});"mouse"===v.target&&(h.show.bind("mousemove"+t,function(e){T={pageX:e.pageX,pageY:e.pageY,type:"mousemove"}}),v.adjust.mouse&&(a.hide.event&&(k.bind("mouseleave"+t,function(e){(e.relatedTarget||
e.target)!==h.show[0]&&c.hide(e)}),n.target.bind("mouseenter"+t+" mouseleave"+t,function(e){B.onTarget=e.type==="mouseenter"})),h.document.bind("mousemove"+t,function(e){c.rendered&&(B.onTarget&&!k.hasClass(O)&&k[0].offsetWidth>0)&&c.reposition(e||T)})));if(v.adjust.resize||h.viewport.length)(d.event.special.resize?h.viewport:h.window).bind("resize"+t,I);(h.viewport.length||m&&"fixed"===k.css("position"))&&h.viewport.bind("scroll"+t,I)}function w(){var e=[a.show.target[0],a.hide.target[0],c.rendered&&
n.tooltip[0],a.position.container[0],a.position.viewport[0],a.position.container.closest("html")[0],J,K];c.rendered?d([]).pushStack(d.grep(e,function(e){return"object"===typeof e})).unbind(t):a.show.target.unbind(t+"-create")}var c=this,y=F+"-"+j,x=0,p=0,k=d(),t=".qtip-"+j,n,B;c.id=j;c.rendered=f;c.destroyed=f;c.elements=n={target:b};c.timers={img:{}};c.options=a;c.checks={};c.plugins={};c.cache=B={event:{},target:d(),disabled:f,attr:r,onTarget:f,lastClass:""};c.checks.builtin={"^id$":function(e,
a,c){e=c===i?D.nextid:c;a=F+"-"+e;e!==f&&(0<e.length&&!d("#"+a).length)&&(k[0].id=a,n.content[0].id=a+"-content",n.title[0].id=a+"-title")},"^content.text$":function(e,a,c){A(c)},"^content.title.text$":function(e,a,c){if(!c)return m();!n.title&&c&&z();h(c)},"^content.title.button$":function(e,a,b){e=n.button;a=n.title;c.rendered&&(b?(a||z(),g()):e.remove())},"^position.(my|at)$":function(e,a,c){"string"===typeof c&&(e[a]=new s.Corner(c))},"^position.container$":function(e,a,b){c.rendered&&k.appendTo(b)},
"^show.ready$":function(){c.rendered?c.toggle(i):c.render(1)},"^style.classes$":function(e,a,c){k.attr("class",F+" qtip "+c)},"^style.widget|content.title":l,"^events.(render|show|move|hide|focus|blur)$":function(e,a,c){k[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+a,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){var e=a.position;k.attr("tracking","mouse"===e.target&&e.adjust.mouse);w();o()}};d.extend(c,{render:function(e){if(c.rendered)return c;
var g=a.content.text,j=a.content.title.text,t=a.position;d.attr(b[0],"aria-describedby",y);k=n.tooltip=d("<div/>",{id:y,"class":F+" qtip "+ia+" "+a.style.classes+" "+F+"-pos-"+a.position.my.abbrev(),width:a.style.width||"",height:a.style.height||"",tracking:"mouse"===t.target&&t.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":f,"aria-describedby":y+"-content","aria-hidden":i}).toggleClass(O,B.disabled).data("qtip",c).appendTo(a.position.container).append(n.content=d("<div />",{"class":F+
"-content",id:y+"-content","aria-atomic":i}));c.rendered=-1;x=p=1;j&&(z(),d.isFunction(j)||h(j,f));d.isFunction(g)||A(g,f);c.rendered=i;l();d.each(a.events,function(e,a){d.isFunction(a)&&k.bind(e==="toggle"?"tooltipshow tooltiphide":"tooltip"+e,a)});d.each(s,function(){this.initialize==="render"&&this(c)});o();k.queue("fx",function(b){q("render");x=p=0;c.redraw();(a.show.ready||e)&&c.toggle(i,B.event,f);b()});return c},get:function(e){switch(e.toLowerCase()){case "dimensions":e={height:k.outerHeight(),
width:k.outerWidth()};break;case "offset":e=s.offset(k,a.position.container);break;default:e=u(e.toLowerCase()),e=e[0][e[1]],e=e.precedance?e.string():e}return e},set:function(e,b){var g=/^position\.(my|at|adjust|target|container)|style|content|show\.ready/i,h=/^content\.(title|attr)|style/i,j=f,t=f,n=c.checks,r;"string"===typeof e?(r=e,e={},e[r]=b):e=d.extend(i,{},e);d.each(e,function(a,c){var b=u(a.toLowerCase()),k;k=b[0][b[1]];b[0][b[1]]="object"===typeof c&&c.nodeType?d(c):c;e[a]=[b[0],b[1],c,
k];j=g.test(a)||j;t=h.test(a)||t});ca(a);x=p=1;d.each(e,function(e,a){var b,d,k;for(b in n)for(d in n[b])if(k=RegExp(d,"i").exec(e)){a.push(k);n[b][d].apply(c,a)}});x=p=0;c.rendered&&0<k[0].offsetWidth&&(j&&c.reposition("mouse"===a.position.target?C:B.event),t&&c.redraw());return c},toggle:function(e,b,p){function g(){e?(d.browser.msie&&k[0].style.removeAttribute("filter"),k.css("overflow",""),"string"===typeof n.autofocus&&d(n.autofocus,k).focus(),n.target.trigger("qtip-"+j+"-inactive")):k.css({display:"",
visibility:"",opacity:"",left:"",top:""});q(e?"visible":"hidden")}if(!c.rendered)return e?c.render(1):c;var t=e?"show":"hide",n=a[t],r=a.position,l=a.content,m=0<k[0].offsetWidth,w=e||1===n.target.length,u=!b||2>n.target.length||B.target[0]===b.target;(typeof e).search("boolean|number")&&(e=!m);if(!k.is(":animated")&&m===e&&u)return c;if(b){if(/over|enter/.test(b.type)&&/out|leave/.test(B.event.type)&&a.show.target.add(b.target).length===a.show.target.length&&k.has(b.relatedTarget).length)return c;
B.event=d.extend({},b)}if(!q(t,[90]))return c;d.attr(k[0],"aria-hidden",!e);e?(B.origin=d.extend({},T),c.focus(b),d.isFunction(l.text)&&A(l.text,f),d.isFunction(l.title.text)&&h(l.title.text,f),!da&&("mouse"===r.target&&r.adjust.mouse)&&(d(K).bind("mousemove.qtip",function(a){T={pageX:a.pageX,pageY:a.pageY,type:"mousemove"}}),da=i),c.reposition(b,p),n.solo&&d(P,n.solo).not(k).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(c.timers.show),delete B.origin,da&&!d(P+'[tracking="true"]:visible',n.solo).not(k).length&&
(d(K).unbind("mousemove.qtip"),da=f),c.blur(b));n.effect===f||w===f?(k[t](),g.call(k)):d.isFunction(n.effect)?(k.stop(1,1),n.effect.call(k,c),k.queue("fx",function(a){g();a()})):k.fadeTo(90,e?1:0,g);e&&n.target.trigger("qtip-"+j+"-inactive");return c},show:function(a){return c.toggle(i,a)},hide:function(a){return c.toggle(f,a)},focus:function(a){if(!c.rendered)return c;var b=d(P),p=parseInt(k[0].style.zIndex,10),g=D.zindex+b.length,a=d.extend({},a);!k.hasClass(W)&&q("focus",[g],a)&&(p!==g&&(b.each(function(){this.style.zIndex>
p&&(this.style.zIndex-=1)}),b.filter("."+W).qtip("blur",a)),k.addClass(W)[0].style.zIndex=g);return c},blur:function(a){k.removeClass(W);q("blur",[k.css("zIndex")],a);return c},reposition:function(e,b){if(!c.rendered||x)return c;x=1;var p=a.position.target,g=a.position,h=g.my,t=g.at,j=g.adjust,r=j.method.split(" "),l=k.outerWidth(),m=k.outerHeight(),w=0,u=0,o="fixed"===k.css("position"),y=g.viewport,i={left:0,top:0},z=g.container,A=0<k[0].offsetWidth,C,D;if(d.isArray(p)&&2===p.length)t={x:L,y:H},
i={left:p[0],top:p[1]};else if("mouse"===p&&(e&&e.pageX||B.event.pageX))t={x:L,y:H},e=(e&&("resize"===e.type||"scroll"===e.type)?B.event:e&&e.pageX&&"mousemove"===e.type?e:T&&T.pageX&&(j.mouse||!e||!e.pageX)?{pageX:T.pageX,pageY:T.pageY}:!j.mouse&&B.origin&&B.origin.pageX&&a.show.distance?B.origin:e)||e||B.event||T||{},i={top:e.pageY,left:e.pageX};else{"event"===p&&e&&e.target&&"scroll"!==e.type&&"resize"!==e.type?B.target=d(e.target):"event"!==p&&(B.target=d(p.jquery?p:n.target));p=B.target;p=d(p).eq(0);
if(0===p.length)return c;p[0]===K||p[0]===J?(w=s.iOS?J.innerWidth:p.width(),u=s.iOS?J.innerHeight:p.height(),p[0]===J&&(i={top:(y||p).scrollTop(),left:(y||p).scrollLeft()})):s.imagemap&&p.is("area")?C=s.imagemap(c,p,t,s.viewport?r:f):s.svg&&"string"===typeof p[0].xmlbase?C=s.svg(c,p,t,s.viewport?r:f):(w=p.outerWidth(),u=p.outerHeight(),i=s.offset(p,z));C&&(w=C.width,u=C.height,D=C.offset,i=C.position);if(3.1<s.iOS&&4.1>s.iOS||4.3<=s.iOS&&4.33>s.iOS||!s.iOS&&o)r=d(J),i.left-=r.scrollLeft(),i.top-=
r.scrollTop();i.left+=t.x===Q?w:t.x===G?w/2:0;i.top+=t.y===R?u:t.y===G?u/2:0}i.left+=j.x+(h.x===Q?-l:h.x===G?-l/2:0);i.top+=j.y+(h.y===R?-m:h.y===G?-m/2:0);if(s.viewport){if(i.adjusted=s.viewport(c,i,g,w,u,l,m),D&&i.adjusted.left&&(i.left+=D.left),D&&i.adjusted.top)i.top+=D.top}else i.adjusted={left:0,top:0};if(!q("move",[i,y.elem||y],e))return c;delete i.adjusted;b===f||!A||isNaN(i.left)||isNaN(i.top)||"mouse"===p||!d.isFunction(g.effect)?k.css(i):d.isFunction(g.effect)&&(g.effect.call(k,c,d.extend({},
i)),k.queue(function(a){d(this).css({opacity:"",height:""});d.browser.msie&&this.style.removeAttribute("filter");a()}));x=0;return c},redraw:function(){if(1>c.rendered||p)return c;var e=a.style,b=a.position.container,d,g,h;p=1;q("redraw");e.height&&k.css($,e.height);e.width?k.css(X,e.width):(k.css(X,"").appendTo(ga),d=k.width(),1>d%2&&(d+=1),g=k.css("max-width")||"",h=k.css("min-width")||"",e=-1<(g+h).indexOf("%")?b.width()/100:0,g=(-1<g.indexOf("%")?e:1)*parseInt(g,10)||d,h=(-1<h.indexOf("%")?e:
1)*parseInt(h,10)||0,d=g+h?Math.min(Math.max(d,h),g):d,k.css(X,Math.round(d)).appendTo(b));q("redrawn");p=0;return c},disable:function(a){"boolean"!==typeof a&&(a=!(k.hasClass(O)||B.disabled));c.rendered?(k.toggleClass(O,a),d.attr(k[0],"aria-disabled",a)):B.disabled=!!a;return c},enable:function(){return c.disable(f)},destroy:function(){var e=b[0],p=d.attr(e,Y),g=b.data("qtip");c.destroyed=i;c.rendered&&(k.stop(1,0).remove(),d.each(c.plugins,function(){this.destroy&&this.destroy()}));clearTimeout(c.timers.show);
clearTimeout(c.timers.hide);w();if(!g||c===g)d.removeData(e,"qtip"),a.suppress&&p&&(d.attr(e,"title",p),b.removeAttr(Y)),b.removeAttr("aria-describedby");b.unbind(".qtip-"+j);delete ha[c.id];return b}})}function ka(b){var a=this,j=b.elements.tooltip,r=b.options.content.ajax,u=D.defaults.content.ajax,q=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,l=i,m=f,g;b.checks.ajax={"^content.ajax":function(b,d,g){"ajax"===d&&(r=g);"once"===d?a.init():r&&r.url?a.load():j.unbind(".qtip-ajax")}};d.extend(a,
{init:function(){if(r&&r.url)j.unbind(".qtip-ajax")[r.once?"one":"bind"]("tooltipshow.qtip-ajax",a.load);return a},load:function(j){function h(){var a;if(!b.destroyed&&(l=f,x&&(m=i,b.show(j.originalEvent)),(a=u.complete||r.complete)&&d.isFunction(a)))a.apply(r.context||b,arguments)}function s(a,c,p){var g;b.destroyed||(y&&"string"===typeof a&&(a=d("<div/>").append(a.replace(q,"")).find(y)),(g=u.success||r.success)&&d.isFunction(g)?g.call(r.context||b,a,c,p):b.set("content.text",a))}function o(a,c,
d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)}if(m)m=f;else{var w=r.url.lastIndexOf(" "),c=r.url,y,x=!r.loading&&l;if(x)try{j.preventDefault()}catch(p){}else if(j&&j.isDefaultPrevented())return a;g&&g.abort&&g.abort();-1<w&&(y=c.substr(w),c=c.substr(0,w));g=d.ajax(d.extend({error:u.error||o,context:b},r,{url:c,success:s,complete:h}))}},destroy:function(){g&&g.abort&&g.abort();b.destroyed=i}});a.init()}function la(b){function a(a){var b=z.is(":visible");z.show();a();z.toggle(b)}function j(a,
c,d){if(g.tip){var a=l.corner.clone(),c=d.adjusted,j=b.options.position.adjust.method.split(" "),w=j[0],j=j[1]||j[0],e=f,u=f,o=0,y=0,v,s={},q;l.corner.fixed!==i&&(w===V&&a.precedance===U&&c.left&&a.y!==G?a.precedance=a.precedance===U?S:U:w!==V&&c.left&&(a.x=a.x===G?0<c.left?L:Q:a.x===L?Q:L),j===V&&a.precedance===S&&c.top&&a.x!==G?a.precedance=a.precedance===S?U:S:j!==V&&c.top&&(a.y=a.y===G?0<c.top?H:R:a.y===H?R:H),a.string()!==h.corner.string()&&(h.top!==c.top||h.left!==c.left)&&l.update(a,f));v=
l.position(a,c);v[a.x]+=r(a,a.x);v[a.y]+=r(a,a.y);v.right!==N&&(v.left=-v.right);v.bottom!==N&&(v.top=-v.bottom);v.user=Math.max(0,m.offset);if(e=w===V&&!!c.left)if(a.x===G)s["margin-left"]=o=v["margin-left"]-c.left;else{q=v.right!==N?[c.left,-v.left]:[-c.left,v.left];if((o=Math.max(q[0],q[1]))>q[0])d.left-=c.left,e=f;s[v.right!==N?Q:L]=o}if(u=j===V&&!!c.top)if(a.y===G)s["margin-top"]=y=v["margin-top"]-c.top;else{q=v.bottom!==N?[c.top,-v.top]:[-c.top,v.top];if((y=Math.max(q[0],q[1]))>q[0])d.top-=
c.top,u=f;s[v.bottom!==N?R:H]=y}g.tip.css(s).toggle(!(o&&y||a.x===G&&y||a.y===G&&o));d.left-=v.left.charAt?v.user:w!==V||u||!e&&!u?v.left:0;d.top-=v.top.charAt?v.user:j!==V||e||!e&&!u?v.top:0;h.left=c.left;h.top=c.top;h.corner=a.clone()}}function r(c,b,d){var b=!b?c[c.precedance]:b,j=g.titlebar&&c.y===H?g.titlebar:z,h="border-"+b+"-width",e;a(function(){e=(d?parseInt(d.css(h),10):parseInt(g.content.css(h),10)||parseInt(j.css(h),10)||parseInt(z.css(h),10))||0});return e}function u(a){var b=a.precedance===
S,d=A[b?X:$],g=A[b?$:X],j=-1<a.string().indexOf(G),e=d*(j?0.5:1),h=Math.pow,a=Math.round,r=Math.sqrt(h(e,2)+h(g,2)),e=[c/e*r,c/g*r];e[2]=Math.sqrt(h(e[0],2)-h(c,2));e[3]=Math.sqrt(h(e[1],2)-h(c,2));j=(r+e[2]+e[3]+(j?0:e[0]))/r;d=[a(j*g),a(j*d)];return{height:d[b?0:1],width:d[b?1:0]}}function q(a,c,b){return"<qvml:"+a+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(c||"")+' style="behavior: url(#default#VML); '+(b||"")+'" />'}var l=this,m=b.options.style.tip,g=b.elements,z=g.tooltip,h=
{top:0,left:0},A={width:m.width,height:m.height},o,w,c=m.border||0,y=!!(d("<canvas />")[0]||{}).getContext,x;l.corner=C;l.mimic=C;l.border=c;l.offset=m.offset;l.size=A;b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){l.init()||l.destroy();b.reposition()},"^style.tip.(height|width)$":function(){A={width:m.width,height:m.height};l.create();l.update();b.reposition()},"^content.title.text|style.(classes|widget)$":function(){g.tip&&g.tip.length&&l.update()}};d.extend(l,{init:function(){var a;
a=m.corner;var c=b.options.position,r=c.at,c=c.my.string?c.my.string():c.my;a===f||c===f&&r===f?a=f:(a===i?l.corner=new s.Corner(c):a.string||(l.corner=new s.Corner(a),l.corner.fixed=i),h.corner=new s.Corner(l.corner.string()),a="centercenter"!==l.corner.string());if(a=a&&(y||d.browser.msie))l.create(),l.update(),z.unbind(".qtip-tip").bind("tooltipmove.qtip-tip",j),y||z.bind("tooltipredraw tooltipredrawn",function(a){if(a.type==="tooltipredraw"){x=g.tip.html();g.tip.html("")}else g.tip.html(x)});
return a},create:function(){var a=A.width,c=A.height;g.tip&&g.tip.remove();g.tip=d("<div />",{"class":"ui-tooltip-tip"}).css({width:a,height:c}).prependTo(z);y?d("<canvas />").appendTo(g.tip)[0].getContext("2d").save():(a=q("shape",'coordorigin="0,0"',"position:absolute;"),g.tip.html(a+a),d("*",g.tip).bind("click mousedown",function(a){a.stopPropagation()}))},update:function(b,j){var t=g.tip,n=t.children(),B=A.width,e=A.height,x=m.mimic,D=Math.round,I,v;b||(b=h.corner||l.corner);x===f?x=b:(x=new s.Corner(x),
x.precedance=b.precedance,"inherit"===x.x?x.x=b.x:"inherit"===x.y?x.y=b.y:x.x===x.y&&(x[b.precedance]=b[b.precedance]));b.precedance===U?(A.width=m.height,A.height=m.width):(A.width=m.width,A.height=m.height);g.tip.css({width:B=A.width,height:e=A.height});v=b;var F=function(a,c,b){c=a.css(c)||J;return b&&c===a.css(b)?f:K.test(c)?f:c},Z=g.tip.css("cssText","");v=v||l.corner;var K=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,ba="border-"+v[v.precedance]+"-color",J="transparent",E=g.titlebar,N=E&&(v.y===
H||v.y===G&&Z.position().top+A.height/2+m.offset<E.outerHeight(i))?E:g.content;a(function(){o=F(Z,"background-color")||F(N,"background-color")||F(g.content,"background-color")||F(z,"background-color")||Z.css("background-color");w=F(Z,ba,"color")||F(N,ba,"color")||F(g.content,ba,"color")||F(z,ba,"color")||z.css(ba);d("*",Z).add(Z).css("cssText","background-color:"+J+" !important;border:0 !important;")});"transparent"!==w?(c=r(b,C),0===m.border&&0<c&&(o=w),l.border=c=m.border!==i?m.border:c):l.border=
c=0;v=x;var E=B,M=e,O=Math.ceil(E/2),P=Math.ceil(M/2),E={bottomright:[[0,0],[E,M],[E,0]],bottomleft:[[0,0],[E,0],[0,M]],topright:[[0,M],[E,0],[E,M]],topleft:[[0,0],[0,M],[E,M]],topcenter:[[0,M],[O,0],[E,M]],bottomcenter:[[0,0],[E,0],[O,M]],rightcenter:[[0,0],[E,P],[0,M]],leftcenter:[[E,0],[E,M],[0,P]]};E.lefttop=E.bottomright;E.righttop=E.bottomleft;E.leftbottom=E.topright;E.rightbottom=E.topleft;I=E[v.string()];l.size=v=u(b);t.css(v);t=b.precedance===S?[D(x.x===L?c:x.x===Q?v.width-B-c:(v.width-B)/
2),D(x.y===H?v.height-e:0)]:[D(x.x===L?v.width-B:0),D(x.y===H?c:x.y===R?v.height-e-c:(v.height-e)/2)];y?(n.attr(v),n=n[0].getContext("2d"),n.restore(),n.save(),n.clearRect(0,0,3E3,3E3),n.fillStyle=o,n.strokeStyle=w,n.lineWidth=2*c,n.lineJoin="miter",n.miterLimit=100,n.translate(t[0],t[1]),n.beginPath(),n.moveTo(I[0][0],I[0][1]),n.lineTo(I[1][0],I[1][1]),n.lineTo(I[2][0],I[2][1]),n.closePath(),c&&("border-box"===z.css("background-clip")&&(n.strokeStyle=o,n.stroke()),n.strokeStyle=w,n.stroke()),n.fill()):
(I="m"+I[0][0]+","+I[0][1]+" l"+I[1][0]+","+I[1][1]+" "+I[2][0]+","+I[2][1]+" xe",t[2]=c&&/^(r|b)/i.test(b.string())?8===parseFloat(d.browser.version,10)?2:1:0,n.css({coordsize:B+c+" "+(e+c),antialias:""+(-1<x.string().indexOf(G)),left:t[0],top:t[1],width:B+c,height:e+c}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:B+c+" "+(e+c),path:I,fillcolor:o,filled:!!a,stroked:!a}).toggle(!(!c&&!a));!a&&b.html()===""&&b.html(q("stroke",'weight="'+c*2+'px" color="'+w+'" miterlimit="1000" joinstyle="miter"'))}));
j!==f&&l.position(b)},position:function(c){var b=g.tip,j={},h=Math.max(0,m.offset),w,e,i;if(m.corner===f||!b)return f;c=c||l.corner;w=c.precedance;e=u(c);i=[c.x,c.y];w===U&&i.reverse();d.each(i,function(b,k){var f,l,i;if(k===G)f=w===S?L:H,j[f]="50%",j["margin-"+f]=-Math.round(e[w===S?X:$]/2)+h;else{f=r(c,k);l=r(c,k,g.content);var m=g.titlebar&&c.y===H?g.titlebar:g.content,u=d.browser.mozilla?"-moz-":d.browser.webkit?"-webkit-":"",o="border-radius-"+c.y+c.x,y="border-"+c.y+"-"+c.x+"-radius",q=function(a){return parseInt(m.css(a),
10)||parseInt(z.css(a),10)},x;a(function(){x=q(y)||q(u+y)||q(u+o)||q(o)||0});i=x;j[k]=b?l:h+(i>f?i:-f)}});j[c[w]]-=e[w===U?X:$];b.css({top:"",bottom:"",left:"",right:"",margin:""}).css(j);return j},destroy:function(){g.tip&&g.tip.remove();g.tip=!1;z.unbind(".qtip-tip")}});l.init()}function ma(b){function a(){A=d(h,m).not("[disabled]").map(function(){return"function"===typeof this.focus?this:null})}function j(a){1>A.length&&a.length?a.not("body").blur():A.first().focus()}function r(a){var c=d(a.target),
b=c.closest(".qtip");!(1>b.length?f:parseInt(b[0].style.zIndex,10)>parseInt(m[0].style.zIndex,10))&&d(a.target).closest(P)[0]!==m[0]&&j(c)}var u=this,q=b.options.show.modal,l=b.elements,m=l.tooltip,g=".qtipmodal"+b.id,z=d(K.body),h=s.modal.focusable.join(","),A={},o;b.checks.modal={"^show.modal.(on|blur)$":function(){u.init();l.overlay.toggle(m.is(":visible"))},"^content.text$":function(){a()}};d.extend(u,{init:function(){if(!q.on)return u;o=u.create();m.attr("is-modal-qtip",i).css("z-index",s.modal.zindex+
d(P+"[is-modal-qtip]").length).unbind(".qtipmodal").unbind(g).bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(a,c,b){c=a.originalEvent;if(a.target===m[0])if(c&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(c.type)&&d(c.relatedTarget).closest(o[0]).length)try{a.preventDefault()}catch(g){}else if(!c||c&&!c.solo)u[a.type.replace("tooltip","")](a,b)}).bind("tooltipfocus.qtipmodal",function(a){if(!(a.isDefaultPrevented()||a.target!==m[0])){var c=d(P).filter("[is-modal-qtip]"),b=s.modal.zindex+
c.length,g=parseInt(m[0].style.zIndex,10);o[0].style.zIndex=b-2;c.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)});c.end().filter("."+W).qtip("blur",a.originalEvent);m.addClass(W)[0].style.zIndex=b;try{a.preventDefault()}catch(j){}}}).bind("tooltiphide.qtipmodal",function(a){a.target===m[0]&&d("[is-modal-qtip]").filter(":visible").not(m).last().qtip("focus",a)});q.escape&&d(K).unbind(g).bind("keydown"+g,function(a){27===a.keyCode&&m.hasClass(W)&&b.hide(a)});q.blur&&l.overlay.unbind(g).bind("click"+
g,function(a){m.hasClass(W)&&b.hide(a)});a();return u},create:function(){function a(){o.css({height:d(J).height(),width:d(J).width()})}var c=d("#qtip-overlay");if(c.length)return l.overlay=c.insertAfter(d(P).last());o=l.overlay=d("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return f}}).hide().insertAfter(d(P).last());d(J).unbind(".qtipmodal").bind("resize.qtipmodal",a);a();return o},toggle:function(a,c,b){if(a&&a.isDefaultPrevented())return u;var a=q.effect,h=c?"show":"hide",
l=o.is(":visible"),k=d("[is-modal-qtip]").filter(":visible").not(m);o||(o=u.create());if(o.is(":animated")&&l===c||!c&&k.length)return u;c?(o.css({left:0,top:0}),o.toggleClass("blurs",q.blur),q.stealfocus!==f&&(z.bind("focusin"+g,r),j(d("body :focus")))):z.unbind("focusin"+g);o.stop(i,f);if(d.isFunction(a))a.call(o,c);else if(a===f)o[h]();else o.fadeTo(parseInt(b,10)||90,c?1:0,function(){c||d(this).hide()});c||o.queue(function(a){o.css({left:"",top:""});a()});return u},show:function(a,c){return u.toggle(a,
i,c)},hide:function(a,c){return u.toggle(a,f,c)},destroy:function(){var a=o;a&&((a=1>d("[is-modal-qtip]").not(m).length)?(l.overlay.remove(),d(K).unbind(".qtipmodal")):l.overlay.unbind(".qtipmodal"+b.id),z.undelegate("*","focusin"+g));return m.removeAttr("is-modal-qtip").unbind(".qtipmodal")}});u.init()}function na(b){var a=this,j=b.elements,r=j.tooltip,f=".bgiframe-"+b.id;d.extend(a,{init:function(){j.bgiframe=d('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>');
j.bgiframe.appendTo(r);r.bind("tooltipmove"+f,a.adjust)},adjust:function(){var a=b.get("dimensions"),d=b.plugins.tip,f=j.tip,g;g=parseInt(r.css("border-left-width"),10)||0;g={left:-g,top:-g};d&&f&&(d="x"===d.corner.precedance?["width","left"]:["height","top"],g[d[1]]-=f[d[0]]());j.bgiframe.css(g).css(a)},destroy:function(){j.bgiframe.remove();r.unbind(f)}});a.init()}var i=!0,f=!1,C=null,U="x",S="y",X="width",$="height",H="top",L="left",R="bottom",Q="right",G="center",oa="flipinvert",V="shift",D,s,
T,ha={},F="ui-tooltip",fa="ui-widget",O="ui-state-disabled",P="div.qtip."+F,ia=F+"-default",W=F+"-focus",ja=F+"-hover",Y="oldtitle",da,ga;ga=d("<div/>",{id:"qtip-rcontainer"});d(function(){ga.appendTo(K.body)});D=d.fn.qtip=function(b,a,j){var r=(""+b).toLowerCase(),u=C,q=d.makeArray(arguments).slice(1),l=q[q.length-1],m=this[0]?d.data(this[0],"qtip"):C;if(!arguments.length&&m||"api"===r)return m;if("string"===typeof b)return this.each(function(){var b=d.data(this,"qtip");if(!b)return i;l&&l.timeStamp&&
(b.cache.event=l);if(("option"===r||"options"===r)&&a)if(d.isPlainObject(a)||j!==N)b.set(a,j);else return u=b.get(a),f;else b[r]&&b[r].apply(b[r],q)}),u!==C?u:this;if("object"===typeof b||!arguments.length)return m=ca(d.extend(i,{},b)),D.bind.call(this,m,l)};D.bind=function(b,a){return this.each(function(j){function r(a){function b(){g.render("object"===typeof a||u.show.ready);q.show.add(q.hide).unbind(m)}if(g.cache.disabled)return f;g.cache.event=d.extend({},a);g.cache.target=a?d(a.target):[N];0<
u.show.delay?(clearTimeout(g.timers.show),g.timers.show=setTimeout(b,u.show.delay),l.show!==l.hide&&q.hide.bind(l.hide,function(){clearTimeout(g.timers.show)})):b()}var u,q,l,m,g,j=d.isArray(b.id)?b.id[j]:b.id,j=!j||j===f||1>j.length||ha[j]?D.nextid++:ha[j]=j;m=".qtip-"+j+"-create";a:{var z,h,A,o,w,c=d(this),y=d(K.body),x=this===K?y:c;h=c.metadata?c.metadata(b.metadata):C;o="html5"===b.metadata.type&&h?h[b.metadata.name]:C;var p=c.data(b.metadata.name||"qtipopts");try{p="string"===typeof p?d.parseJSON(p):
p}catch(k){}o=d.extend(i,{},D.defaults,b,"object"===typeof p?ca(p):C,ca(o||h));h=o.position;o.id=j;if("boolean"===typeof o.content.text)if(A=c.attr(o.content.attr),o.content.attr!==f&&A)o.content.text=A;else{g=f;break a}h.container.length||(h.container=y);h.target===f&&(h.target=x);o.show.target===f&&(o.show.target=x);o.show.solo===i&&(o.show.solo=h.container.closest("body"));o.hide.target===f&&(o.hide.target=x);o.position.viewport===i&&(o.position.viewport=h.container);h.container=h.container.eq(0);
h.at=new s.Corner(h.at);h.my=new s.Corner(h.my);if(d.data(this,"qtip"))if(o.overwrite)c.qtip("destroy");else if(o.overwrite===f){g=f;break a}o.suppress&&(w=d.attr(this,"title"))&&d(this).removeAttr("title").attr(Y,w).attr("title","");z=new ea(c,o,j,!!A);d.data(this,"qtip",z);c.bind("remove.qtip-"+j+" removeqtip.qtip-"+j,function(){z.destroy()});g=z}if(g===f)return i;u=g.options;d.each(s,function(){"initialize"===this.initialize&&this(g)});q={show:u.show.target,hide:u.hide.target};l={show:d.trim(""+
u.show.event).replace(/ /g,m+" ")+m,hide:d.trim(""+u.hide.event).replace(/ /g,m+" ")+m};/mouse(over|enter)/i.test(l.show)&&!/mouse(out|leave)/i.test(l.hide)&&(l.hide+=" mouseleave"+m);q.show.bind("mousemove"+m,function(a){T={pageX:a.pageX,pageY:a.pageY,type:"mousemove"};g.cache.onTarget=i});q.show.bind(l.show,r);(u.show.ready||u.prerender)&&r(a)})};s=D.plugins={Corner:function(b){b=(""+b).replace(/([A-Z])/," $1").replace(/middle/gi,G).toLowerCase();this.x=(b.match(/left|right/i)||b.match(/center/)||
["inherit"])[0].toLowerCase();this.y=(b.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();b=b.charAt(0);this.precedance="t"===b||"b"===b?S:U;this.string=function(){return this.precedance===S?this.y+this.x:this.x+this.y};this.abbrev=function(){var a=this.x.substr(0,1),b=this.y.substr(0,1);return a===b?a:this.precedance===S?b+a:a+b};this.invertx=function(a){this.x=this.x===L?Q:this.x===Q?L:a||this.x};this.inverty=function(a){this.y=this.y===H?R:this.y===R?H:a||this.y};this.clone=function(){return{x:this.x,
y:this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:this.clone,invertx:this.invertx,inverty:this.inverty}}},offset:function(b,a){var j=b.offset(),f=b.closest("body")[0],i=a,q,l,m;if(i){do if("static"!==i.css("position")&&(l=i.position(),j.left-=l.left+(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("marginLeft"),10)||0),j.top-=l.top+(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("marginTop"),10)||0),!q&&"hidden"!==(m=i.css("overflow"))&&"visible"!==
m))q=i;while((i=d(i[0].offsetParent)).length);q&&q[0]!==f&&(f=q,j.left+=1*f.scrollLeft(),j.top+=1*f.scrollTop())}return j},iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||f,fn:{attr:function(b,a){if(this.length){var j=this[0],f=d.data(j,"qtip");if("title"===b&&f&&"object"===typeof f&&f.options.suppress){if(2>arguments.length)return d.attr(j,Y);f&&("title"===f.options.content.attr&&
f.cache.attr)&&f.set("content.text",a);return this.attr(Y,a)}}return d.fn.attr_replacedByqTip.apply(this,arguments)},clone:function(b){d([]);var a=d.fn.clone_replacedByqTip.apply(this,arguments);b||a.filter("["+Y+"]").attr("title",function(){return d.attr(this,Y)}).removeAttr(Y);return a}}};d.each(s.fn,function(b,a){if(!a||d.fn[b+"_replacedByqTip"])return i;var j=d.fn[b+"_replacedByqTip"]=d.fn[b];d.fn[b]=function(){return a.apply(this,arguments)||j.apply(this,arguments)}});d.ui||(d.cleanData_replacedByqTip=
d.cleanData,d.cleanData=function(b){for(var a=0,j;(j=b[a])!==N;a++)try{d(j).triggerHandler("removeqtip")}catch(f){}d.cleanData_replacedByqTip(b)});D.version="@VERSION";D.nextid=0;D.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");D.zindex=15E3;D.defaults={prerender:f,id:f,overwrite:i,suppress:i,content:{text:i,attr:"title",title:{text:f,button:f}},position:{my:"top left",at:"bottom right",target:f,container:f,viewport:f,adjust:{x:0,y:0,mouse:i,resize:i,
method:"flip flip"},effect:function(b,a){d(this).animate(a,{duration:200,queue:f})}},show:{target:f,event:"mouseenter",effect:i,delay:90,solo:f,ready:f,autofocus:f},hide:{target:f,event:"mouseleave",effect:i,delay:0,fixed:f,inactive:f,leave:"window",distance:f},style:{classes:"",widget:f,width:f,height:f,def:i},events:{render:C,move:C,show:C,hide:C,toggle:C,visible:C,hidden:C,focus:C,blur:C}};s.svg=function(b,a){for(var j=d(K),f=a[0],i={width:0,height:0,position:{top:1E10,left:1E10}},q,l,m;!f.getBBox;)f=
f.parentNode;if(f.getBBox&&f.parentNode){q=f.getBBox();l=f.getScreenCTM();f=f.farthestViewportElement||f;if(!f.createSVGPoint)return i;f=f.createSVGPoint();f.x=q.x;f.y=q.y;m=f.matrixTransform(l);i.position.left=m.x;i.position.top=m.y;f.x=f.x+q.width;f.y=f.y+q.height;m=f.matrixTransform(l);i.width=m.x-i.position.left;i.height=m.y-i.position.top;i.position.left=i.position.left+j.scrollLeft();i.position.top=i.position.top+j.scrollTop()}return i};s.ajax=function(b){var a=b.plugins.ajax;return"object"===
typeof a?a:b.plugins.ajax=new ka(b)};s.ajax.initialize="render";s.ajax.sanitize=function(b){var a=b.content;if(a&&"ajax"in a){a=a.ajax;if(typeof a!=="object")a=b.content.ajax={url:a};if("boolean"!==typeof a.once&&a.once)a.once=!!a.once}};d.extend(i,D.defaults,{content:{ajax:{loading:i,once:i}}});s.tip=function(b){var a=b.plugins.tip;return"object"===typeof a?a:b.plugins.tip=new la(b)};s.tip.initialize="render";s.tip.sanitize=function(b){var a=b.style;if(a&&"tip"in a){a=b.style.tip;if(typeof a!=="object")b.style.tip=
{corner:a};/string|boolean/i.test(typeof a.corner)||(a.corner=i);typeof a.width!=="number"&&delete a.width;typeof a.height!=="number"&&delete a.height;typeof a.border!=="number"&&a.border!==i&&delete a.border;typeof a.offset!=="number"&&delete a.offset}};d.extend(i,D.defaults,{style:{tip:{corner:i,mimic:f,width:6,height:6,border:i,offset:0}}});s.modal=function(b){var a=b.plugins.modal;return"object"===typeof a?a:b.plugins.modal=new ma(b)};s.modal.initialize="render";s.modal.sanitize=function(b){if(b.show)if(typeof b.show.modal!==
"object")b.show.modal={on:!!b.show.modal};else if(typeof b.show.modal.on==="undefined")b.show.modal.on=i};s.modal.zindex=D.zindex-200;s.modal.focusable="a[href] area[href] input select textarea button iframe object embed [tabindex] [contenteditable]".split(" ");d.extend(i,D.defaults,{show:{modal:{on:f,effect:i,blur:i,stealfocus:i,escape:i}}});s.viewport=function(b,a,d,f,i,q,l){function m(b,c,d,g,f,j,i,k,l){var m=a[f],n=h[b],o=A[b],r=d===V,q=-x.offset[f]+y.offset[f]+y["scroll"+f],s=n===f?l:n===j?-l:
-l/2,u=p&&p.size?p.size[i]||0:0,w=p&&p.corner&&p.corner.precedance===b&&!r?u:0,z=q-m+w,l=m+l-y[i]-q+w,k=s-(h.precedance===b||n===h[c]?o===f?k:o===j?-k:-k/2:0)-(o===G?k/2:0);if(r){w=p&&p.corner&&p.corner.precedance===c?u:0;k=(n===f?1:-1)*s-w;a[f]=a[f]+(z>0?z:l>0?-l:0);a[f]=Math.max(-x.offset[f]+y.offset[f]+(w&&p.corner[b]===G?p.offset:0),m-k,Math.min(Math.max(-x.offset[f]+y.offset[f]+y[i],m+k),a[f]))}else{g=g*(d===oa?2:0);if(z>0&&(n!==f||l>0)){a[f]=a[f]-(k+g);t["invert"+b](f)}else if(l>0&&(n!==j||
z>0)){a[f]=a[f]-((n===G?-k:k)+g);t["invert"+b](j)}if(a[f]<q&&-a[f]>l){a[f]=m;t=h.clone()}}return a[f]-m}var g=d.target,s=b.elements.tooltip,h=d.my,A=d.at,o=d.adjust,w=o.method.split(" "),c=w[0],w=w[1]||w[0],y=d.viewport,x=d.container,d=b.cache,p=b.plugins.tip,k={left:0,top:0},t,n;if(!y.jquery||g[0]===J||g[0]===K.body||o.method==="none")return k;g=s.css("position")==="fixed";y={elem:y,height:y[(y[0]===J?"h":"outerH")+"eight"](),width:y[(y[0]===J?"w":"outerW")+"idth"](),scrollleft:g?0:y.scrollLeft(),
scrolltop:g?0:y.scrollTop(),offset:y.offset()||{left:0,top:0}};x={elem:x,scrollLeft:x.scrollLeft(),scrollTop:x.scrollTop(),offset:x.offset()||{left:0,top:0}};if(c!=="shift"||w!=="shift")t=h.clone();k={left:c!=="none"?m(U,S,c,o.x,L,Q,X,f,q):0,top:w!=="none"?m(S,U,w,o.y,H,R,$,i,l):0};if(t&&d.lastClass!==(n=F+"-pos-"+t.abbrev()))s.removeClass(b.cache.lastClass).addClass(b.cache.lastClass=n);return k};s.imagemap=function(b,a,f,i){function s(a,b,d){for(var f=0,g=1,h=1,i=0,j=0,l=a.width,e=a.height;l>0&&
e>0&&g>0&&h>0;){l=Math.floor(l/2);e=Math.floor(e/2);g=d.x===L?l:d.x===Q?a.width-l:g+Math.floor(l/2);h=d.y===H?e:d.y===R?a.height-e:h+Math.floor(e/2);for(f=b.length;f--;){if(b.length<2)break;i=b[f][0]-a.position.left;j=b[f][1]-a.position.top;(d.x===L&&i>=g||d.x===Q&&i<=g||d.x===G&&(i<g||i>a.width-g)||d.y===H&&j>=h||d.y===R&&j<=h||d.y===G&&(j<h||j>a.height-h))&&b.splice(f,1)}}return{left:b[0][0],top:b[0][1]}}a.jquery||(a=d(a));var b=b.cache.areas={},q=(a[0].shape||a.attr("shape")).toLowerCase(),l=a[0].coords||
a.attr("coords"),m=l.split(","),g=[],a=d('img[usemap="#'+a.parent("map").attr("name")+'"]'),z=a.offset(),h={width:0,height:0,position:{top:1E10,right:0,bottom:0,left:1E10}},A=0,o=0;z.left=z.left+Math.ceil((a.outerWidth()-a.width())/2);z.top=z.top+Math.ceil((a.outerHeight()-a.height())/2);if(q==="poly")for(A=m.length;A--;){o=[parseInt(m[--A],10),parseInt(m[A+1],10)];if(o[0]>h.position.right)h.position.right=o[0];if(o[0]<h.position.left)h.position.left=o[0];if(o[1]>h.position.bottom)h.position.bottom=
o[1];if(o[1]<h.position.top)h.position.top=o[1];g.push(o)}else for(A=-1;A++<m.length;)g.push(parseInt(m[A],10));switch(q){case "rect":h={width:Math.abs(g[2]-g[0]),height:Math.abs(g[3]-g[1]),position:{left:Math.min(g[0],g[2]),top:Math.min(g[1],g[3])}};break;case "circle":h={width:g[2]+2,height:g[2]+2,position:{left:g[0],top:g[1]}};break;case "poly":h.width=Math.abs(h.position.right-h.position.left);h.height=Math.abs(h.position.bottom-h.position.top);if(f.abbrev()==="c")h.position={left:h.position.left+
h.width/2,top:h.position.top+h.height/2};else{if(!b[f+l]){h.position=s(h,g.slice(),f);if(i&&(i[0]==="flip"||i[1]==="flip")){h.offset=s(h,g.slice(),{x:f.x===L?Q:f.x===Q?L:G,y:f.y===H?R:f.y===R?H:G});h.offset.left=h.offset.left-h.position.left;h.offset.top=h.offset.top-h.position.top}b[f+l]=h}h=b[f+l]}h.width=h.height=0}h.position.left=h.position.left+z.left;h.position.top=h.position.top+z.top;return h};s.bgiframe=function(b){var a=d.browser,i=b.plugins.bgiframe;return d("select, object").length<1||
!(a.msie&&(""+a.version).charAt(0)==="6")?f:"object"===typeof i?i:b.plugins.bgiframe=new na(b)};s.bgiframe.initialize="render"};"function"===typeof define&&define.amd?define(["jquery"],ea):jQuery&&!jQuery.fn.qtip&&ea(jQuery)})(window,document);