forked from dustmoo/qtip
/
jquery.qtip-1.0.0-rc3-dm-preload.min.js
90 lines (89 loc) · 35.9 KB
/
jquery.qtip-1.0.0-rc3-dm-preload.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
85
86
87
88
89
90
/*!
* jquery.qtip. The jQuery tooltip plugin
*
* Copyright (c) 2009 Craig Thompson
* http://craigsworks.com
*
* Licensed under MIT
* http://www.opensource.org/licenses/mit-license.php
*/
(function(c){function x(b,e,d){var a=this;a.id=d;a.options=e;a.status={animated:!1,rendered:!1,disabled:!1,focused:!1};a.elements={target:b.addClass(a.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};a.cache={mouse:{},position:{},toggle:0};a.timers={};c.extend(a,a.options.api,{show:function(b){function d(){c(this).css({opacity:""});"static"!==a.options.position.type&&a.focus();a.onShow.call(a,b);c.browser.msie&&
a.elements.tooltip.get(0).style.removeAttribute("filter")}var e;if(!a.status.rendered)return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show");if("none"!==a.elements.tooltip.css("display"))return a;a.elements.tooltip.stop(!0,!1);if(!1===a.beforeShow.call(a,b))return a;a.cache.toggle=1;"static"!==a.options.position.type&&a.updatePosition(b,0<a.options.show.effect.length);"object"===typeof a.options.show.solo?e=c(a.options.show.solo):!0===a.options.show.solo&&(e=c("div.qtip").not(a.elements.tooltip));
e&&e.each(function(){var a=c(this);!0===a.qtip("api").status.rendered&&a.qtip("api").hide()});if("function"===typeof a.options.show.effect.type)a.options.show.effect.type.call(a.elements.tooltip,a.options.show.effect.length),a.elements.tooltip.queue(function(){d();c(this).dequeue()});else{switch(a.options.show.effect.type.toLowerCase()){case "fade":a.elements.tooltip.fadeIn(a.options.show.effect.length,d);break;case "slide":a.elements.tooltip.slideDown(a.options.show.effect.length,function(){d();
"static"!==a.options.position.type&&a.updatePosition(b,!0)});break;case "grow":a.elements.tooltip.show(a.options.show.effect.length,d);break;default:a.elements.tooltip.show(null,d),a.elements.tooltip.css({opacity:""})}a.elements.tooltip.addClass(a.options.style.classes.active)}return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(b){function d(){a.onHide.call(a,b)}if(a.status.rendered){if("none"===a.elements.tooltip.css("display"))return a}else return c.fn.qtip.log.error.call(a,
2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide");clearTimeout(a.timers.show);a.elements.tooltip.stop(!0,!1);if(!1===a.beforeHide.call(a,b))return a;a.cache.toggle=0;if("function"===typeof a.options.hide.effect.type)a.options.hide.effect.type.call(a.elements.tooltip,a.options.hide.effect.length),a.elements.tooltip.queue(function(){d();c(this).dequeue()});else{switch(a.options.hide.effect.type.toLowerCase()){case "fade":a.elements.tooltip.fadeOut(a.options.hide.effect.length,d);break;case "slide":a.elements.tooltip.slideUp(a.options.hide.effect.length,
d);break;case "grow":a.elements.tooltip.hide(a.options.hide.effect.length,d);break;default:a.elements.tooltip.hide(null,d)}a.elements.tooltip.removeClass(a.options.style.classes.active)}return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(b,d){var e,i,g,h,f,m;if(a.status.rendered){if("static"===a.options.position.type)return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}else return c.fn.qtip.log.error.call(a,
2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition");g={position:{left:0,top:0},dimensions:{height:0,width:0},corner:a.options.position.corner.target};h={position:a.getPosition(),dimensions:a.getDimensions(),corner:a.options.position.corner.tooltip};if("mouse"!==a.options.position.target){if("area"===a.options.position.target.get(0).nodeName.toLowerCase()){f=a.options.position.target.attr("coords").split(",");e=0;for(i=f.length;e<i;e++)f[e]=parseInt(f[e],10);e=a.options.position.target.parent("map").attr("name");
m=c('img[usemap="#'+e+'"]:first').offset();g.position={left:Math.floor(m.left+f[0]),top:Math.floor(m.top+f[1])};switch(a.options.position.target.attr("shape").toLowerCase()){case "rect":g.dimensions={width:Math.ceil(Math.abs(f[2]-f[0])),height:Math.ceil(Math.abs(f[3]-f[1]))};break;case "circle":g.dimensions={width:f[2]+1,height:f[2]+1};break;case "poly":g.dimensions={width:f[0],height:f[1]};e=0;for(i=f.length;e<i;e++)if(0===e%2){if(f[e]>g.dimensions.width&&(g.dimensions.width=f[e]),f[e]<f[0])g.position.left=
Math.floor(m.left+f[e])}else if(f[e]>g.dimensions.height&&(g.dimensions.height=f[e]),f[e]<f[1])g.position.top=Math.floor(m.top+f[e]);g.dimensions.width-=g.position.left-m.left;g.dimensions.height-=g.position.top-m.top;break;default:return c.fn.qtip.log.error.call(a,4,c.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition")}g.dimensions.width-=2;g.dimensions.height-=2}else 1===a.options.position.target.add(document.body).length?(f=c(window),e=c(document),g.position={left:e.scrollLeft(),top:e.scrollTop()},
g.dimensions={height:f.height(),width:f.width()}):(g.position="undefined"!==typeof a.options.position.target.attr("qtip")?a.options.position.target.qtip("api").cache.position:a.options.position.target.offset(),g.dimensions={height:a.options.position.target.outerHeight(),width:a.options.position.target.outerWidth()});f=c.extend({},g.position);/right/i.test(g.corner)&&(f.left+=g.dimensions.width);/bottom/i.test(g.corner)&&(f.top+=g.dimensions.height);/((top|bottom)Middle)|center/.test(g.corner)&&(f.left+=
g.dimensions.width/2);/((left|right)Middle)|center/.test(g.corner)&&(f.top+=g.dimensions.height/2)}else g.position=f={left:a.cache.mouse.x,top:a.cache.mouse.y},g.dimensions={height:1,width:1};/right/i.test(h.corner)&&(f.left-=h.dimensions.width);/bottom/i.test(h.corner)&&(f.top-=h.dimensions.height);/((top|bottom)Middle)|center/.test(h.corner)&&(f.left-=h.dimensions.width/2);/((left|right)Middle)|center/.test(h.corner)&&(f.top-=h.dimensions.height/2);e=c.browser.msie?1:0;0<a.options.style.border.radius&&
((/Left/i.test(h.corner)?f.left-=a.options.style.border.radius:/Right/i.test(h.corner)&&(f.left+=a.options.style.border.radius),/Top/i.test(h.corner))?f.top-=a.options.style.border.radius:/Bottom/i.test(h.corner)&&(f.top+=a.options.style.border.radius));if(e&&(/top/i.test(h.corner)?f.top-=e:/bottom/i.test(h.corner)&&(f.top+=e),/left/i.test(h.corner)?f.left-=e:/right/i.test(h.corner)&&(f.left+=e),/leftMiddle|rightMiddle/.test(h.corner)))f.top-=1;!0===a.options.position.adjust.screen&&(f=y.call(a,f,
g,h));"mouse"===a.options.position.target&&!0===a.options.position.adjust.mouse&&(g=!0===a.options.position.adjust.screen&&a.elements.tip?a.elements.tip.attr("rel"):a.options.position.corner.tooltip,f.left+=/right/i.test(g)?-6:6,f.top+=/bottom/i.test(g)?-6:6);f.left+=a.options.position.adjust.x;f.top+=a.options.position.adjust.y;g=a.getPosition();if(f.left!=g.left||f.top!=g.top){g=a.beforePositionUpdate.call(a,b);if(!1===g)return a;a.cache.position=f;!0===d?(a.status.animated=!0,a.elements.tooltip.animate(f,
200,"swing",function(){a.status.animated=false})):a.elements.tooltip.css(f);a.onPositionUpdate.call(a,b);"undefined"!==typeof b&&(b.type&&"mousemove"!==b.type)&&c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}return a},updateWidth:function(b){if(a.status.rendered){if("undefined"!==typeof b&&"number"!==typeof b)return c.fn.qtip.log.error.call(a,2,"newWidth must be of type number","updateWidth")}else return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,
"updateWidth");var d=a.elements.contentWrapper.siblings().add(a.elements.tip).add(a.elements.button),e=a.elements.wrapper.add(a.elements.contentWrapper.children()),i=a.options.style.width.max,g=a.options.style.width.min;b||("number"===typeof a.options.style.width.value?b=a.options.style.width.value:(a.elements.tooltip.css({width:"auto"}),d.hide(),c.browser.msie&&e.css({zoom:""}),b=a.getDimensions().width,a.options.style.width.value||(b=Math.min(Math.max(b,g),i))));b%2&&(b-=1);a.elements.tooltip.width(b);
d.show();a.options.style.border.radius&&a.elements.tooltip.find(".qtip-betweenCorners").each(function(){c(this).width(b-a.options.style.border.radius*2)});c.browser.msie&&(e.css({zoom:1}),a.elements.bgiframe&&a.elements.bgiframe.width(b).height(a.getDimensions.height));return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(b){var d,e,i,g;if(a.status.rendered){if("string"!==typeof b||!c.fn.qtip.styles[b])return c.fn.qtip.log.error.call(a,2,
c.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}else return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle");a.options.style=p.call(a,c.fn.qtip.styles[b],a.options.user.style);a.elements.content.css(n(a.options.style));!1!==a.options.content.title.text&&a.elements.title.css(n(a.options.style.title,!0));a.elements.contentWrapper.css({borderColor:a.options.style.border.color});!1!==a.options.style.tip.corner&&("undefined"!==typeof HTMLCanvasElement?(b=a.elements.tooltip.find(".qtip-tip canvas:first"),
e=b.get(0).getContext("2d"),e.clearRect(0,0,300,300),i=b.parent("div[rel]:first").attr("rel"),g=q(i,a.options.style.tip.size.width,a.options.style.tip.size.height),r.call(a,b,g,a.options.style.tip.color||a.options.style.border.color)):c.browser.msie&&(b=a.elements.tooltip.find('.qtip-tip [nodeName="shape"]'),b.attr("fillcolor",a.options.style.tip.color||a.options.style.border.color)));0<a.options.style.border.radius&&(a.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:a.options.style.border.color}),
"undefined"!==typeof HTMLCanvasElement?(d=s(a.options.style.border.radius),a.elements.tooltip.find(".qtip-wrapper canvas").each(function(){var b=c(this);e=b.get(0).getContext("2d");e.clearRect(0,0,300,300);i=b.parent("div[rel]:first").attr("rel");t.call(a,b,d[i],a.options.style.border.radius,a.options.style.border.color)})):c.browser.msie&&a.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){c(this).attr("fillcolor",a.options.style.border.color)}));return c.fn.qtip.log.error.call(a,
1,c.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(b,d){function e(){a.updateWidth();!1!==d&&("static"!==a.options.position.type&&a.updatePosition(a.elements.tooltip.is(":visible"),!0),!1!==a.options.style.tip.corner&&o.call(a))}var i,g,h;if(a.status.rendered){if(!b)return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}else return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent");i=a.beforeContentUpdate.call(a,
b);if("string"===typeof i)b=i;else if(!1===i)return;c.browser.msie&&a.elements.contentWrapper.children().css({zoom:"normal"});b.jquery&&0<b.length?b.clone(!0).appendTo(a.elements.content).show():a.elements.content.html(b);h=0;g=a.elements.content.find("img");g.length?c.fn.qtip.preload?(g.each(function(){var a=c(this),b=c('body > img[src="'+a.attr("src")+'"]:first');0<b.length&&a.attr("width",b.innerWidth()).attr("height",b.innerHeight())}),e()):g.bind("load error",function(){++h===g.length&&e()}):
e();a.updateWidth();!1!==d&&("static"!==a.options.position.type&&a.updatePosition(a.elements.tooltip.is(":visible"),!0),!1!==a.options.style.tip.corner&&o.call(a));a.onContentUpdate.call(a);return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(b,d,e){function i(b){a.onContentLoad.call(a);c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");a.updateContent(b)}if(!a.status.rendered)return c.fn.qtip.log.error.call(a,
2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent");if(!1===a.beforeContentLoad.call(a))return a;"post"===e?c.post(b,d,i):c.get(b,d,i);return a},updateTitle:function(b){if(a.status.rendered){if(!b)return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}else return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle");if(!1===a.beforeTitleUpdate.call(a))return a;a.elements.button&&(a.elements.button=a.elements.button.clone(!0));
a.elements.title.html(b);a.elements.button&&a.elements.title.prepend(a.elements.button);a.onTitleUpdate.call(a);return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(b){var d,e,i;if(a.status.rendered){if("static"===a.options.position.type)return c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}else return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus");var g=c("div.qtip[qtip]");d=parseInt(a.elements.tooltip.css("z-index"),
10);e=32001+g.length-1;if(!a.status.focused&&d!==e){d=a.beforeFocus.call(a,b);if(!1===d)return a;g.not(a.elements.tooltip).each(function(){var a=c(this);!0===a.qtip("api").status.rendered&&(i=parseInt(a.css("z-index"),10),"number"===typeof i&&-1<i&&a.css({zIndex:parseInt(a.css("z-index"),10)-1}),a.qtip("api").status.focused=!1)});a.elements.tooltip.css({zIndex:e});a.status.focused=!0;a.onFocus.call(a,b);c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_FOCUSED,"focus")}return a},disable:function(b){if(!a.status.rendered)return c.fn.qtip.log.error.call(a,
2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable");b?a.status.disabled?c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable"):(a.status.disabled=!0,c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_DISABLED,"disable")):a.status.disabled?(a.status.disabled=!1,c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_ENABLED,"disable")):c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable");return a},destroy:function(){var b,d,e;if(!1===
a.beforeDestroy.call(a))return a;a.status.rendered?(a.options.show.when.target.unbind("mousemove.qtip",a.updatePosition),a.options.show.when.target.unbind("mouseout.qtip",a.hide),a.options.show.when.target.unbind(a.options.show.when.event+".qtip"),a.options.hide.when.target.unbind(a.options.hide.when.event+".qtip"),a.elements.tooltip.unbind(a.options.hide.when.event+".qtip"),a.elements.tooltip.unbind("mouseover.qtip",a.focus),a.elements.tooltip.remove()):a.options.show.when.target.unbind(a.options.show.when.event+
".qtip-create");if("object"===typeof a.elements.target.data("qtip")&&(e=a.elements.target.data("qtip").interfaces,"object"===typeof e&&0<e.length)){b=0;for(d=e.length-1;b<d;b++)e[b].id==a.id&&e.splice(b,1)}c.fn.qtip.interfaces.splice(a.id,1);"object"===typeof e&&0<e.length?a.elements.target.data("qtip").current=e.length-1:a.elements.target.removeData("qtip");a.onDestroy.call(a);c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_DESTROYED,"destroy");return a.elements.target},getPosition:function(){var b,
d;if(!a.status.rendered)return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition");(b="none"===a.elements.tooltip.css("display"))&&a.elements.tooltip.css({visiblity:"hidden"}).show();d=a.elements.tooltip.offset();b&&a.elements.tooltip.css({visiblity:"visible"}).hide();return d},getDimensions:function(){var b,d;if(!a.status.rendered)return c.fn.qtip.log.error.call(a,2,c.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions");(b=a.elements.tooltip.is(":visible"))&&a.elements.tooltip.css({visiblity:"hidden"}).show();
d={height:a.elements.tooltip.outerHeight(),width:a.elements.tooltip.outerWidth()};b&&a.elements.tooltip.css({visiblity:"visible"}).hide();return d}})}function u(){var b,e,d;this.beforeRender.call(this);this.status.rendered=!0;this.elements.tooltip='<div qtip="'+this.id+'" class="qtip '+(this.options.style.classes.tooltip||this.options.style)+'"style="display:none; -o-border-radius:0; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+this.options.position.type+';"> <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> <div class="qtip-contentWrapper" style="overflow:hidden;"> <div class="qtip-content '+
this.options.style.classes.content+'"></div></div></div></div>';this.elements.tooltip=c(this.elements.tooltip);this.elements.tooltip.appendTo(this.options.position.container);this.elements.tooltip.data("qtip",{current:0,interfaces:[this]});this.elements.wrapper=this.elements.tooltip.children("div:first");this.elements.contentWrapper=this.elements.wrapper.children("div:first").css({background:this.options.style.background});this.elements.content=this.elements.contentWrapper.children("div:first").css(n(this.options.style));
c.browser.msie&&this.elements.wrapper.add(this.elements.content).css({zoom:1});/unfocus/i.test(this.options.hide.when.event)&&this.elements.tooltip.attr("unfocus",!0);"number"===typeof this.options.style.width.value&&this.updateWidth();"undefined"!==typeof HTMLCanvasElement||c.browser.msie?(0<this.options.style.border.radius?z.call(this):this.elements.contentWrapper.css({border:this.options.style.border.width+"px solid "+this.options.style.border.color}),!1!==this.options.style.tip.corner&&v.call(this)):
(this.elements.contentWrapper.css({border:this.options.style.border.width+"px solid "+this.options.style.border.color}),this.options.style.border.radius=0,this.options.style.tip.corner=!1,c.fn.qtip.log.error.call(this,2,c.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render"));"string"===typeof this.options.content.text&&0<this.options.content.text.length||this.options.content.text.jquery&&0<this.options.content.text.length?b=this.options.content.text:"string"===typeof this.elements.target.attr("title")&&
0<this.elements.target.attr("title").length?(b=this.elements.target.attr("title").replace("\\n","<br />"),this.elements.target.attr("title","")):"string"===typeof this.elements.target.attr("alt")&&0<this.elements.target.attr("alt").length?(b=this.elements.target.attr("alt").replace("\\n","<br />"),this.elements.target.attr("alt","")):(b=" ",c.fn.qtip.log.error.call(this,1,c.fn.qtip.constants.NO_VALID_CONTENT,"render"));!1!==this.options.content.title.text&&A.call(this);this.updateContent(b);B.call(this);
!0===this.options.show.ready&&this.show();!1!==this.options.content.url&&(b=this.options.content.url,e=this.options.content.data,d=this.options.content.method||"get",this.loadContent(b,e,d));this.onRender.call(this);c.fn.qtip.log.error.call(this,1,c.fn.qtip.constants.EVENT_RENDERED,"render")}function z(){var b,e,d,a,l,j,k,i,g;b=this;b.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();d=b.options.style.border.width;a=b.options.style.border.radius;l=b.options.style.border.color||
b.options.style.tip.color;j=s(a);k={};for(e in j)k[e]='<div rel="'+e+'" style="'+(/Left/.test(e)?"left":"right")+":0; position:absolute; height:"+a+"px; width:"+a+'px; overflow:hidden; line-height:0.1px; font-size:1px">',"undefined"!==typeof HTMLCanvasElement?k[e]+='<canvas height="'+a+'" width="'+a+'" style="vertical-align: top"></canvas>':c.browser.msie&&(i=2*a+3,k[e]+='<v:arc stroked="false" fillcolor="'+l+'" startangle="'+j[e][0]+'" endangle="'+j[e][1]+'" style="width:'+i+"px; height:"+i+"px; margin-top:"+
(/bottom/.test(e)?-2:-1)+"px; margin-left:"+(/Right/.test(e)?j[e][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'),k[e]+="</div>";e=b.getDimensions().width-2*Math.max(d,a);e='<div class="qtip-betweenCorners" style="height:'+a+"px; width:"+e+"px; overflow:hidden; background-color:"+l+'; line-height:0.1px; font-size:1px;">';b.elements.wrapper.prepend('<div class="qtip-borderTop" dir="ltr" style="height:'+a+"px; margin-left:"+a+'px; line-height:0.1px; font-size:1px; padding:0;">'+
k.topLeft+k.topRight+e);b.elements.wrapper.append('<div class="qtip-borderBottom" dir="ltr" style="height:'+a+"px; margin-left:"+a+'px; line-height:0.1px; font-size:1px; padding:0;">'+k.bottomLeft+k.bottomRight+e);"undefined"!==typeof HTMLCanvasElement?b.elements.wrapper.find("canvas").each(function(){var d=c(this);g=j[d.parent("[rel]:first").attr("rel")];t.call(b,d,g,a,l)}):c.browser.msie&&b.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>');k=Math.max(a,a+(d-a));
d=Math.max(d-a,0);b.elements.contentWrapper.css({border:"0px solid "+l,borderWidth:d+"px "+k+"px"})}function t(b,c,d,a){b=b.get(0).getContext("2d");b.fillStyle=a;b.beginPath();b.arc(c[0],c[1],d,0,2*Math.PI,!1);b.fill()}function v(b){var e,d,a,l;null!==this.elements.tip&&this.elements.tip.remove();e=this.options.style.tip.color||this.options.style.border.color;!1!==this.options.style.tip.corner&&(b||(b=this.options.style.tip.corner),d=q(b,this.options.style.tip.size.width,this.options.style.tip.size.height),
this.elements.tip='<div class="'+this.options.style.classes.tip+'" dir="ltr" rel="'+b+'" style="position:absolute; height:'+this.options.style.tip.size.height+"px; width:"+this.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;"></div>',this.elements.tooltip.prepend(this.elements.tip),"undefined"!==typeof HTMLCanvasElement?a='<canvas height="'+this.options.style.tip.size.height+'" width="'+this.options.style.tip.size.width+'"></canvas>':c.browser.msie&&(a=this.options.style.tip.size.width+
","+this.options.style.tip.size.height,l="m"+d[0][0]+","+d[0][1],l+=" l"+d[1][0]+","+d[1][1],l+=" "+d[2][0]+","+d[2][1],a='<v:shape fillcolor="'+e+'" stroked="false" filled="true" path="'+(l+" xe")+'" coordsize="'+a+'" style="width:'+this.options.style.tip.size.width+"px; height:"+this.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+(/top/.test(b)?"bottom":"top")+'"></v:shape>',a+='<v:image style="behavior:url(#default#VML);"></v:image>',
this.elements.contentWrapper.css("position","relative")),this.elements.tip=this.elements.tooltip.find("."+this.options.style.classes.tip).eq(0),this.elements.tip.html(a),"undefined"!==typeof HTMLCanvasElement&&r.call(this,this.elements.tip.find("canvas:first"),d,e),o.call(this,b))}function r(b,c,d){b=b.get(0).getContext("2d");b.fillStyle=d;b.beginPath();b.moveTo(c[0][0],c[0][1]);b.lineTo(c[1][0],c[1][1]);b.lineTo(c[2][0],c[2][1]);b.fill()}function o(b){var e,d;!1!==this.options.style.tip.corner&&
this.elements.tip&&(b||(b=this.elements.tip.attr("rel")),e=d=c.browser.msie?1:0,this.elements.tip.css(b.match(/left|right|top|bottom/)[0],0),/top|bottom/.test(b)?(c.browser.msie&&(d=/top/.test(b)?1:2),/Middle/.test(b)?this.elements.tip.css({left:"50%",marginLeft:-(this.options.style.tip.size.width/2)}):/Left/.test(b)?this.elements.tip.css({left:this.options.style.border.radius-e}):/Right/.test(b)&&this.elements.tip.css({right:this.options.style.border.radius+e}),/top/.test(b)?this.elements.tip.css({top:-d}):
this.elements.tip.css({bottom:d})):/left|right/.test(b)&&(c.browser.msie&&(d=/left/.test(b)?1:2),/Middle/.test(b)?this.elements.tip.css({top:"50%",marginTop:-(this.options.style.tip.size.height/2)}):/Top/.test(b)?this.elements.tip.css({top:this.options.style.border.radius-e}):/Bottom/.test(b)&&this.elements.tip.css({bottom:this.options.style.border.radius+e}),/left/.test(b)?this.elements.tip.css({left:-d}):this.elements.tip.css({right:d})),b="padding-"+b.match(/left|right|top|bottom/)[0],e=this.options.style.tip.size[/left|right/.test(b)?
"width":"height"],this.elements.tooltip.css("padding",0),this.elements.tooltip.css(b,e))}function A(){var b=this;null!==b.elements.title&&b.elements.title.remove();b.elements.title=c('<div class="'+b.options.style.classes.title+'">').css(n(b.options.style.title,!0)).css({zoom:c.browser.msie?1:0}).prependTo(b.elements.contentWrapper);b.options.content.title.text&&b.updateTitle.call(b,b.options.content.title.text);!1!==b.options.content.title.button&&"string"===typeof b.options.content.title.button&&
(b.elements.button=c('<a class="'+b.options.style.classes.button+'" style="float:right; position: relative"></a>').css(n(b.options.style.button,!0)).html(b.options.content.title.button).prependTo(b.elements.title).click(function(c){b.status.disabled||b.hide(c)}))}function B(){function b(a){!0!==d.status.disabled&&("inactive"===d.options.hide.when.event&&(c(j).each(function(){l.bind(this+".qtip-inactive",k);d.elements.content.bind(this+".qtip-inactive",k)}),k()),clearTimeout(d.timers.show),clearTimeout(d.timers.hide),
0<d.options.show.delay?d.timers.show=setTimeout(function(){d.show(a)},d.options.show.delay):d.show(a))}function e(a){if(!0!==d.status.disabled){if(!0===d.options.hide.fixed&&/mouse(out|leave)/i.test(d.options.hide.when.event)&&0<c(a.relatedTarget).parents("div.qtip[qtip]").length)return a.stopPropagation(),a.preventDefault(),clearTimeout(d.timers.hide),!1;clearTimeout(d.timers.show);clearTimeout(d.timers.hide);d.elements.tooltip.stop(!0,!0);d.timers.hide=setTimeout(function(){d.hide(a)},d.options.hide.delay)}}
var d,a,l,j;d=this;a=d.options.show.when.target;l=d.options.hide.when.target;d.options.hide.fixed&&(l=l.add(d.elements.tooltip));if("inactive"===d.options.hide.when.event){j="click dblclick mousedown mouseup mousemove mouseout mouseenter mouseleave mouseover touchstart".split(" ");var k=function(a){!0!==d.status.disabled&&(clearTimeout(d.timers.inactive),d.timers.inactive=setTimeout(function(){c(j).each(function(){l.unbind(this+".qtip-inactive");d.elements.content.unbind(this+".qtip-inactive")});
d.hide(a)},d.options.hide.delay))}}else!0===d.options.hide.fixed&&d.elements.tooltip.bind("mouseover.qtip",function(){!0!==d.status.disabled&&clearTimeout(d.timers.hide)});1===d.options.show.when.target.add(d.options.hide.when.target).length&&d.options.show.when.event==d.options.hide.when.event&&"inactive"!==d.options.hide.when.event||"unfocus"==d.options.hide.when.event?(d.cache.toggle=0,a.bind(d.options.show.when.event+".qtip",function(a){0==d.cache.toggle?b(a):e(a)})):(a.bind(d.options.show.when.event+
".qtip",b),"inactive"!==d.options.hide.when.event&&l.bind(d.options.hide.when.event+".qtip",e));/(fixed|absolute)/.test(d.options.position.type)&&d.elements.tooltip.bind("mouseover.qtip",d.focus);"mouse"===d.options.position.target&&"static"!==d.options.position.type&&a.bind("mousemove.qtip",function(a){d.cache.mouse={x:a.pageX,y:a.pageY};d.status.disabled===false&&(d.options.position.adjust.mouse===true&&d.options.position.type!=="static"&&d.elements.tooltip.css("display")!=="none")&&d.updatePosition(a)})}
function y(b,e,d){var a,l,j,k,i,g,h,f;if("center"===d.corner)return e.position;f=c.extend({},b);g=i=!1;a=f.left<c.fn.qtip.cache.screen.scroll.left;l=f.left+d.dimensions.width+2>=c.fn.qtip.cache.screen.width+c.fn.qtip.cache.screen.scroll.left;j=f.top<c.fn.qtip.cache.screen.scroll.top;k=f.top+d.dimensions.height+2>=c.fn.qtip.cache.screen.height+c.fn.qtip.cache.screen.scroll.top;h=a&&(/right/i.test(d.corner)||!l);a=l&&(/left/i.test(d.corner)||!a);j=j&&!/top/i.test(d.corner);k=k&&!/bottom/i.test(d.corner);
h?(f.left="mouse"!==this.options.position.target?e.position.left+e.dimensions.width:this.cache.mouse.x,i="Left"):a&&(f.left="mouse"!==this.options.position.target?e.position.left-d.dimensions.width:this.cache.mouse.x-d.dimensions.width,i="Right");j?(f.top="mouse"!==this.options.position.target?e.position.top+e.dimensions.height:this.cache.mouse.y,g="top"):k&&(f.top="mouse"!==this.options.position.target?e.position.top-d.dimensions.height:this.cache.mouse.y-d.dimensions.height,g="bottom");0>f.left&&
(f.left=b.left,i=!1);0>f.top&&(f.top=b.top,g=!1);if(!1!==this.options.style.tip.corner){f.corner=new String(d.corner);if(f.corner.match(/^(right|left)/))!1!==i&&(f.corner=f.corner.replace(/(left|right)/,i.toLowerCase()));else if(!1!==i&&(f.corner=f.corner.replace(/Left|Right|Middle/,i)),!1!==g)f.corner=f.corner.replace(/top|bottom/,g);f.corner!==this.elements.tip.attr("rel")&&v.call(this,f.corner)}return f}function n(b,e){var d,a;d=c.extend(!0,{},b);for(a in d)!0===e&&/(tip|classes)/i.test(a)?delete d[a]:
!e&&/(width|border|tip|title|classes|user)/i.test(a)&&delete d[a];return d}function w(b){"object"!==typeof b.tip&&(b.tip={corner:b.tip});"object"!==typeof b.tip.size&&(b.tip.size={width:b.tip.size,height:b.tip.size});"object"!==typeof b.border&&(b.border={width:b.border});"object"!==typeof b.width&&(b.width={value:b.width});"string"===typeof b.width.max&&(b.width.max=parseInt(b.width.max.replace(/([0-9]+)/i,"$1")));"string"===typeof b.width.min&&(b.width.min=parseInt(b.width.min.replace(/([0-9]+)/i,
"$1")));"number"===typeof b.tip.size.x&&(b.tip.size.width=b.tip.size.x,delete b.tip.size.x);"number"===typeof b.tip.size.y&&(b.tip.size.height=b.tip.size.y,delete b.tip.size.y);return b}function p(){var b,e,d;d=[!0,{}];b=0;for(e=arguments.length;b<e;b++)d.push(arguments[b]);for(b=[c.extend.apply(c,d)];"string"===typeof b[0].name;)b.unshift(w(c.fn.qtip.styles[b[0].name]));b.unshift(!0,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},c.fn.qtip.styles.defaults);b=c.extend.apply(c,b);e=c.browser.msie?
1:0;b.tip.size.width+=e;b.tip.size.height+=e;0<b.tip.size.width%2&&(b.tip.size.width+=1);0<b.tip.size.height%2&&(b.tip.size.height+=1);!0===b.tip.corner&&(b.tip.corner="center"===this.options.position.corner.tooltip?!1:this.options.position.corner.tooltip);return b}function q(b,c,d){c={bottomRight:[[0,0],[c,d],[c,0]],bottomLeft:[[0,0],[c,0],[0,d]],topRight:[[0,d],[c,0],[c,d]],topLeft:[[0,0],[0,d],[c,d]],topMiddle:[[0,d],[c/2,0],[c,d]],bottomMiddle:[[0,0],[c,0],[c/2,d]],rightMiddle:[[0,0],[c,d/2],
[0,d]],leftMiddle:[[c,0],[c,d],[0,d/2]]};c.leftTop=c.bottomRight;c.rightTop=c.bottomLeft;c.leftBottom=c.topRight;c.rightBottom=c.topLeft;return c[b]}function s(b){var e;"undefined"!==typeof HTMLCanvasElement?e={topLeft:[b,b],topRight:[0,b],bottomLeft:[b,0],bottomRight:[0,0]}:c.browser.msie&&(e={topLeft:[-90,90,0],topRight:[-90,90,-b],bottomLeft:[90,270,0],bottomRight:[90,270,-b]});return e}c.fn.qtip=function(b,e){var d,a,l,j,k,i,g,h,f,m=c(this);if("string"===typeof b){c.isPlainObject(m.data("qtip"))&&
c.fn.qtip.log.error.call(self,1,c.fn.qtip.constants.NO_TOOLTIP_PRESENT,!1);if("api"===b)return m.data("qtip").interfaces[m.data("qtip").current];if("interfaces"===b)return m.data("qtip").interfaces}else{b||(b={});if("object"!==typeof b.content||b.content.jquery&&0<b.content.length)b.content={text:b.content};"object"!==typeof b.content.title&&(b.content.title={text:b.content.title});"object"!==typeof b.position&&(b.position={corner:b.position});"object"!==typeof b.position.corner&&(b.position.corner=
{target:b.position.corner,tooltip:b.position.corner});"object"!==typeof b.show&&(b.show={when:b.show});"object"!==typeof b.show.when&&(b.show.when={event:b.show.when});"object"!==typeof b.show.effect&&(b.show.effect={type:b.show.effect});"object"!==typeof b.hide&&(b.hide={when:b.hide});"object"!==typeof b.hide.when&&(b.hide.when={event:b.hide.when});"object"!==typeof b.hide.effect&&(b.hide.effect={type:b.hide.effect});"object"!==typeof b.style&&(b.style={name:b.style});b.style=w(b.style);k=c.extend(!0,
{},c.fn.qtip.defaults,b);k.style=p.call({options:k},k.style);k.user=c.extend(!0,{},b)}return m.each(function(){var m=c(this);if("string"===typeof b){if(g=b.toLowerCase(),j=m.qtip("interfaces"),"object"===typeof j)if(!0===e&&"destroy"===g)for(;0<j.length;)j[j.length-1].destroy();else{!0!==e&&(j=[m.qtip("api")]);d=0;for(a=j.length;d<a;d++)"destroy"===g?j[d].destroy():!0===j[d].status.rendered&&("show"===g?j[d].show():"hide"===g?j[d].hide():"focus"===g?j[d].focus():"disable"===g?j[d].disable(!0):"enable"===
g&&j[d].disable(!1))}}else{h=c.extend(!0,{},k);h.hide.effect.length=k.hide.effect.length;h.show.effect.length=k.show.effect.length;!1===h.position.container&&(h.position.container=c(document.body));!1===h.position.target&&(h.position.target=m);!1===h.show.when.target&&(h.show.when.target=m);!1===h.hide.when.target&&(h.hide.when.target=m);l=c.fn.qtip.interfaces.length;for(d=0;d<l;d++)if("undefined"===typeof c.fn.qtip.interfaces[d]){l=d;break}i=new x(m,h,l);c.fn.qtip.interfaces[l]=i;c.isPlainObject(m.data("qtip"))?
("undefined"===typeof m.attr("qtip")&&(m.data("qtip").current=m.data("qtip").interfaces.length),m.data("qtip").interfaces.push(i)):m.data("qtip",{current:0,interfaces:[i]});!1===h.content.prerender&&!1!==h.show.when.event&&!0!==h.show.ready?h.show.when.target.bind(h.show.when.event+".qtip-"+l+"-create",{qtip:l},function(a){f=c.fn.qtip.interfaces[a.data.qtip];f.options.show.when.target.unbind(f.options.show.when.event+".qtip-"+a.data.qtip+"-create");f.cache.mouse={x:a.pageX,y:a.pageY};u.call(f);f.options.show.when.target.trigger(f.options.show.when.event)}):
(i.cache.mouse={x:h.show.when.target.offset().left,y:h.show.when.target.offset().top},u.call(i))}})};c(document).ready(function(){var b=c(window);c.fn.qtip.cache={screen:{scroll:{left:b.scrollLeft(),top:b.scrollTop()},width:b.width(),height:b.height()}};var e;b.bind("resize scroll",function(b){clearTimeout(e);e=setTimeout(function(){var a=c(window);"scroll"===b.type?c.fn.qtip.cache.screen.scroll={left:a.scrollLeft(),top:a.scrollTop()}:(c.fn.qtip.cache.screen.width=a.width(),c.fn.qtip.cache.screen.height=
a.height());for(var a=0,e=c.fn.qtip.interfaces.length;a<e;a++){var j=c.fn.qtip.interfaces[a];!0===j.status.rendered&&(j.options.position.adjust.scroll&&"scroll"===b.type||j.options.position.adjust.resize&&"resize"===b.type)&&j.updatePosition(b,!0)}},100)});c(document).bind("touchstart.qtip",function(b){0===c(b.target).parents("div.qtip").length&&c(".qtip[unfocus]").each(function(){var a=c(this),e=a.qtip("api");a.is(":visible")&&(!e.status.disabled&&1<c(b.target).add(e.elements.target).length)&&e.hide(b)})}).bind("mousedown.qtip",
function(b){0===c(b.target).parents("div.qtip").length&&c(".qtip[unfocus]").each(function(){var a=c(this),e=a.qtip("api");a.is(":visible")&&(!e.status.disabled&&1<c(b.target).add(e.elements.target).length)&&e.hide(b)})})});c.fn.qtip.interfaces=[];c.fn.qtip.log={error:function(){return this}};c.fn.qtip.constants={};c.fn.qtip.defaults={content:{prerender:!1,text:!1,url:!1,data:null,title:{text:!1,button:!1}},position:{target:!1,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:!0,
screen:!1,scroll:!0,resize:!0},type:"absolute",container:!1},show:{when:{target:!1,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:!1,ready:!1},hide:{when:{target:!1,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:!1},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},
beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};c.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:!1,color:!1,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},
button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,
color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",
color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
/*!
* jquery.qtip.imageload. The jQuery tooltip plugin - Image preloader plugin
*
* Copyright (c) 2009 Craig Thompson
* http://craigsworks.com
*
* Licensed under MIT
* http://www.opensource.org/licenses/mit-license.php
*/
(function(d){function e(a,b){return RegExp("< *[img][^>]*[src] *= *[\"']{0,1}([^\"' >]*)[^>]*>",b?"ig":"i").exec(a)}d.fn.qtip.preload=function(a){var b,c,f=d(document.body);a.jquery&&(0<a.length&&a.html)&&(a=a.html());if((a=e(a,!0))&&0<a.length)for(b=a.length;b--;)0>a[b].search(/^</i)||-1<a[b].search(/(width|height){1} *= *["']{0,1}([^>]*)/i)||(c=e(a[b]))&&(1<c.length&&c[1])&&f.append('<img src="'+c[1]+'" style="position: absolute; left: -10000em;" alt="" />')}})(jQuery);