/*
 * 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
 *
 * Launch  : February 2009
 * Version : 1.0.0-rc3
 * Released: Tuesday 12th May, 2009 - 00:00
 * Debug: jquery.qtip.debug.js
 */
(function(c){function z(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(){a.options.position.type!=="static"&&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(a.elements.tooltip.css("display")!=="none")return a;a.elements.tooltip.stop(!0,!1);if(a.beforeShow.call(a,b)===!1)return a;a.cache.toggle=1;a.options.position.type!=="static"&&a.updatePosition(b,a.options.show.effect.length>0);typeof a.options.show.solo=="object"?e=c(a.options.show.solo):a.options.show.solo===!0&&(e=c("div.qtip").not(a.elements.tooltip));e&&e.each(function(){c(this).qtip("api").status.rendered===
!0&&c(this).qtip("api").hide()});if(typeof a.options.show.effect.type=="function")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();a.options.position.type!=="static"&&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.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(a.elements.tooltip.css("display")==="none")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(a.beforeHide.call(a,b)===!1)return a;a.cache.toggle=0;if(typeof a.options.hide.effect.type=="function")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,f,g,j,n,k,o;if(a.status.rendered){if(a.options.position.type=="static")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");f={position:{left:0,
top:0},dimensions:{height:0,width:0},corner:a.options.position.corner.target};g={position:a.getPosition(),dimensions:a.getDimensions(),corner:a.options.position.corner.tooltip};if(a.options.position.target!=="mouse"){if(a.options.position.target.get(0).nodeName.toLowerCase()=="area"){j=a.options.position.target.attr("coords").split(",");for(e=0;e<j.length;e++)j[e]=parseInt(j[e]);e=a.options.position.target.parent("map").attr("name");n=c('img[usemap="#'+e+'"]:first').offset();f.position={left:Math.floor(n.left+
j[0]),top:Math.floor(n.top+j[1])};switch(a.options.position.target.attr("shape").toLowerCase()){case "rect":f.dimensions={width:Math.ceil(Math.abs(j[2]-j[0])),height:Math.ceil(Math.abs(j[3]-j[1]))};break;case "circle":f.dimensions={width:j[2]+1,height:j[2]+1};break;case "poly":f.dimensions={width:j[0],height:j[1]};for(e=0;e<j.length;e++)if(e%2==0){if(j[e]>f.dimensions.width)f.dimensions.width=j[e];if(j[e]<j[0])f.position.left=Math.floor(n.left+j[e])}else{if(j[e]>f.dimensions.height)f.dimensions.height=
j[e];if(j[e]<j[1])f.position.top=Math.floor(n.top+j[e])}f.dimensions.width-=f.position.left-n.left;f.dimensions.height-=f.position.top-n.top;break;default:return c.fn.qtip.log.error.call(a,4,c.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition")}f.dimensions.width-=2;f.dimensions.height-=2}else a.options.position.target.add(document.body).length===1?(f.position={left:c(document).scrollLeft(),top:c(document).scrollTop()},f.dimensions={height:c(window).height(),width:c(window).width()}):(f.position=
typeof a.options.position.target.attr("qtip")!=="undefined"?a.options.position.target.qtip("api").cache.position:a.options.position.target.offset(),f.dimensions={height:a.options.position.target.outerHeight(),width:a.options.position.target.outerWidth()});k=c.extend({},f.position);f.corner.search(/right/i)!==-1&&(k.left+=f.dimensions.width);f.corner.search(/bottom/i)!==-1&&(k.top+=f.dimensions.height);f.corner.search(/((top|bottom)Middle)|center/)!==-1&&(k.left+=f.dimensions.width/2);f.corner.search(/((left|right)Middle)|center/)!==
-1&&(k.top+=f.dimensions.height/2)}else f.position=k={left:a.cache.mouse.x,top:a.cache.mouse.y},f.dimensions={height:1,width:1};g.corner.search(/right/i)!==-1&&(k.left-=g.dimensions.width);g.corner.search(/bottom/i)!==-1&&(k.top-=g.dimensions.height);g.corner.search(/((top|bottom)Middle)|center/)!==-1&&(k.left-=g.dimensions.width/2);g.corner.search(/((left|right)Middle)|center/)!==-1&&(k.top-=g.dimensions.height/2);j=c.browser.msie?1:0;c.browser.msie&&parseInt(c.browser.version.charAt(0));a.options.style.border.radius>
0&&(g.corner.search(/Left/)!==-1?k.left-=a.options.style.border.radius:g.corner.search(/Right/)!==-1&&(k.left+=a.options.style.border.radius),g.corner.search(/Top/)!==-1?k.top-=a.options.style.border.radius:g.corner.search(/Bottom/)!==-1&&(k.top+=a.options.style.border.radius));j&&(g.corner.search(/top/)!==-1?k.top-=j:g.corner.search(/bottom/)!==-1&&(k.top+=j),g.corner.search(/left/)!==-1?k.left-=j:g.corner.search(/right/)!==-1&&(k.left+=j),g.corner.search(/leftMiddle|rightMiddle/)!==-1&&(k.top-=
1));a.options.position.adjust.screen===!0&&(k=A.call(a,k,f,g));a.options.position.target==="mouse"&&a.options.position.adjust.mouse===!0&&(f=a.options.position.adjust.screen===!0&&a.elements.tip?a.elements.tip.attr("rel"):a.options.position.corner.tooltip,k.left+=f.search(/right/i)!==-1?-6:6,k.top+=f.search(/bottom/i)!==-1?-6:6);!a.elements.bgiframe&&c.browser.msie&&parseInt(c.browser.version.charAt(0))==6&&c("select, object").each(function(){o=c(this).offset();o.bottom=o.top+c(this).height();o.right=
o.left+c(this).width();k.top+g.dimensions.height>=o.top&&k.left+g.dimensions.width>=o.left&&B.call(a)});k.left+=a.options.position.adjust.x;k.top+=a.options.position.adjust.y;f=a.getPosition();if(k.left!=f.left||k.top!=f.top){f=a.beforePositionUpdate.call(a,b);if(f===!1)return a;a.cache.position=k;d===!0?(a.status.animated=!0,a.elements.tooltip.animate(k,200,"swing",function(){a.status.animated=!1})):a.elements.tooltip.css(k);a.onPositionUpdate.call(a,b);typeof b!=="undefined"&&b.type&&b.type!=="mousemove"&&
c.fn.qtip.log.error.call(a,1,c.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}return a},updateWidth:function(b){var d;if(a.status.rendered){if(b&&typeof b!=="number")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");d=a.elements.contentWrapper.siblings().add(a.elements.tip).add(a.elements.button);if(!b)if(typeof a.options.style.width.value=="number")b=a.options.style.width.value;
else if(a.elements.tooltip.css({width:"auto"}),d.hide(),c.browser.msie&&a.elements.wrapper.add(a.elements.contentWrapper.children()).css({zoom:"normal"}),b=a.getDimensions().width+1,!a.options.style.width.value){if(b>a.options.style.width.max)b=a.options.style.width.max;if(b<a.options.style.width.min)b=a.options.style.width.min}b%2!==0&&(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&&(a.elements.wrapper.add(a.elements.contentWrapper.children()).css({zoom:"1"}),a.elements.wrapper.width(b),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,f,g;if(a.status.rendered){if(typeof b!=="string"||!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=q.call(a,c.fn.qtip.styles[b],a.options.user.style);a.elements.content.css(p(a.options.style));a.options.content.title.text!==!1&&a.elements.title.css(p(a.options.style.title,!0));a.elements.contentWrapper.css({borderColor:a.options.style.border.color});a.options.style.tip.corner!==!1&&(c("<canvas>").get(0).getContext?(b=a.elements.tooltip.find(".qtip-tip canvas:first"),e=b.get(0).getContext("2d"),e.clearRect(0,0,300,300),f=
b.parent("div[rel]:first").attr("rel"),g=r(f,a.options.style.tip.size.width,a.options.style.tip.size.height),s.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)));a.options.style.border.radius>0&&(a.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:a.options.style.border.color}),c("<canvas>").get(0).getContext?(d=
t(a.options.style.border.radius),a.elements.tooltip.find(".qtip-wrapper canvas").each(function(){e=c(this).get(0).getContext("2d");e.clearRect(0,0,300,300);f=c(this).parent("div[rel]:first").attr("rel");u.call(a,c(this),d[f],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();d!==!1&&(a.options.position.type!=="static"&&a.updatePosition(a.elements.tooltip.is(":visible"),!0),a.options.style.tip.corner!==!1&&v.call(a))}var f,g,j;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");f=a.beforeContentUpdate.call(a,b);if(typeof f=="string")b=
f;else if(f===!1)return;c.browser.msie&&a.elements.contentWrapper.children().css({zoom:"normal"});b.jquery&&b.length>0?b.clone(!0).appendTo(a.elements.content).show():a.elements.content.html(b);g=a.elements.content.find("img[complete=false]");g.length>0?(j=0,g.each(function(){c('<img src="'+c(this).attr("src")+'" />').load(function(){++j==g.length&&e()})})):e();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 f(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(a.beforeContentLoad.call(a)===!1)return a;e=="post"?c.post(b,d,f):c.get(b,d,f);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");returned=a.beforeTitleUpdate.call(a);if(returned===!1)return a;if(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,f;if(a.status.rendered){if(a.options.position.type=="static")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");d=parseInt(a.elements.tooltip.css("z-index"));e=6E3+c("div.qtip[qtip]").length-1;if(!a.status.focused&&d!==e){d=a.beforeFocus.call(a,b);if(d===!1)return a;c("div.qtip[qtip]").not(a.elements.tooltip).each(function(){if(c(this).qtip("api").status.rendered===!0)f=parseInt(c(this).css("z-index")),typeof f=="number"&&f>-1&&c(this).css({zIndex:parseInt(c(this).css("z-index"))-
1}),c(this).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;if(a.beforeDestroy.call(a)===!1)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(typeof a.elements.target.data("qtip")=="object"&&(d=a.elements.target.data("qtip").interfaces,typeof d=="object"&&d.length>0))for(b=0;b<d.length-1;b++)d[b].id==a.id&&d.splice(b,1);delete c.fn.qtip.interfaces[a.id];
typeof d=="object"&&d.length>0?a.elements.target.data("qtip").current=d.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=a.elements.tooltip.css("display")!=="none"?!1:!0)&&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")?!0:!1)&&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 w(){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; -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");this.elements.content=this.elements.contentWrapper.children("div:first").css(p(this.options.style));c.browser.msie&&this.elements.wrapper.add(this.elements.content).css({zoom:1});
this.options.hide.when.event=="unfocus"&&this.elements.tooltip.attr("unfocus",!0);typeof this.options.style.width.value=="number"&&this.updateWidth();c("<canvas>").get(0).getContext||c.browser.msie?(this.options.style.border.radius>0?C.call(this):this.elements.contentWrapper.css({border:this.options.style.border.width+"px solid "+this.options.style.border.color}),this.options.style.tip.corner!==!1&&x.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"));typeof this.options.content.text=="string"&&this.options.content.text.length>0||this.options.content.text.jquery&&this.options.content.text.length>0?b=this.options.content.text:typeof this.elements.target.attr("title")=="string"&&this.elements.target.attr("title").length>0?(b=this.elements.target.attr("title").replace("\\n",
"<br />"),this.elements.target.attr("title","")):typeof this.elements.target.attr("alt")=="string"&&this.elements.target.attr("alt").length>0?(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"));this.options.content.title.text!==!1&&D.call(this);this.updateContent(b);E.call(this);this.options.show.ready===!0&&this.show();if(this.options.content.url!==!1)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 C(){var b,e,d,a,h,l,m,f,g;b=this;b.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();d=b.options.style.border.width;a=b.options.style.border.radius;h=b.options.style.border.color||b.options.style.tip.color;l=t(a);m={};for(e in l)m[e]='<div rel="'+e+'" style="'+(e.search(/Left/)!==
-1?"left":"right")+":0; position:absolute; height:"+a+"px; width:"+a+'px; overflow:hidden; line-height:0.1px; font-size:1px">',c("<canvas>").get(0).getContext?m[e]+='<canvas height="'+a+'" width="'+a+'" style="vertical-align: top"></canvas>':c.browser.msie&&(f=a*2+3,m[e]+='<v:arc stroked="false" fillcolor="'+h+'" startangle="'+l[e][0]+'" endangle="'+l[e][1]+'" style="width:'+f+"px; height:"+f+"px; margin-top:"+(e.search(/bottom/)!==-1?-2:-1)+"px; margin-left:"+(e.search(/Right/)!==-1?l[e][2]-3.5:
-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'),m[e]+="</div>";e=b.getDimensions().width-Math.max(d,a)*2;e='<div class="qtip-betweenCorners" style="height:'+a+"px; width:"+e+"px; overflow:hidden; background-color:"+h+'; 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;">'+m.topLeft+m.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;">'+m.bottomLeft+m.bottomRight+e);c("<canvas>").get(0).getContext?b.elements.wrapper.find("canvas").each(function(){g=l[c(this).parent("[rel]:first").attr("rel")];u.call(b,c(this),g,a,h)}):c.browser.msie&&b.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>');b.elements.contentWrapper.css({border:"0px solid "+h,borderWidth:Math.max(d-a,0)+"px "+Math.max(a,a+(d-a))+"px"})}function u(b,c,d,a){b=b.get(0).getContext("2d");
b.fillStyle=a;b.beginPath();b.arc(c[0],c[1],d,0,Math.PI*2,!1);b.fill()}function x(b){var e,d,a,h;this.elements.tip!==null&&this.elements.tip.remove();e=this.options.style.tip.color||this.options.style.border.color;if(this.options.style.tip.corner!==!1){if(!b)b=this.options.style.tip.corner;d=r(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;">';c("<canvas>").get(0).getContext?this.elements.tip+='<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,h="m"+d[0][0]+","+d[0][1],h+=" l"+d[1][0]+","+d[1][1],h+=" "+d[2][0]+","+d[2][1],h+=" xe",this.elements.tip+='<v:shape fillcolor="'+e+'" stroked="false" filled="true" path="'+
h+'" 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:"+(b.search(/top/)!==-1?"bottom":"top")+'"></v:shape>',this.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>',this.elements.contentWrapper.css("position","relative"));this.elements.tooltip.prepend(this.elements.tip+"</div>");this.elements.tip=this.elements.tooltip.find("."+
this.options.style.classes.tip).eq(0);c("<canvas>").get(0).getContext&&s.call(this,this.elements.tip.find("canvas:first"),d,e);b.search(/top/)!==-1&&c.browser.msie&&parseInt(c.browser.version.charAt(0))===6&&this.elements.tip.css({marginTop:-4});v.call(this,b)}}function s(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 v(b){var e;this.options.style.tip.corner!==!1&&this.elements.tip&&(b||
(b=this.elements.tip.attr("rel")),e=positionAdjust=c.browser.msie?1:0,this.elements.tip.css(b.match(/left|right|top|bottom/)[0],0),b.search(/top|bottom/)!==-1?(c.browser.msie&&(positionAdjust=parseInt(c.browser.version.charAt(0))===6?b.search(/top/)!==-1?-3:1:b.search(/top/)!==-1?1:2),b.search(/Middle/)!==-1?this.elements.tip.css({left:"50%",marginLeft:-(this.options.style.tip.size.width/2)}):b.search(/Left/)!==-1?this.elements.tip.css({left:this.options.style.border.radius-e}):b.search(/Right/)!==
-1&&this.elements.tip.css({right:this.options.style.border.radius+e}),b.search(/top/)!==-1?this.elements.tip.css({top:-positionAdjust}):this.elements.tip.css({bottom:positionAdjust})):b.search(/left|right/)!==-1&&(c.browser.msie&&(positionAdjust=parseInt(c.browser.version.charAt(0))===6?1:b.search(/left/)!==-1?1:2),b.search(/Middle/)!==-1?this.elements.tip.css({top:"50%",marginTop:-(this.options.style.tip.size.height/2)}):b.search(/Top/)!==-1?this.elements.tip.css({top:this.options.style.border.radius-
e}):b.search(/Bottom/)!==-1&&this.elements.tip.css({bottom:this.options.style.border.radius+e}),b.search(/left/)!==-1?this.elements.tip.css({left:-positionAdjust}):this.elements.tip.css({right:positionAdjust})),b="padding-"+b.match(/left|right|top|bottom/)[0],e=this.options.style.tip.size[b.search(/left|right/)!==-1?"width":"height"],this.elements.tooltip.css("padding",0),this.elements.tooltip.css(b,e),c.browser.msie&&parseInt(c.browser.version.charAt(0))==6&&(b=parseInt(this.elements.tip.css("margin-top"))||
0,b+=parseInt(this.elements.content.css("margin-top"))||0,this.elements.tip.css({marginTop:b})))}function D(){var b=this;b.elements.title!==null&&b.elements.title.remove();b.elements.title=c('<div class="'+b.options.style.classes.title+'">').css(p(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);if(b.options.content.title.button!==!1&&typeof b.options.content.title.button==
"string")b.elements.button=c('<a class="'+b.options.style.classes.button+'" style="float:right; position: relative"></a>').css(p(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 E(){function b(a){if(d.status.disabled!==!0)d.options.hide.when.event=="inactive"&&(c(l).each(function(){h.bind(this+".qtip-inactive",m);d.elements.content.bind(this+".qtip-inactive",m)}),m()),clearTimeout(d.timers.show),
clearTimeout(d.timers.hide),d.timers.show=setTimeout(function(){d.show(a)},d.options.show.delay)}function e(a){if(d.status.disabled!==!0){if(d.options.hide.fixed===!0&&d.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&c(a.relatedTarget).parents("div.qtip[qtip]").length>0)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,h,l;d=this;a=d.options.show.when.target;h=d.options.hide.when.target;d.options.hide.fixed&&(h=h.add(d.elements.tooltip));if(d.options.hide.when.event=="inactive"){l=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];var m=function(a){if(d.status.disabled!==!0)clearTimeout(d.timers.inactive),d.timers.inactive=setTimeout(function(){c(l).each(function(){h.unbind(this+".qtip-inactive");d.elements.content.unbind(this+".qtip-inactive")});d.hide(a)},
d.options.hide.delay)}}else d.options.hide.fixed===!0&&d.elements.tooltip.bind("mouseover.qtip",function(){d.status.disabled!==!0&&clearTimeout(d.timers.hide)});d.options.show.when.target.add(d.options.hide.when.target).length===1&&d.options.show.when.event==d.options.hide.when.event&&d.options.hide.when.event!=="inactive"||d.options.hide.when.event=="unfocus"?(d.cache.toggle=0,a.bind(d.options.show.when.event+".qtip",function(a){d.cache.toggle==0?b(a):e(a)})):(a.bind(d.options.show.when.event+".qtip",
b),d.options.hide.when.event!=="inactive"&&h.bind(d.options.hide.when.event+".qtip",e));d.options.position.type.search(/(fixed|absolute)/)!==-1&&d.elements.tooltip.bind("mouseover.qtip",d.focus);d.options.position.target==="mouse"&&d.options.position.type!=="static"&&a.bind("mousemove.qtip",function(a){d.cache.mouse={x:a.pageX,y:a.pageY};d.status.disabled===!1&&d.options.position.adjust.mouse===!0&&d.options.position.type!=="static"&&d.elements.tooltip.css("display")!=="none"&&d.updatePosition(a)})}
function A(b,e,d){var a,h,l;if(d.corner=="center")return e.position;a=c.extend({},b);l={x:!1,y:!1};h={left:a.left<c.fn.qtip.cache.screen.scroll.left,right:a.left+d.dimensions.width+2>=c.fn.qtip.cache.screen.width+c.fn.qtip.cache.screen.scroll.left,top:a.top<c.fn.qtip.cache.screen.scroll.top,bottom:a.top+d.dimensions.height+2>=c.fn.qtip.cache.screen.height+c.fn.qtip.cache.screen.scroll.top};h={left:h.left&&(d.corner.search(/right/i)!=-1||d.corner.search(/right/i)==-1&&!h.right),right:h.right&&(d.corner.search(/left/i)!=
-1||d.corner.search(/left/i)==-1&&!h.left),top:h.top&&d.corner.search(/top/i)==-1,bottom:h.bottom&&d.corner.search(/bottom/i)==-1};if(h.left)a.left=this.options.position.target!=="mouse"?e.position.left+e.dimensions.width:this.cache.mouse.x,l.x="Left";else if(h.right)a.left=this.options.position.target!=="mouse"?e.position.left-d.dimensions.width:this.cache.mouse.x-d.dimensions.width,l.x="Right";if(h.top)a.top=this.options.position.target!=="mouse"?e.position.top+e.dimensions.height:this.cache.mouse.y,
l.y="top";else if(h.bottom)a.top=this.options.position.target!=="mouse"?e.position.top-d.dimensions.height:this.cache.mouse.y-d.dimensions.height,l.y="bottom";if(a.left<0)a.left=b.left,l.x=!1;if(a.top<0)a.top=b.top,l.y=!1;if(this.options.style.tip.corner!==!1){a.corner=new String(d.corner);if(l.x!==!1)a.corner=a.corner.replace(/Left|Right|Middle/,l.x);if(l.y!==!1)a.corner=a.corner.replace(/top|bottom/,l.y);a.corner!==this.elements.tip.attr("rel")&&x.call(this,a.corner)}return a}function p(b,e){var d,
a;d=c.extend(!0,{},b);for(a in d)e===!0&&a.search(/(tip|classes)/i)!==-1?delete d[a]:!e&&a.search(/(width|border|tip|title|classes|user)/i)!==-1&&delete d[a];return d}function y(b){if(typeof b.tip!=="object")b.tip={corner:b.tip};if(typeof b.tip.size!=="object")b.tip.size={width:b.tip.size,height:b.tip.size};if(typeof b.border!=="object")b.border={width:b.border};if(typeof b.width!=="object")b.width={value:b.width};if(typeof b.width.max=="string")b.width.max=parseInt(b.width.max.replace(/([0-9]+)/i,
"$1"));if(typeof b.width.min=="string")b.width.min=parseInt(b.width.min.replace(/([0-9]+)/i,"$1"));if(typeof b.tip.size.x=="number")b.tip.size.width=b.tip.size.x,delete b.tip.size.x;if(typeof b.tip.size.y=="number")b.tip.size.height=b.tip.size.y,delete b.tip.size.y;return b}function q(){var b,e;e=[!0,{}];for(b=0;b<arguments.length;b++)e.push(arguments[b]);for(b=[c.extend.apply(c,e)];typeof b[0].name=="string";)b.unshift(y(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;b.tip.size.width%2>0&&(b.tip.size.width+=1);b.tip.size.height%2>0&&(b.tip.size.height+=1);if(b.tip.corner===!0)b.tip.corner=this.options.position.corner.tooltip==="center"?!1:this.options.position.corner.tooltip;return b}function r(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 t(b){var e;c("<canvas>").get(0).getContext?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}function B(){var b;b=this.getDimensions();
this.elements.bgiframe=this.elements.wrapper.prepend('<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+b.height+"px; width:"+b.width+'px" />').children(".qtip-bgiframe:first")}c.fn.qtip=function(b,e){var d,a,h,l,m,f,g,j;if(typeof b=="string")if(typeof c(this).data("qtip")!=="object"&&c.fn.qtip.log.error.call(self,1,c.fn.qtip.constants.NO_TOOLTIP_PRESENT,
!1),b=="api")return c(this).data("qtip").interfaces[c(this).data("qtip").current];else{if(b=="interfaces")return c(this).data("qtip").interfaces}else{b||(b={});if(typeof b.content!=="object"||b.content.jquery&&b.content.length>0)b.content={text:b.content};if(typeof b.content.title!=="object")b.content.title={text:b.content.title};if(typeof b.position!=="object")b.position={corner:b.position};if(typeof b.position.corner!=="object")b.position.corner={target:b.position.corner,tooltip:b.position.corner};
if(typeof b.show!=="object")b.show={when:b.show};if(typeof b.show.when!=="object")b.show.when={event:b.show.when};if(typeof b.show.effect!=="object")b.show.effect={type:b.show.effect};if(typeof b.hide!=="object")b.hide={when:b.hide};if(typeof b.hide.when!=="object")b.hide.when={event:b.hide.when};if(typeof b.hide.effect!=="object")b.hide.effect={type:b.hide.effect};if(typeof b.style!=="object")b.style={name:b.style};b.style=y(b.style);l=c.extend(!0,{},c.fn.qtip.defaults,b);l.style=q.call({options:l},
l.style);l.user=c.extend(!0,{},b)}return c(this).each(function(){if(typeof b=="string"){if(f=b.toLowerCase(),h=c(this).qtip("interfaces"),typeof h=="object")if(e===!0&&f=="destroy")for(;h.length>0;)h[h.length-1].destroy();else{e!==!0&&(h=[c(this).qtip("api")]);for(d=0;d<h.length;d++)f=="destroy"?h[d].destroy():h[d].status.rendered===!0&&(f=="show"?h[d].show():f=="hide"?h[d].hide():f=="focus"?h[d].focus():f=="disable"?h[d].disable(!0):f=="enable"&&h[d].disable(!1))}}else{g=c.extend(!0,{},l);g.hide.effect.length=
l.hide.effect.length;g.show.effect.length=l.show.effect.length;if(g.position.container===!1)g.position.container=c(document.body);if(g.position.target===!1)g.position.target=c(this);if(g.show.when.target===!1)g.show.when.target=c(this);if(g.hide.when.target===!1)g.hide.when.target=c(this);a=c.fn.qtip.interfaces.length;for(d=0;d<a;d++)if(typeof c.fn.qtip.interfaces[d]=="undefined"){a=d;break}m=new z(c(this),g,a);c.fn.qtip.interfaces[a]=m;if(typeof c(this).data("qtip")=="object")if(typeof c(this).data("qtip")===
"object"&&c(this).data("qtip")){if(typeof c(this).attr("qtip")==="undefined")c(this).data("qtip").current=c(this).data("qtip").interfaces.length;c(this).data("qtip").interfaces.push(m)}else c(this).data("qtip",{current:0,interfaces:[m]});g.content.prerender===!1&&g.show.when.event!==!1&&g.show.ready!==!0?g.show.when.target.bind(g.show.when.event+".qtip-"+a+"-create",{qtip:a},function(a){j=c.fn.qtip.interfaces[a.data.qtip];j.options.show.when.target.unbind(j.options.show.when.event+".qtip-"+a.data.qtip+
"-create");j.cache.mouse={x:a.pageX,y:a.pageY};w.call(j);j.options.show.when.target.trigger(j.options.show.when.event)}):(m.cache.mouse={x:g.show.when.target.offset().left,y:g.show.when.target.offset().top},w.call(m))}})};c(document).ready(function(){c.fn.qtip.cache={screen:{scroll:{left:c(window).scrollLeft(),top:c(window).scrollTop()},width:c(window).width(),height:c(window).height()}};var b;c(window).bind("resize scroll",function(e){clearTimeout(b);b=setTimeout(function(){e.type==="scroll"?c.fn.qtip.cache.screen.scroll=
{left:c(window).scrollLeft(),top:c(window).scrollTop()}:(c.fn.qtip.cache.screen.width=c(window).width(),c.fn.qtip.cache.screen.height=c(window).height());for(i=0;i<c.fn.qtip.interfaces.length;i++){var b=c.fn.qtip.interfaces[i];b.status.rendered===!0&&(b.options.position.type!=="static"||b.options.position.adjust.scroll&&e.type==="scroll"||b.options.position.adjust.resize&&e.type==="resize")&&b.updatePosition(e,!0)}},100)});c(document).bind("mousedown.qtip",function(b){c(b.target).parents("div.qtip").length===
0&&c(".qtip[unfocus]").each(function(){var d=c(this).qtip("api");c(this).is(":visible")&&!d.status.disabled&&c(b.target).add(d.elements.target).length>1&&d.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:0,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:350},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);
