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