This repository has been archived by the owner on Jun 14, 2020. It is now read-only.
/
jquery.qtip.min.js
84 lines (82 loc) · 33.1 KB
/
jquery.qtip.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* qTip2 - Pretty pwoerful tooltips
* http://craigsworks.com/projects/qtip2/
*
* Version: 2.0.0pre
* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Dec 13 21:52:07 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,L){function M(c){var b;if(!c)return FALSE;if("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};b=c.content.text||FALSE;if(!a.isFunction(b)&&(!b&&!b.attr||b.length<1||"object"===typeof b&&!b.jquery))b=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};a.each(a.fn.qtip.plugins,
function(){this.sanitize&&this.sanitize(c)});return c}function O(c,b,k){function h(d){var f,i=d.split("."),l=b[i[0]];for(d=1;d<i.length;d+=1){f=l[i[d]];if(typeof f==="object"&&!f.jquery&&!f.precedance)l=l[i[d]];else break}return i[d]!==L?[l,i[d]]:[b,i[0]]}function p(d,f){var i={left:0,top:0},l=!a.fn.qtip.plugins.iOS,g,q;if(f){i=p(f);i.left*=-1;i.top*=-1}if(d.offsetParent){do{g=d.offsetParent;q=g===f;i.left+=d.offsetLeft-(l&&g&&!q?g.scrollLeft:0);i.top+=d.offsetTop-(l&&g&&!q?g.scrollTop:0)}while(d=
g)}return i}function m(d,f){var i=e.elements.tooltip,l=j+"-accessible "+(f?j+"-accessible-fluid":""),g=!i.is(":visible"),q=FALSE;if(!e.rendered)return FALSE;g&&i.addClass(l);switch(d){case "dimensions":q={height:i.outerHeight(),width:i.outerWidth()};break;case "position":q=p(i[0],b.position.container);break}g&&i.removeClass(l);return q}function s(){var d=e.elements;if(d.title){d.titlebar.remove();d.titlebar=d.title=d.button=NULL;d.tooltip.removeAttr("aria-labelledby")}}function x(){var d=e.elements,
f=b.content.title.button;d.button&&d.button.remove();d.button=f.jquery?f:"string"===typeof f?a("<a />",{html:f}):a("<a />",{"class":"ui-state-default",text:"Close tooltip",title:"Close tooltip",css:{"text-indent":"-10000em"}}).prepend(a("<span />",{"class":(b.style.widget?"ui":j)+"-icon ui-icon-close"}));d.button.prependTo(d.titlebar).attr("role","button").addClass(j+"-close").hover(function(i){a(this).toggleClass("ui-state-hover",i.type==="mouseenter")}).click(function(){d.tooltip.hasClass("ui-state-disabled")||
e.hide();return FALSE}).bind("mousedown keydown mouseup keyup mouseout",function(i){a(this).toggleClass("ui-state-active ui-state-focus",/down$/i.test(i.type))});e.redraw()}function o(){var d=e.elements;d.titlebar&&s();d.titlebar=a("<div />",{"class":j+"-titlebar "+(b.style.widget?"ui-widget-header":"")}).append(d.title=a("<div />",{id:j+"-"+k+"-title","class":j+"-title",html:b.content.title.text})).prependTo(d.wrapper);if(b.content.title.button)x();else e.rendered===TRUE&&e.redraw()}function A(d){var f=
e.elements;if(!e.rendered||!d)return FALSE;if(a.isFunction(d))d=d.call(c);d.jquery&&d.length>0?f.content.empty().append(d.css({display:"block"})):f.content.html(d);f.tooltip.queue("fx",function(i){function l(q){g=g.not(q);if(g.length===0){e.redraw();e.rendered===TRUE&&e.reposition(e.cache.event);i()}}var g=a("img:not([height]):not([width])",e.elements.content);g.each(function(q,y){var C=["abort","error","load","unload",""].join(".qtip-image ");a(this).bind(C,function(){clearTimeout(e.timers.img[q]);
l(this)});(function w(){if(y.height)return l(y);e.timers.img[q]=setTimeout(w,20)})();return TRUE});g.length===0&&l(g)});return e}function B(d,f,i,l){function g(v){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;r.show.trigger("qtip-"+k+"-inactive");clearTimeout(e.timers.show);clearTimeout(e.timers.hide);var u=function(){e.show(v)};if(b.show.delay>0)e.timers.show=setTimeout(u,b.show.delay);else u()}function q(v){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;var u=a(v.relatedTarget||
v.target).parents(n)[0]===r.tooltip[0],I=a(v.relatedTarget||v.target)[0]===r.show[0];clearTimeout(e.timers.show);clearTimeout(e.timers.hide);if(b.hide.fixed&&(t.target==="mouse"&&u||/mouse(out|leave|move)/.test(v.type)&&(u||I))){v.stopPropagation();v.preventDefault();return FALSE}r.tooltip.stop(1,1);if(b.hide.delay>0)e.timers.hide=setTimeout(function(){e.hide(v)},b.hide.delay);else e.hide(v)}function y(v){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;clearTimeout(e.timers.inactive);e.timers.inactive=
setTimeout(function(){e.hide(v)},b.hide.inactive)}function C(v){if(!e.cache.processing){e.cache.processing=1;e.elements.tooltip.is(":visible")&&e.reposition(v);e.cache.processing=0}}var w=".qtip-"+k,t=b.position,r={show:b.show.target,hide:b.hide.target,tooltip:e.elements.tooltip,container:t.container[0]===document.body?document:t.container},F={show:String(b.show.event).split(" "),hide:String(b.hide.event).split(" ")},J=a.browser.msie&&parseInt(a.browser.version,10)===6;c.bind("remove.qtip",function(){e.destroy()});
if(i&&b.hide.fixed){r.hide=r.hide.add(r.tooltip);r.tooltip.bind("mouseover"+w,function(){r.tooltip.hasClass("ui-state-disabled")||clearTimeout(e.timers.hide)})}if(f){if("number"===typeof b.hide.inactive){r.show.bind("qtip-"+k+"-inactive",y);a.each(a.fn.qtip.inactiveEvents,function(v,u){r.hide.add(e.elements.tooltip).bind(u+w+"-inactive",y)})}a.each(F.hide,function(v,u){var I=a.inArray(u,F.show);if(I>-1&&a(r.hide).add(r.show).length===a(r.hide).length||u==="unfocus"){r.show.bind(u+w,function(D){r.tooltip.is(":visible")?
q(D):g(D)});delete F.show[I]}else r.hide.bind(u+w,q)})}if(d){a.each(F.show,function(v,u){r.show.bind(u+w,g)});r.tooltip.bind("mouseover"+w,function(){e.focus()})}if(l){if(t.adjust.resize||t.adjust.screen)a(a.event.special.resize?r.container:E).bind("resize"+w,C);if(t.adjust.screen||J&&r.tooltip.css("position")==="fixed")a(r.container).bind("scroll"+w,C);/unfocus/i.test(b.hide.event)&&a(document).bind("mousedown"+w,function(v){var u=e.elements.tooltip;a(v.target).parents(n).length===0&&a(v.target).add(c).length>
1&&u.is(":visible")&&!u.hasClass("ui-state-disabled")&&e.hide()});t.target==="mouse"&&a(document).bind("mousemove"+w,function(v){if(t.adjust.mouse&&!r.tooltip.hasClass("ui-state-disabled")&&r.tooltip.is(":visible"))e.reposition(v||a.fn.qtip.mouse)})}}function z(d,f,i,l){l=parseInt(l,10)!==0;var g=".qtip-"+k;f={show:d?b.show.target:NULL,hide:f?b.hide.target:NULL,tooltip:i?e.elements.tooltip:NULL,content:i?e.elements.content:NULL,container:l?b.position.container[0]===document.body?document:b.position.container:
NULL,window:l?E:NULL};if(e.rendered)a([]).pushStack(a.grep([f.show,f.hide,f.tooltip,f.container,f.content,f.window],function(){return this!==null})).unbind(g);else d&&f.show.unbind(g+"-create")}var e=this,j="ui-tooltip",n=".qtip."+j;e.id=k;e.rendered=FALSE;e.elements={target:c};e.cache={event:{},target:NULL,disabled:FALSE,position:NULL};e.timers={img:[]};e.options=b;e.plugins={};a.extend(e,{render:function(d){var f=e.elements,i=a.Event("tooltiprender");if(e.rendered)return FALSE;e.rendered=d?-2:-1;
f.tooltip=a("<div/>").attr({id:j+"-"+k,role:"tooltip","class":j+" qtip ui-tooltip-accessible ui-helper-reset "+b.style.classes}).css("z-index",a.fn.qtip.zindex+a(n).length).toggleClass("ui-widget",b.style.widget).toggleClass("ui-state-disabled",e.cache.disabled).data("qtip",e).appendTo(b.position.container);f.wrapper=a("<div />",{"class":j+"-wrapper"}).appendTo(f.tooltip);f.content=a("<div />",{"class":j+"-content "+(b.style.widget?"ui-widget-content":""),id:j+"-"+k+"-content"}).appendTo(f.wrapper);
b.content.title.text&&o();A(b.content.text);a.each(a.fn.qtip.plugins,function(){this.initialize==="render"&&this(e)});e.rendered=TRUE;B(1,1,1,1);a.each(b.events,function(l,g){g&&f.tooltip.bind("tooltip"+l,g)});f.tooltip.queue("fx",function(l){f.tooltip.removeClass("ui-tooltip-accessible");i.originalEvent=e.cache.event;f.tooltip.trigger(i,[e]);if(b.show.ready||d){f.tooltip.hide();e.show(e.cache.event)}l()});return e},get:function(d){switch(d.toLowerCase()){case "offset":d=m("position");break;case "dimensions":d=
m("dimensions");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,f){d=d.toLowerCase();var i=h(d),l=e.elements,g=l.tooltip,q,y,C,w={builtin:{id:function(){var t=f===TRUE?a.fn.qtip.nextid:f,r=j+"-"+t;if(t!==FALSE&&t.length>0&&!a("#ui-tooltip-"+t).length){g[0].id=r;l.content[0].id=r+"-content";l.title[0].id=r+"-title"}},"^content.text":function(){A(f)},"^content.title.text":function(){if(e.rendered)if(!e.elements.title&&f){o();
e.reposition()}else f?e.elements.title.html(f):s()},"^content.title.button":function(){var t=e.elements.button,r=e.elements.title;if(e.rendered)if(f){r||o();x()}else t.remove()},"^position.(my|at)$":function(){var t=/my$/i.test(d)?"my":"at";if("string"===typeof f)b.position[t]=new a.fn.qtip.plugins.Corner(f)},"^position.(my|at|adjust|target)":function(){e.rendered&&e.reposition()},"^position.container$":function(){if(e.rendered===TRUE){g.appendTo(f);e.reposition()}},"^(show|hide).(event|target|fixed|delay|inactive)":function(t,
r,F,J){var v=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(v[0])t[r]=J;z.apply(e,v[1]);if(v[0])t[r]=F;B.apply(e,v[1])},"^show.ready$":function(){e.rendered===FALSE&&e.show()},"^style.classes$":function(){e.elements.tooltip.attr("class",j+" qtip ui-helper-reset "+f)},"^style.widget$":function(){var t=!!f;g.toggleClass("ui-widget",t);l.titlebar.toggleClass("ui-widget-header",t);l.content.toggleClass("ui-widget-content",t);l.button.children("span").toggleClass(j+
"-icon",!t).toggleClass("ui-icon",t)},"^events.(render|show|move|hide|focus|blur)":function(t,r,F){l.tooltip[(a.isFunction(f)?"":"un")+"bind"]("tooltip"+r,F)}}};a.each(e.plugins,function(t){if("object"===typeof this.checks)w[t]=this.checks});q=i[0][i[1]];i[0][i[1]]=f.nodeType?a(f):f;M(b);for(y in w)for(C in w[y])RegExp(C,"i").test(d)&&w[y][C].call(e,i[0],i[1],f,q);return e},toggle:function(d,f){function i(){var C=a(this),w=d?"attr":"removeAttr",t=/^1|0$/.test(C.css("opacity")),r=this.style;e.elements.title&&
c[w]("aria-labelledby",j+"-"+k+"-title");c[w]("aria-describedby",j+"-"+k+"-content");if(d){if(a.browser.msie&&r&&t){r.removeAttribute("filter");r.removeAttribute("opacity")}}else t&&C.hide()}if(e.rendered===FALSE)return FALSE;var l=d?"show":"hide",g=e.elements.tooltip,q=b[l],y=g.is(":visible");if((typeof d).search("boolean|number"))d=!g.is(":visible");if(!y&&!d||g.is(":animated"))return e;if(f){if(/over|enter/.test(f.type)&&/out|leave/.test(e.cache.event.type)&&f.target===b.show.target[0]&&g.has(f.relatedTarget).length)return e;
e.cache.event=a.extend({},f)}y=a.Event("tooltip"+l);y.originalEvent=f?e.cache.event:NULL;g.trigger(y,[e,90]);if(y.isDefaultPrevented())return e;if(d){e.focus();e.reposition(f);q.solo&&a(n).qtip("hide")}else clearTimeout(e.timers.show);g.attr("aria-hidden",Boolean(!d));g.stop(1,1);if(a.isFunction(q.effect)){q.effect.call(g,e);g.queue(function(){i.call(this);a(this).dequeue()})}else if(q.effect===FALSE){g[l]();i.call(g)}else g.fadeTo(90,d?1:0,i);d&&q.target.trigger("qtip-"+k+"-inactive");return e},
show:function(d){e.toggle(TRUE,d)},hide:function(d){e.toggle(FALSE,d)},focus:function(d){if(e.rendered===FALSE)return FALSE;var f=e.elements.tooltip,i=a(n),l=parseInt(f[0].style.zIndex,10),g=a.fn.qtip.zindex+i.length,q=j+"-focus",y=a.extend({},d);if(!f.hasClass(q)&&l!==g){i.each(function(){this.style.zIndex-=1});a(n+"."+q).each(function(){var C=a(this),w=C.qtip(),t;if(!w||w.rendered===FALSE)return TRUE;C.removeClass(q);t=a.Event("tooltipblur");t.originalEvent=y;C.trigger(t,[w,g])});d=a.Event("tooltipfocus");
d.originalEvent=y;f.trigger(d,[e,g]);if(!d.isDefaultPrevented())f.addClass(q)[0].style.zIndex=g}return e},reposition:function(d){if(e.rendered===FALSE)return FALSE;var f=b.position.target,i=e.elements.tooltip,l=b.position,g=l.my,q=l.at,y=l.adjust,C=e.elements.tooltip.width(),w=e.elements.tooltip.height(),t=0,r=0,F=a.Event("tooltipmove"),J=i.css("position")==="fixed",v=l.container[0]!==document.body?l.container:a(E),u={left:0,top:0},I={left:function(D){var G=v.scrollLeft,H=q.x==="left"?t:q.x==="right"?
-t:-t/2,K=G-D;G=D+C-v.width-G;H=(g.x==="left"?C:g.x==="right"?-C:-C/2)-(g.x===g.y?1:-2)*y.x-(g.precedance==="x"||g.x===g.y?H:0);if(K>0&&(g.x!=="left"||G>0))u.left-=H;else if(G>0&&(g.x!=="right"||K>0))u.left-=(g.x==="center"?-1:1)*H;if(u.left<0)u.left=D;return u.left-D},top:function(D){var G=v.scrollTop,H=q.y==="top"?r:q.y==="bottom"?-r:-r/2,K=G-D;G=D+w-v.height-G+y.y;H=(g.y==="top"?w:g.y==="bottom"?-w:-w/2)-(g.y===g.x?1:-2)*y.y-(g.precedance==="y"||g.x===g.y?H:0);if(K>0&&(g.y!=="top"||G>0))u.top-=
H;else if(G>0&&(g.y!=="bottom"||K>0))u.top-=(g.y==="center"?-1:1)*H;if(u.top<0)u.top=D;return u.top-D}};v={elem:v,height:v[(v[0]===E?"h":"outerH")+"eight"](),width:v[(v[0]===E?"w":"outerW")+"idth"](),scrollLeft:v.scrollLeft(),scrollTop:v.scrollTop()};if(f==="mouse"){q={x:"left",y:"top"};d=d&&(d.type==="resize"||d.type==="scroll")?e.cache.event:y.mouse||!d||!d.pageX?a.extend({},a.fn.qtip.mouse):d;u={top:d.pageY,left:d.pageX}}else{if(f==="event")f=d&&d.target&&d.type!=="scroll"&&d.type!=="resize"?e.cache.target=
a(d.target):e.cache.target;f=a(f).eq(0);if(f.length===0)return e;else if(f[0]===document||f[0]===E){t=f.width();r=f.height();if(f[0]===E)u={top:J?0:v.scrollTop,left:J?0:v.scrollLeft}}else if(f.is("area")&&a.fn.qtip.plugins.imagemap){u=a.fn.qtip.plugins.imagemap(f,q);t=u.width;r=u.height;u=u.offset}else{t=f.outerWidth();r=f.outerHeight();u=p(f[0],l.container[0])}u.left+=q.x==="right"?t:q.x==="center"?t/2:0;u.top+=q.y==="bottom"?r:q.y==="center"?r/2:0}u.left+=y.x+(g.x==="right"?-C:g.x==="center"?-C/
2:0);u.top+=y.y+(g.y==="bottom"?-w:g.y==="center"?-w/2:0);u.adjusted=y.screen&&f[0]!==E&&f[0]!==document.body?{left:I.left(u.left),top:I.top(u.top)}:{left:0,top:0};i.attr("class",function(){return a(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(j+"-pos-"+g.abbreviation());F.originalEvent=a.extend({},d);i.trigger(F,[e,u,v.elem]);if(F.isDefaultPrevented())return e;delete u.adjusted;if(i.is(":visible")&&a.isFunction(l.effect)){l.effect.call(i,e,u);i.queue(function(){var D=a(this);
D.css({opacity:"",height:""});a.browser.msie&&this.style&&this.style.removeAttribute("filter");D.dequeue()})}else isNaN(u.left,u.top)||i.css(u);return e},redraw:function(){if(!e.rendered||!(a.browser.msie&&parseInt(a.browser.version.charAt(0),10)<9))return FALSE;var d=e.elements.tooltip;d.attr("style");var f;d.css({width:"auto",height:"auto"});f=m("dimensions",1);a.each(["width","height"],function(i,l){var g=parseInt(d.css("max-"+l),10)||0,q=parseInt(d.css("min-"+l),10)||0;f[l]=g+q?Math.min(Math.max(f[l],
q),g):f[l]});d.css(f)},disable:function(d){var f=e.elements.tooltip;if(e.rendered)f.toggleClass("ui-state-disabled",d);else e.cache.disabled=!!d;return e},destroy:function(){var d=e.elements,f=d.target.data("oldtitle");e.rendered&&a.each(e.plugins,function(){this.initialize==="render"&&this.destroy()});z(1,1,1,1);c.removeData("qtip");e.rendered&&d.tooltip.remove();f&&c.attr("title",f);c.removeAttr("aria-describedby");return c}})}function P(c,b){var k,h,p=a(this);k=a(document.body);var m=this===document?
k:p;h=p.metadata?p.metadata(b.metadata):NULL;var s=a.extend(TRUE,{},a.fn.qtip.defaults,b,M((h&&b.metadata.type==="html5"?h[b.metadata.name]:NULL)||h));p.removeData("metadata");h=s.position;if("boolean"===typeof s.content.text)if(s.content.attr!==FALSE&&p.attr(s.content.attr))s.content.text=p.attr(s.content.attr);else return FALSE;if(h.container===FALSE)h.container=k;if(h.target===FALSE)h.target=m;if(s.show.target===FALSE)s.show.target=m;if(s.hide.target===FALSE)s.hide.target=m;h.at=new a.fn.qtip.plugins.Corner(h.at);
h.my=new a.fn.qtip.plugins.Corner(h.my);if(p.data("qtip"))if(s.overwrite)p.qtip("destroy");else if(s.overwrite===FALSE)return FALSE;p.attr("title")&&p.data("oldtitle",p.attr("title")).removeAttr("title");k=new O(p,s,c);p.data("qtip",k);return k}function Q(c){var b=this;b.checks={"^content.ajax":function(){this.plugins.ajax.load(this.options.content.ajax)}};a.extend(b,{init:function(){var k=c.options.content.ajax;c.elements.tooltip.bind("tooltiprender.ajax",function(){b.load(k);c.elements.tooltip.bind("tooltipshow.ajax",
function(){k.once===FALSE&&c.rendered===TRUE&&b.load(k)})})},load:function(k){a.ajax(a.extend(TRUE,{},k,{success:function(h,p){if(a.isFunction(k.success))if(k.success.call(c,h,p)===FALSE)return;c.set("content.text",h)},error:function(h,p,m){var s=p||m;if(a.isFunction(k.error)){h=k.error.call(c,h,p,m);if(h===FALSE)return}c.set("content.text",s)}}));return b},destroy:function(){c.elements.tooltip.unbind("tooltipshow.ajax")}});b.init()}function N(c,b,k){var h=Math.floor(b/2),p=Math.floor(k/2);b={bottomright:[[0,
0],[b,k],[b,0]],bottomleft:[[0,0],[b,0],[0,k]],topright:[[0,k],[b,0],[b,k]],topleft:[[0,0],[0,k],[b,k]],topcenter:[[0,k],[h,0],[b,k]],bottomcenter:[[0,0],[b,0],[h,k]],rightcenter:[[0,0],[b,p],[0,k]],leftcenter:[[b,0],[b,k],[0,p]]};b.lefttop=b.bottomright;b.righttop=b.bottomleft;b.leftbottom=b.topright;b.rightbottom=b.topleft;return b[c]}function R(c){function b(j){var n=m.tip,d=["left","right"],f=p.offset,i,l;if(p.corner===FALSE||!n)return FALSE;j=j||h.corner;i=j.precedance;l=i==="y"?"x":"y";d[i===
"y"?"push":"unshift"]("top","bottom");f=Math.max(j[l]==="center"?f:0,f);n.css({top:"",bottom:"",left:"",right:"",margin:""});switch(j[i==="y"?"x":"y"]){case "center":n.css(d[0],"50%").css("margin-"+d[0],-Math.floor(A[i==="y"?"width":"height"]/2)+f);break;case d[0]:n.css(d[0],f);break;case d[1]:n.css(d[1],f);break}f=A[i==="x"?"width":"height"];if(z){s.toggleClass("ui-tooltip-accessible",!s.is(":visible"));f-=parseInt(x.css("border-"+j[i]+"-width"),10)||0;s.removeClass("ui-tooltip-accessible")}if(e===
"vml"&&/bottom|right/.test(j[j.precedance]))f+=z?1:-1;n.css(j[i],-f)}function k(j,n,d){if(m.tip){j=a.extend({},h.corner);n=j.precedance==="y"?["y","top","left","height","x"]:["x","left","top","width","y"];var f=d.adjusted,i=[0,0];if(h.corner.fixed!==TRUE){if(f.left)j.x=j.x==="center"?f.left>0?"left":"right":j.x==="left"?"right":"left";if(f.top)j.y=j.y==="center"?f.top>0?"top":"bottom":j.y==="top"?"bottom":"top";if(j.string()!==o.corner.string()&&(o.top!==f.top||o.left!==f.left))h.update(j)}i[0]=z?
parseInt(x.css("border-"+j[n[0]]+"-width"),10)||0:e==="vml"?1:0;i[1]=Math.max(j[n[4]]==="center"?p.offset:0,p.offset);d[n[1]]+=(j[n[0]]===n[1]?1:-1)*(A[n[3]]-i[0]);d[n[2]]-=(j[n[4]]===n[2]||j[n[4]]==="center"?1:-1)*i[1];o.left=f.left;o.top=f.top;o.corner=j}}var h=this,p=c.options.style.tip,m=c.elements,s=m.tooltip,x=m.wrapper,o={top:0,left:0,corner:{string:function(){}}},A={width:p.width,height:p.height},B={},z=p.border||0,e=p.method||FALSE;h.corner=NULL;h.mimic=NULL;h.checks={"^position.my|style.tip.(corner|mimic|method|border)":function(){z=
p.border;if(h.init())this.get("position.target")!=="mouse"&&this.reposition();else h.destroy()},"^style.tip.(height|width)":function(){A={width:p.width,height:p.height};h.create();h.update();c.reposition()},"^style.(classes|widget)$":function(){h.detectColours();h.update()}};a.extend(h,{init:function(){var j=a.browser.msie,n=h.detectCorner(),d=h[h.mimic?"mimic":"corner"].string().indexOf("center")>-1;if(n){if(e===TRUE)e=a("<canvas />")[0].getContext?"canvas":j&&(d||A.height!==A.width)?"vml":"polygon";
else if(e==="canvas")e=j?"vml":!a("<canvas />")[0].getContext?"polygon":"canvas";else if(e==="polygon")e=j&&d?"vml":e;h.create();h.detectColours();h.update();s.unbind(".qtip-tip").bind("tooltipmove.qtip-tip",k)}return n},detectCorner:function(){var j=p.corner,n=c.options.position.at,d=c.options.position.my;if(d.string)d=d.string();if(j===FALSE||d===FALSE&&n===FALSE)return FALSE;else if(j===TRUE)h.corner=new a.fn.qtip.plugins.Corner(d);else if(!j.string){h.corner=new a.fn.qtip.plugins.Corner(j);h.corner.fixed=
TRUE}return h.corner.string()!=="centercenter"},detectColours:function(){var j=m.tip,n=h.corner,d=h.corner[h.corner.precedance],f="border-"+d+"-color",i=/rgba?\(0, 0, 0(, 0)?\)|transparent/i,l=m.titlebar&&n.y==="top",g=c.options.style.widget;n=g?m.content:l?m.titlebar:m.wrapper;l=!g?m.wrapper:l?m.titlebar:m.content;B.fill=j.css({backgroundColor:"",border:""}).css("background-color")||"transparent";B.border=j.get(0).style?j.get(0).style["border"+d.charAt(0)+d.substr(1)+"Color"]:j.css(f)||"transparent";
if(i.test(B.fill))B.fill=z?n.css("background-color"):l.css(f);if(!B.border||i.test(B.border))B.border=l.css(f)||B.fill;a("*",j).add(j).css("background-color","transparent").css("border",0)},create:function(){var j=A.width,n=A.height;m.tip&&m.tip.remove();m.tip=a('<div class="ui-tooltip-tip" />').toggleClass("ui-widget-content",c.options.style.widget).css(A).prependTo(s);switch(e){case "canvas":a('<canvas height="'+n+'" width="'+j+'" />').appendTo(m.tip)[0].getContext("2d").save();break;case "vml":m.tip.html('<vml:shape coordorigin="0 0" coordsize="'+
j+" "+n+'" stroked="'+!!z+'" style="behavior:url(#default#VML); display:inline-block; antialias:TRUE; position: absolute; top:0; left:0; width:'+j+"px; height:"+n+"px; vertical-align:"+h.corner.y+';"><vml:stroke weight="'+(z-2)+'px" joinstyle="miter" miterlimit="10" style="behavior:url(#default#VML); display:inline-block;" /></vml:shape>');break;case "polygon":m.tip.append('<div class="ui-tooltip-tip-inner" />').append(z?'<div class="ui-tooltip-tip-border" />':"");break}return h},update:function(j){var n=
m.tip,d=A.width,f=A.height,i=z>0?0:1,l=Math.ceil(z/2+0.5),g=p.mimic,q,y;if(!j)j=h.corner;if(g===FALSE)g=j;else{g=new a.fn.qtip.plugins.Corner(g);g.precedance=j.precedance;if(g.x==="inherit")g.x=j.x;else if(g.y==="inherit")g.y=j.y;else if(g.x===g.y)g[j.precedance]=j[j.precedance]}y=Math[/b|r/.test(g[g.precedance==="y"?"x":"y"])?"ceil":"floor"];n=n.children();switch(e){case "canvas":n=n.get(0).getContext("2d");n.restore&&n.restore();n.clearRect(0,0,3E3,3E3);for(q=N(g.string(),d,f);i<2;i++){if(i){n.save();
n.translate(y((g.x==="left"?1:g.x==="right"?-1:0)*(z+1)*(g.precedance==="y"?0.5:1)),y((g.y==="top"?1:g.y==="bottom"?-1:0)*(z+1)*(g.precedance==="x"?0.5:1)))}n.beginPath();n.moveTo(q[0][0],q[0][1]);n.lineTo(q[1][0],q[1][1]);n.lineTo(q[2][0],q[2][1]);n.closePath();n.fillStyle=B[i?"fill":"border"];n.fill()}break;case "vml":q=N(g.string(),d,f);i="m"+q[0][0]+","+q[0][1]+" l"+q[1][0]+","+q[1][1]+" "+q[2][0]+","+q[2][1]+" xe";n.attr({path:i,fillcolor:B.fill});if(z){n.children().attr("color",B.border);if(g.precedance===
"y"){n.css("top",(g.y==="top"?1:-1)*(z-2));n.css("left",g.x==="left"?1:-2)}else{n.css("left",(g.x==="left"?1:-1)*(z-2));n.css("top",g.y==="top"?1:-2)}}break;case "polygon":if(g.precedance==="y"){i=d>f?1.5:d<f?5:2.2;l=[g.x==="left"?l:g.x==="right"?-l:0,Math.floor(i*l*(g.y==="bottom"?-1:1)*(g.x==="center"?0.8:1))]}else{i=d<f?1.5:d>f?5:2.2;l=[Math.floor(i*l*(g.x==="right"?-1:1)*(g.y==="center"?0.9:1)),g.y==="top"?l:g.y==="bottom"?-l:0]}n.removeAttr("style").each(function(C){var w={x:g.precedance==="x"?
g.x==="left"?"right":"left":g.x,y:g.precedance==="y"?g.y==="top"?"bottom":"top":g.y},t=g.x==="center"?["left","right",w.y,f,d]:["top","bottom",w.x,d,f],r=B[!C&&z?"border":"fill"];C&&a(this).css({position:"absolute","z-index":1,left:l[0],top:l[1]});g.x==="center"||g.y==="center"?a(this).css("border-"+t[2],t[3]+"px solid "+r).css("border-"+t[0],Math.floor(t[4]/2)+"px dashed transparent").css("border-"+t[1],Math.floor(t[4]/2)+"px dashed transparent"):a(this).css("border-width",Math.floor(f/2)+"px "+
Math.floor(d/2)+"px").css("border-"+w.x,Math.floor(d/2)+"px solid "+r).css("border-"+w.y,Math.floor(f/2)+"px solid "+r)});break}b(j);return h},destroy:function(){m.tip&&m.tip.remove();s.unbind(".qtip-tip")}})}function S(c,b){var k=this,h=c.elements,p=h.tooltip;h.overlay=a("#qtip-overlay");a.extend(k,{init:function(){p.bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(m,s,x){m=m.type.replace("tooltip","");a.isFunction(b[m])?b[m].call(h.overlay,x,s):k[m](x)});h.overlay.length||k.create();
b.blur===TRUE&&h.overlay.bind("click.qtipmodal"+c.id,function(){c.hide.call(c)})},create:function(){h.overlay=a("<div />",{id:"qtip-overlay",css:{position:"absolute",top:0,left:0,display:"none"}}).appendTo(document.body);a(E).bind("resize.qtipmodal",function(){h.overlay.css({height:Math.max(a(E).height(),a(document).height()),width:Math.max(a(E).width(),a(document).width())})}).trigger("resize")},toggle:function(m){var s=h.overlay,x=c.options.show.modal.effect,o=m?"show":"hide";s.stop(TRUE,FALSE);
if(a.isFunction(x))x.call(s,m);else x===FALSE?s[o]():s.fadeTo(90,m?0.7:0,function(){m||a(this).hide()})},show:function(){k.toggle(TRUE)},hide:function(){k.toggle(FALSE)},destroy:function(){var m=TRUE;a("*").each(function(){var s=a(this).data("qtip");if(s&&s.id!==c.id&&s.options.show.modal)return m=FALSE});if(m){h.overlay.remove();a(E).unbind("scroll.qtipmodal resize.qtipmodal")}else h.overlay.unbind("click.qtipmodal"+c.id);p.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});k.init()}function T(c){var b=
this,k=c.elements,h=k.tooltip,p=".bgiframe-"+c.id,m="tooltipmove"+p+" tooltipshow"+p;a.extend(b,{init:function(){k.bgiframe=a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>');k.bgiframe.appendTo(h);h.bind(m,b.adjust)},adjust:function(){var s=c.get("dimensions"),x=c.plugins.tip,o=c.elements.tip,A;A=parseInt(h.css("border-left-width"),10)||0;A={left:-A,top:-A};if(x&&o){x=
x.corner.precedance==="x"?["width","left"]:["height","top"];A[x[1]]-=o[x[0]]()}k.bgiframe.css(A).css(s)},destroy:function(){b.iframe.remove();h.unbind(m)}});b.init()}a.fn.qtip=function(c,b,k){var h=String(c).toLowerCase(),p=NULL,m=h==="disable"?[TRUE]:a.makeArray(arguments).slice(1,10),s=m[m.length-1],x;if(!arguments.length&&this.data("qtip")||h==="api")return(x=this.data("qtip"))?x:L;else if("string"===typeof c){this.each(function(){var o=a(this).data("qtip");if(!o)return TRUE;if(/option|set/.test(h)&&
b)if(k!==L)o.set(b,k);else p=o.get(b);else{if(!o.rendered&&(h==="show"||h==="toggle")){if(s&&s.timeStamp)o.cache.event=s;o.render(1)}else if(h==="enable"){h="disable";m=[FALSE]}o[h]&&o[h].apply(o[h],m)}});return p!==NULL?p:this}else if("object"===typeof c||!arguments.length){x=M(a.extend(TRUE,{},c));return a.fn.qtip.bind.call(this,x,s)}};a.fn.qtip.bind=function(c,b){return this.each(function(){function k(A){function B(){o.render(typeof A==="object"||h.show.ready);p.show.unbind(m.show);p.hide.unbind(m.hide)}
if(o.cache.disabled)return FALSE;o.cache.event=a.extend({},A);if(h.show.delay>0){clearTimeout(o.timers.show);o.timers.show=setTimeout(B,h.show.delay);m.show!==m.hide&&p.hide.bind(m.hide,function(){clearTimeout(o.timers.show)})}else B()}var h,p,m,s=c.id=!c.id||c.id===FALSE||c.id.length<1||a("#ui-tooltip-"+c.id).length?a.fn.qtip.nextid++:c.id,x=".qtip-"+s+"-create",o=P.call(this,s,c);if(o===FALSE)return TRUE;h=o.options;a.each(a.fn.qtip.plugins,function(){this.initialize==="initialize"&&this(o)});p=
{show:h.show.target,hide:h.hide.target};m={show:String(h.show.event).replace(" ",x+" ")+x,hide:String(h.hide.event).replace(" ",x+" ")+x};p.show.bind(m.show,k);if(h.show.ready||h.prerender)k(b)})};a.each({attr:function(c){var b=a(this),k=b.data("qtip");return arguments.length===1&&c==="title"&&k&&k.rendered===TRUE?b.data("oldtitle"):NULL},remove:a.ui?NULL:function(c,b){a(this).each(function(){if(!b)if(!c||a.filter(c,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}},
function(c,b){if(!b)return TRUE;a.fn["Old"+c]=a.fn[c];a.fn[c]=function(){return b.apply(this,arguments)||a.fn["Old"+c].apply(this,arguments)}});a(document.body).attr("role",function(c,b){return!b?"application":b});a(document).bind("mousemove.qtip",function(c){a.fn.qtip.mouse={pageX:c.pageX,pageY:c.pageY}});a.fn.qtip.version="2.0.0pre";a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.plugins={Corner:function(c){c=
String(c).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(c.match(/left|right/i)||c.match(/center/)||["inherit"])[0].toLowerCase();this.y=(c.match(/top|bottom|center/i)||["inherit"])[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 b=this.x.substr(0,1),k=this.y.substr(0,1);return b===k?b:b==="c"||b!=="c"&&k!=="c"?k+b:b+k}},iOS:parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||
[0,"4_2"])[1].replace("_","."))<4.1};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},effect:TRUE},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE},style:{classes:"",
widget:FALSE},events:{render:NULL,move:NULL,show:NULL,hide:NULL,focus:NULL,blur:NULL}};a.fn.qtip.plugins.ajax=function(c){var b=c.plugins.ajax,k=c.options.content.ajax;if(k&&k.url)if(b)return b;else{c.plugins.ajax=new Q(c);return c.plugins.ajax}};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(c){var b=c.content;if(b&&"ajax"in b){b=b.ajax;if(typeof b!=="object")b=c.content.ajax={url:b};if("boolean"!==typeof b.once&&b.once)b.once=!!b.once}};a.extend(TRUE,a.fn.qtip.defaults,
{content:{ajax:{once:TRUE}}});a.fn.qtip.plugins.tip=function(c){var b=c.plugins.tip,k=c.options.style.tip;if(k&&k.corner)if(b)return b;else{c.plugins.tip=new R(c);c.plugins.tip.init();return c.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(c){var b=c.style;if(b&&"tip"in b){b=c.style.tip;if(typeof b!=="object")c.style.tip={corner:b};if(!/string|boolean/i.test(typeof b.corner))b.corner=true;if(typeof b.method!=="string")b.method=TRUE;if(!/canvas|polygon/i.test(b.method))b.method=
TRUE;typeof b.width!=="number"&&delete b.width;typeof b.height!=="number"&&delete b.height;typeof b.border!=="number"&&delete b.border;typeof b.offset!=="number"&&delete b.offset}};a.extend(TRUE,a.fn.qtip.defaults,{style:{tip:{corner:TRUE,mimic:FALSE,method:TRUE,width:9,height:9,border:0,offset:0}}});a.fn.qtip.plugins.imagemap=function(c,b){function k(z,e){for(var j=0,n=1,d=1,f=0,i=0,l=z.width,g=z.height;l>0&&g>0&&n>0&&d>0;){l=Math.floor(l/2);g=Math.floor(g/2);if(b.x==="left")n=l;else if(b.x==="right")n=
z.width-l;else n+=Math.floor(l/2);if(b.y==="top")d=g;else if(b.y==="bottom")d=z.height-g;else d+=Math.floor(g/2);for(j=e.length;j--;){if(e.length<2)break;f=e[j][0]-z.offset.left;i=e[j][1]-z.offset.top;if(b.x==="left"&&f>=n||b.x==="right"&&f<=n||b.x==="center"&&(f<n||f>z.width-n)||b.y==="top"&&i>=d||b.y==="bottom"&&i<=d||b.y==="center"&&(i<d||i>z.height-d))e.splice(j,1)}}return{left:e[0][0],top:e[0][1]}}var h=c.attr("shape").toLowerCase(),p=c.attr("coords").split(","),m=[],s=a('img[usemap="#'+c.parent("map").attr("name")+
'"]'),x=s.offset(),o={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},A=0,B=0;x.left+=Math.ceil((s.outerWidth()-s.width())/2);x.top+=Math.ceil((s.outerHeight()-s.height())/2);if(h==="poly")for(A=p.length;A--;){B=[parseInt(p[--A],10),parseInt(p[A+1],10)];if(B[0]>o.offset.right)o.offset.right=B[0];if(B[0]<o.offset.left)o.offset.left=B[0];if(B[1]>o.offset.bottom)o.offset.bottom=B[1];if(B[1]<o.offset.top)o.offset.top=B[1];m.push(B)}else m=a.map(p,function(z){return parseInt(z,10)});switch(h){case "rect":o=
{width:Math.abs(m[2]-m[0]),height:Math.abs(m[3]-m[1]),offset:{left:m[0],top:m[1]}};break;case "circle":o={width:m[2]+2,height:m[2]+2,offset:{left:m[0],top:m[1]}};break;case "poly":a.extend(o,{width:Math.abs(o.offset.right-o.offset.left),height:Math.abs(o.offset.bottom-o.offset.top)});o.offset=b.string()==="centercenter"?{left:o.offset.left+o.width/2,top:o.offset.top+o.height/2}:k(o,m.slice());o.width=o.height=0;break}o.offset.left+=x.left;o.offset.top+=x.top;return o};a.fn.qtip.plugins.modal=function(c){var b=
c.plugins.modal,k=c.options.show.modal;if(b)return b;else if(k&&k.on===TRUE){c.plugins.modal=new S(c,k);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 b=c.plugins.bgiframe;if(b)return b;else{c.plugins.bgiframe=new T(c);return c.plugins.bgiframe}};a.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);