/*
 * 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(a){function b(b,c,d){var f=this;f.id=d,f.options=c,f.status={animated:!1,rendered:!1,disabled:!1,focused:!1},f.elements={target:b.addClass(f.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null},f.cache={mouse:{},position:{},toggle:0},f.timers={},a.extend(f,f.options.api,{show:function(b){function e(){f.options.position.type!=="static"&&f.focus(),f.onShow.call(f,b),a.browser.msie&&f.elements.tooltip.get(0).style.removeAttribute("filter")}var c,d;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show");if(f.elements.tooltip.css("display")!=="none")return f;f.elements.tooltip.stop(!0,!1),c=f.beforeShow.call(f,b);if(c===!1)return f;f.cache.toggle=1,f.options.position.type!=="static"&&f.updatePosition(b,f.options.show.effect.length>0),typeof f.options.show.solo=="object"?d=a(f.options.show.solo):f.options.show.solo===!0&&(d=a("div.qtip").not(f.elements.tooltip)),d&&d.each(function(){a(this).qtip("api").status.rendered===!0&&a(this).qtip("api").hide()});if(typeof f.options.show.effect.type=="function")f.options.show.effect.type.call(f.elements.tooltip,f.options.show.effect.length),f.elements.tooltip.queue(function(){e(),a(this).dequeue()});else{switch(f.options.show.effect.type.toLowerCase()){case"fade":f.elements.tooltip.fadeIn(f.options.show.effect.length,e);break;case"slide":f.elements.tooltip.slideDown(f.options.show.effect.length,function(){e(),f.options.position.type!=="static"&&f.updatePosition(b,!0)});break;case"grow":f.elements.tooltip.show(f.options.show.effect.length,e);break;default:f.elements.tooltip.show(null,e)}f.elements.tooltip.addClass(f.options.style.classes.active)}return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(b){function d(){f.onHide.call(f,b)}var c;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide");if(f.elements.tooltip.css("display")==="none")return f;clearTimeout(f.timers.show),f.elements.tooltip.stop(!0,!1),c=f.beforeHide.call(f,b);if(c===!1)return f;f.cache.toggle=0;if(typeof f.options.hide.effect.type=="function")f.options.hide.effect.type.call(f.elements.tooltip,f.options.hide.effect.length),f.elements.tooltip.queue(function(){d(),a(this).dequeue()});else{switch(f.options.hide.effect.type.toLowerCase()){case"fade":f.elements.tooltip.fadeOut(f.options.hide.effect.length,d);break;case"slide":f.elements.tooltip.slideUp(f.options.hide.effect.length,d);break;case"grow":f.elements.tooltip.hide(f.options.hide.effect.length,d);break;default:f.elements.tooltip.hide(null,d)}f.elements.tooltip.removeClass(f.options.style.classes.active)}return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(b,c){var d,e,g,h,i,j,k,m,n,o,p,q,t,u;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition");if(f.options.position.type=="static")return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition");e={position:{left:0,top:0},dimensions:{height:0,width:0},corner:f.options.position.corner.target},g={position:f.getPosition(),dimensions:f.getDimensions(),corner:f.options.position.corner.tooltip};if(f.options.position.target!=="mouse"){if(f.options.position.target.get(0).nodeName.toLowerCase()=="area"){h=f.options.position.target.attr("coords").split(",");for(d=0;d<h.length;d++)h[d]=parseInt(h[d]);i=f.options.position.target.parent("map").attr("name"),j=a('img[usemap="#'+i+'"]:first').offset(),e.position={left:Math.floor(j.left+h[0]),top:Math.floor(j.top+h[1])};switch(f.options.position.target.attr("shape").toLowerCase()){case"rect":e.dimensions={width:Math.ceil(Math.abs(h[2]-h[0])),height:Math.ceil(Math.abs(h[3]-h[1]))};break;case"circle":e.dimensions={width:h[2]+1,height:h[2]+1};break;case"poly":e.dimensions={width:h[0],height:h[1]};for(d=0;d<h.length;d++)d%2==0?(h[d]>e.dimensions.width&&(e.dimensions.width=h[d]),h[d]<h[0]&&(e.position.left=Math.floor(j.left+h[d]))):(h[d]>e.dimensions.height&&(e.dimensions.height=h[d]),h[d]<h[1]&&(e.position.top=Math.floor(j.top+h[d])));e.dimensions.width=e.dimensions.width-(e.position.left-j.left),e.dimensions.height=e.dimensions.height-(e.position.top-j.top);break;default:return a.fn.qtip.log.error.call(f,4,a.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition")}e.dimensions.width-=2,e.dimensions.height-=2}else f.options.position.target.add(document.body).length===1?(e.position={left:a(document).scrollLeft(),top:a(document).scrollTop()},e.dimensions={height:a(window).height(),width:a(window).width()}):(typeof f.options.position.target.attr("qtip")!="undefined"?e.position=f.options.position.target.qtip("api").cache.position:e.position=f.options.position.target.offset(),e.dimensions={height:f.options.position.target.outerHeight(),width:f.options.position.target.outerWidth()});k=a.extend({},e.position),e.corner.search(/right/i)!==-1&&(k.left+=e.dimensions.width),e.corner.search(/bottom/i)!==-1&&(k.top+=e.dimensions.height),e.corner.search(/((top|bottom)Middle)|center/)!==-1&&(k.left+=e.dimensions.width/2),e.corner.search(/((left|right)Middle)|center/)!==-1&&(k.top+=e.dimensions.height/2)}else e.position=k={left:f.cache.mouse.x,top:f.cache.mouse.y},e.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),m=a.browser.msie?1:0,n=a.browser.msie&&parseInt(a.browser.version.charAt(0))===6?1:0,f.options.style.border.radius>0&&(g.corner.search(/Left/)!==-1?k.left-=f.options.style.border.radius:g.corner.search(/Right/)!==-1&&(k.left+=f.options.style.border.radius),g.corner.search(/Top/)!==-1?k.top-=f.options.style.border.radius:g.corner.search(/Bottom/)!==-1&&(k.top+=f.options.style.border.radius)),m&&(g.corner.search(/top/)!==-1?k.top-=m:g.corner.search(/bottom/)!==-1&&(k.top+=m),g.corner.search(/left/)!==-1?k.left-=m:g.corner.search(/right/)!==-1&&(k.left+=m),g.corner.search(/leftMiddle|rightMiddle/)!==-1&&(k.top-=1)),f.options.position.adjust.screen===!0&&(k=l.call(f,k,e,g)),f.options.position.target==="mouse"&&f.options.position.adjust.mouse===!0&&(f.options.position.adjust.screen===!0&&f.elements.tip?p=f.elements.tip.attr("rel"):p=f.options.position.corner.tooltip,k.left+=p.search(/right/i)!==-1?-6:6,k.top+=p.search(/bottom/i)!==-1?-6:6),!f.elements.bgiframe&&a.browser.msie&&parseInt(a.browser.version.charAt(0))==6&&a("select, object").each(function(){q=a(this).offset(),q.bottom=q.top+a(this).height(),q.right=q.left+a(this).width(),k.top+g.dimensions.height>=q.top&&k.left+g.dimensions.width>=q.left&&r.call(f)}),k.left+=f.options.position.adjust.x,k.top+=f.options.position.adjust.y,t=f.getPosition();if(k.left!=t.left||k.top!=t.top){u=f.beforePositionUpdate.call(f,b);if(u===!1)return f;f.cache.position=k,c===!0?(f.status.animated=!0,f.elements.tooltip.animate(k,200,"swing",function(){f.status.animated=!1})):f.elements.tooltip.css(k),f.onPositionUpdate.call(f,b),typeof b!="undefined"&&b.type&&b.type!=="mousemove"&&a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}return f},updateWidth:function(b){var c;return f.status.rendered?b&&typeof b!="number"?a.fn.qtip.log.error.call(f,2,"newWidth must be of type number","updateWidth"):(c=f.elements.contentWrapper.siblings().add(f.elements.tip).add(f.elements.button),b||(typeof f.options.style.width.value=="number"?b=f.options.style.width.value:(f.elements.tooltip.css({width:"auto"}),c.hide(),a.browser.msie&&f.elements.wrapper.add(f.elements.contentWrapper.children()).css({zoom:"normal"}),b=f.getDimensions().width+1,f.options.style.width.value||(b>f.options.style.width.max&&(b=f.options.style.width.max),b<f.options.style.width.min&&(b=f.options.style.width.min)))),b%2!==0&&(b-=1),f.elements.tooltip.width(b),c.show(),f.options.style.border.radius&&f.elements.tooltip.find(".qtip-betweenCorners").each(function(c){a(this).width(b-f.options.style.border.radius*2)}),a.browser.msie&&(f.elements.wrapper.add(f.elements.contentWrapper.children()).css({zoom:"1"}),f.elements.wrapper.width(b),f.elements.bgiframe&&f.elements.bgiframe.width(b).height(f.getDimensions.height)),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")},updateStyle:function(b){var c,d,h,i,j;return f.status.rendered?typeof b!="string"||!a.fn.qtip.styles[b]?a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle"):(f.options.style=o.call(f,a.fn.qtip.styles[b],f.options.user.style),f.elements.content.css(m(f.options.style)),f.options.content.title.text!==!1&&f.elements.title.css(m(f.options.style.title,!0)),f.elements.contentWrapper.css({borderColor:f.options.style.border.color}),f.options.style.tip.corner!==!1&&(a("<canvas>").get(0).getContext?(c=f.elements.tooltip.find(".qtip-tip canvas:first"),h=c.get(0).getContext("2d"),h.clearRect(0,0,300,300),i=c.parent("div[rel]:first").attr("rel"),j=p(i,f.options.style.tip.size.width,f.options.style.tip.size.height),g.call(f,c,j,f.options.style.tip.color||f.options.style.border.color)):a.browser.msie&&(c=f.elements.tooltip.find('.qtip-tip [nodeName="shape"]'),c.attr("fillcolor",f.options.style.tip.color||f.options.style.border.color))),f.options.style.border.radius>0&&(f.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:f.options.style.border.color}),a("<canvas>").get(0).getContext?(d=q(f.options.style.border.radius),f.elements.tooltip.find(".qtip-wrapper canvas").each(function(){h=a(this).get(0).getContext("2d"),h.clearRect(0,0,300,300),i=a(this).parent("div[rel]:first").attr("rel"),e.call(f,a(this),d[i],f.options.style.border.radius,f.options.style.border.color)})):a.browser.msie&&f.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){a(this).attr("fillcolor",f.options.style.border.color)})),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")},updateContent:function(b,c){function i(){f.updateWidth(),c!==!1&&(f.options.position.type!=="static"&&f.updatePosition(f.elements.tooltip.is(":visible"),!0),f.options.style.tip.corner!==!1&&h.call(f))}var d,e,g;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent");if(!b)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent");d=f.beforeContentUpdate.call(f,b);if(typeof d=="string")b=d;else if(d===!1)return;return a.browser.msie&&f.elements.contentWrapper.children().css({zoom:"normal"}),b.jquery&&b.length>0?b.clone(!0).appendTo(f.elements.content).show():f.elements.content.html(b),e=f.elements.content.find("img[complete=false]"),e.length>0?(g=0,e.each(function(b){a('<img src="'+a(this).attr("src")+'" />').load(function(){++g==e.length&&i()})})):i(),f.onContentUpdate.call(f),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(b,c,d){function g(b){f.onContentLoad.call(f),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent"),f.updateContent(b)}var e;return f.status.rendered?(e=f.beforeContentLoad.call(f),e===!1?f:(d=="post"?a.post(b,c,g):a.get(b,c,g),f)):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")},updateTitle:function(b){return f.status.rendered?b?(returned=f.beforeTitleUpdate.call(f),returned===!1?f:(f.elements.button&&(f.elements.button=f.elements.button.clone(!0)),f.elements.title.html(b),f.elements.button&&f.elements.title.prepend(f.elements.button),f.onTitleUpdate.call(f),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle"))):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle"):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")},focus:function(b){var c,d,e,g;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus");if(f.options.position.type=="static")return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus");c=parseInt(f.elements.tooltip.css("z-index")),d=6e3+a("div.qtip[qtip]").length-1;if(!f.status.focused&&c!==d){g=f.beforeFocus.call(f,b);if(g===!1)return f;a("div.qtip[qtip]").not(f.elements.tooltip).each(function(){a(this).qtip("api").status.rendered===!0&&(e=parseInt(a(this).css("z-index")),typeof e=="number"&&e>-1&&a(this).css({zIndex:parseInt(a(this).css("z-index"))-1}),a(this).qtip("api").status.focused=!1)}),f.elements.tooltip.css({zIndex:d}),f.status.focused=!0,f.onFocus.call(f,b),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_FOCUSED,"focus")}return f},disable:function(b){return f.status.rendered?(b?f.status.disabled?a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable"):(f.status.disabled=!0,a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_DISABLED,"disable")):f.status.disabled?(f.status.disabled=!1,a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_ENABLED,"disable")):a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable"),f):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")},destroy:function(){var b,c,d;c=f.beforeDestroy.call(f);if(c===!1)return f;f.status.rendered?(f.options.show.when.target.unbind("mousemove.qtip",f.updatePosition),f.options.show.when.target.unbind("mouseout.qtip",f.hide),f.options.show.when.target.unbind(f.options.show.when.event+".qtip"),f.options.hide.when.target.unbind(f.options.hide.when.event+".qtip"),f.elements.tooltip.unbind(f.options.hide.when.event+".qtip"),f.elements.tooltip.unbind("mouseover.qtip",f.focus),f.elements.tooltip.remove()):f.options.show.when.target.unbind(f.options.show.when.event+".qtip-create");if(typeof f.elements.target.data("qtip")=="object"){d=f.elements.target.data("qtip").interfaces;if(typeof d=="object"&&d.length>0)for(b=0;b<d.length-1;b++)d[b].id==f.id&&d.splice(b,1)}return delete a.fn.qtip.interfaces[f.id],typeof d=="object"&&d.length>0?f.elements.target.data("qtip").current=d.length-1:f.elements.target.removeData("qtip"),f.onDestroy.call(f),a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_DESTROYED,"destroy"),f.elements.target},getPosition:function(){var b,c;return f.status.rendered?(b=f.elements.tooltip.css("display")!=="none"?!1:!0,b&&f.elements.tooltip.css({visiblity:"hidden"}).show(),c=f.elements.tooltip.offset(),b&&f.elements.tooltip.css({visiblity:"visible"}).hide(),c):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")},getDimensions:function(){var b,c;return f.status.rendered?(b=f.elements.tooltip.is(":visible")?!1:!0,b&&f.elements.tooltip.css({visiblity:"hidden"}).show(),c={height:f.elements.tooltip.outerHeight(),width:f.elements.tooltip.outerWidth()},b&&f.elements.tooltip.css({visiblity:"visible"}).hide(),c):a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}})}function c(){var b,c,e,g,h,i,l;b=this,b.beforeRender.call(b),b.status.rendered=!0,b.elements.tooltip='<div qtip="'+b.id+'" class="qtip '+(b.options.style.classes.tooltip||b.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+b.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 '+b.options.style.classes.content+'"></div></div></div></div>',b.elements.tooltip=a(b.elements.tooltip),b.elements.tooltip.appendTo(b.options.position.container),b.elements.tooltip.data("qtip",{current:0,interfaces:[b]}),b.elements.wrapper=b.elements.tooltip.children("div:first"),b.elements.contentWrapper=b.elements.wrapper.children("div:first").css({background:b.options.style.background}),b.elements.content=b.elements.contentWrapper.children("div:first").css(m(b.options.style)),a.browser.msie&&b.elements.wrapper.add(b.elements.content).css({zoom:1}),b.options.hide.when.event=="unfocus"&&b.elements.tooltip.attr("unfocus",!0),typeof b.options.style.width.value=="number"&&b.updateWidth(),a("<canvas>").get(0).getContext||a.browser.msie?(b.options.style.border.radius>0?d.call(b):b.elements.contentWrapper.css({border:b.options.style.border.width+"px solid "+b.options.style.border.color}),b.options.style.tip.corner!==!1&&f.call(b)):(b.elements.contentWrapper.css({border:b.options.style.border.width+"px solid "+b.options.style.border.color}),b.options.style.border.radius=0,b.options.style.tip.corner=!1,a.fn.qtip.log.error.call(b,2,a.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")),typeof b.options.content.text=="string"&&b.options.content.text.length>0||b.options.content.text.jquery&&b.options.content.text.length>0?e=b.options.content.text:typeof b.elements.target.attr("title")=="string"&&b.elements.target.attr("title").length>0?(e=b.elements.target.attr("title").replace("\\n","<br />"),b.elements.target.attr("title","")):typeof b.elements.target.attr("alt")=="string"&&b.elements.target.attr("alt").length>0?(e=b.elements.target.attr("alt").replace("\\n","<br />"),b.elements.target.attr("alt","")):(e=" ",a.fn.qtip.log.error.call(b,1,a.fn.qtip.constants.NO_VALID_CONTENT,"render")),b.options.content.title.text!==!1&&j.call(b),b.updateContent(e),k.call(b),b.options.show.ready===!0&&b.show(),b.options.content.url!==!1&&(g=b.options.content.url,h=b.options.content.data,i=b.options.content.method||"get",b.loadContent(g,h,i)),b.onRender.call(b),a.fn.qtip.log.error.call(b,1,a.fn.qtip.constants.EVENT_RENDERED,"render")}function d(){var b,c,d,f,g,h,i,j,k,l,m,n,o,p,r;b=this,b.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove(),d=b.options.style.border.width,f=b.options.style.border.radius,g=b.options.style.border.color||b.options.style.tip.color,h=q(f),i={};for(c in h)i[c]='<div rel="'+c+'" style="'+(c.search(/Left/)!==-1?"left":"right")+":0; position:absolute; height:"+f+"px; width:"+f+'px; overflow:hidden; line-height:0.1px; font-size:1px">',a("<canvas>").get(0).getContext?i[c]+='<canvas height="'+f+'" width="'+f+'" style="vertical-align: top"></canvas>':a.browser.msie&&(j=f*2+3,i[c]+='<v:arc stroked="false" fillcolor="'+g+'" startangle="'+h[c][0]+'" endangle="'+h[c][1]+'" style="width:'+j+"px; height:"+j+"px; margin-top:"+(c.search(/bottom/)!==-1?-2:-1)+"px; margin-left:"+(c.search(/Right/)!==-1?h[c][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'),i[c]+="</div>";k=b.getDimensions().width-Math.max(d,f)*2,l='<div class="qtip-betweenCorners" style="height:'+f+"px; width:"+k+"px; overflow:hidden; background-color:"+g+'; line-height:0.1px; font-size:1px;">',m='<div class="qtip-borderTop" dir="ltr" style="height:'+f+"px; margin-left:"+f+'px; line-height:0.1px; font-size:1px; padding:0;">'+i.topLeft+i.topRight+l,b.elements.wrapper.prepend(m),n='<div class="qtip-borderBottom" dir="ltr" style="height:'+f+"px; margin-left:"+f+'px; line-height:0.1px; font-size:1px; padding:0;">'+i.bottomLeft+i.bottomRight+l,b.elements.wrapper.append(n),a("<canvas>").get(0).getContext?b.elements.wrapper.find("canvas").each(function(){o=h[a(this).parent("[rel]:first").attr("rel")],e.call(b,a(this),o,f,g)}):a.browser.msie&&b.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>'),p=Math.max(f,f+(d-f)),r=Math.max(d-f,0),b.elements.contentWrapper.css({border:"0px solid "+g,borderWidth:r+"px "+p+"px"})}function e(a,b,c,d){var e=a.get(0).getContext("2d");e.fillStyle=d,e.beginPath(),e.arc(b[0],b[1],c,0,Math.PI*2,!1),e.fill()}function f(b){var c,d,e,f,i;c=this,c.elements.tip!==null&&c.elements.tip.remove(),d=c.options.style.tip.color||c.options.style.border.color;if(c.options.style.tip.corner===!1)return;b||(b=c.options.style.tip.corner),e=p(b,c.options.style.tip.size.width,c.options.style.tip.size.height),c.elements.tip='<div class="'+c.options.style.classes.tip+'" dir="ltr" rel="'+b+'" style="position:absolute; height:'+c.options.style.tip.size.height+"px; width:"+c.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">',a("<canvas>").get(0).getContext?c.elements.tip+='<canvas height="'+c.options.style.tip.size.height+'" width="'+c.options.style.tip.size.width+'"></canvas>':a.browser.msie&&(f=c.options.style.tip.size.width+","+c.options.style.tip.size.height,i="m"+e[0][0]+","+e[0][1],i+=" l"+e[1][0]+","+e[1][1],i+=" "+e[2][0]+","+e[2][1],i+=" xe",c.elements.tip+='<v:shape fillcolor="'+d+'" stroked="false" filled="true" path="'+i+'" coordsize="'+f+'" style="width:'+c.options.style.tip.size.width+"px; height:"+c.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>',c.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>',c.elements.contentWrapper.css("position","relative")),c.elements.tooltip.prepend(c.elements.tip+"</div>"),c.elements.tip=c.elements.tooltip.find("."+c.options.style.classes.tip).eq(0),a("<canvas>").get(0).getContext&&g.call(c,c.elements.tip.find("canvas:first"),e,d),b.search(/top/)!==-1&&a.browser.msie&&parseInt(a.browser.version.charAt(0))===6&&c.elements.tip.css({marginTop:-4}),h.call(c,b)}function g(a,b,c){var d=a.get(0).getContext("2d");d.fillStyle=c,d.beginPath(),d.moveTo(b[0][0],b[0][1]),d.lineTo(b[1][0],b[1][1]),d.lineTo(b[2][0],b[2][1]),d.fill()}function h(b){var c,d,e,f,g;c=this;if(c.options.style.tip.corner===!1||!c.elements.tip)return;b||(b=c.elements.tip.attr("rel")),d=positionAdjust=a.browser.msie?1:0,c.elements.tip.css(b.match(/left|right|top|bottom/)[0],0),b.search(/top|bottom/)!==-1?(a.browser.msie&&(parseInt(a.browser.version.charAt(0))===6?positionAdjust=b.search(/top/)!==-1?-3:1:positionAdjust=b.search(/top/)!==-1?1:2),b.search(/Middle/)!==-1?c.elements.tip.css({left:"50%",marginLeft:-(c.options.style.tip.size.width/2)}):b.search(/Left/)!==-1?c.elements.tip.css({left:c.options.style.border.radius-d}):b.search(/Right/)!==-1&&c.elements.tip.css({right:c.options.style.border.radius+d}),b.search(/top/)!==-1?c.elements.tip.css({top:-positionAdjust}):c.elements.tip.css({bottom:positionAdjust})):b.search(/left|right/)!==-1&&(a.browser.msie&&(positionAdjust=parseInt(a.browser.version.charAt(0))===6?1:b.search(/left/)!==-1?1:2),b.search(/Middle/)!==-1?c.elements.tip.css({top:"50%",marginTop:-(c.options.style.tip.size.height/2)}):b.search(/Top/)!==-1?c.elements.tip.css({top:c.options.style.border.radius-d}):b.search(/Bottom/)!==-1&&c.elements.tip.css({bottom:c.options.style.border.radius+d}),b.search(/left/)!==-1?c.elements.tip.css({left:-positionAdjust}):c.elements.tip.css({right:positionAdjust})),e="padding-"+b.match(/left|right|top|bottom/)[0],f=c.options.style.tip.size[e.search(/left|right/)!==-1?"width":"height"],c.elements.tooltip.css("padding",0),c.elements.tooltip.css(e,f),a.browser.msie&&parseInt(a.browser.version.charAt(0))==6&&(g=parseInt(c.elements.tip.css("margin-top"))||0,g+=parseInt(c.elements.content.css("margin-top"))||0,c.elements.tip.css({marginTop:g}))}function j(){var b=this;b.elements.title!==null&&b.elements.title.remove(),b.elements.title=a('<div class="'+b.options.style.classes.title+'">').css(m(b.options.style.title,!0)).css({zoom:a.browser.msie?1:0}).prependTo(b.elements.contentWrapper),b.options.content.title.text&&b.updateTitle.call(b,b.options.content.title.text),b.options.content.title.button!==!1&&typeof b.options.content.title.button=="string"&&(b.elements.button=a('<a class="'+b.options.style.classes.button+'" style="float:right; position: relative"></a>').css(m(b.options.style.button,!0)).html(b.options.content.title.button).prependTo(b.elements.title).click(function(a){b.status.disabled||b.hide(a)}))}function k(){function g(c){if(b.status.disabled===!0)return;b.options.hide.when.event=="inactive"&&(a(e).each(function(){d.bind(this+".qtip-inactive",f),b.elements.content.bind(this+".qtip-inactive",f)}),f()),clearTimeout(b.timers.show),clearTimeout(b.timers.hide),b.timers.show=setTimeout(function(){b.show(c)},b.options.show.delay)}function h(c){if(b.status.disabled===!0)return;if(b.options.hide.fixed===!0&&b.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&a(c.relatedTarget).parents("div.qtip[qtip]").length>0)return c.stopPropagation(),c.preventDefault(),clearTimeout(b.timers.hide),!1;clearTimeout(b.timers.show),clearTimeout(b.timers.hide),b.elements.tooltip.stop(!0,!0),b.timers.hide=setTimeout(function(){b.hide(c)},b.options.hide.delay)}var b,c,d,e;b=this,c=b.options.show.when.target,d=b.options.hide.when.target,b.options.hide.fixed&&(d=d.add(b.elements.tooltip));if(b.options.hide.when.event=="inactive"){e=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function f(c){if(b.status.disabled===!0)return;clearTimeout(b.timers.inactive),b.timers.inactive=setTimeout(function(){a(e).each(function(){d.unbind(this+".qtip-inactive"),b.elements.content.unbind(this+".qtip-inactive")}),b.hide(c)},b.options.hide.delay)}}else b.options.hide.fixed===!0&&b.elements.tooltip.bind("mouseover.qtip",function(){if(b.status.disabled===!0)return;clearTimeout(b.timers.hide)});b.options.show.when.target.add(b.options.hide.when.target).length===1&&b.options.show.when.event==b.options.hide.when.event&&b.options.hide.when.event!=="inactive"||b.options.hide.when.event=="unfocus"?(b.cache.toggle=0,c.bind(b.options.show.when.event+".qtip",function(a){b.cache.toggle==0?g(a):h(a)})):(c.bind(b.options.show.when.event+".qtip",g),b.options.hide.when.event!=="inactive"&&d.bind(b.options.hide.when.event+".qtip",h)),b.options.position.type.search(/(fixed|absolute)/)!==-1&&b.elements.tooltip.bind("mouseover.qtip",b.focus),b.options.position.target==="mouse"&&b.options.position.type!=="static"&&c.bind("mousemove.qtip",function(a){b.cache.mouse={x:a.pageX,y:a.pageY},b.status.disabled===!1&&b.options.position.adjust.mouse===!0&&b.options.position.type!=="static"&&b.elements.tooltip.css("display")!=="none"&&b.updatePosition(a)})}function l(b,c,d){var e,g,h,i,j,k;return e=this,d.corner=="center"?c.position:(g=a.extend({},b),i={x:!1,y:!1},j={left:g.left<a.fn.qtip.cache.screen.scroll.left,right:g.left+d.dimensions.width+2>=a.fn.qtip.cache.screen.width+a.fn.qtip.cache.screen.scroll.left,top:g.top<a.fn.qtip.cache.screen.scroll.top,bottom:g.top+d.dimensions.height+2>=a.fn.qtip.cache.screen.height+a.fn.qtip.cache.screen.scroll.top},h={left:j.left&&(d.corner.search(/right/i)!=-1||d.corner.search(/right/i)==-1&&!j.right),right:j.right&&(d.corner.search(/left/i)!=-1||d.corner.search(/left/i)==-1&&!j.left),top:j.top&&d.corner.search(/top/i)==-1,bottom:j.bottom&&d.corner.search(/bottom/i)==-1},h.left?(e.options.position.target!=="mouse"?g.left=c.position.left+c.dimensions.width:g.left=e.cache.mouse.x,i.x="Left"):h.right&&(e.options.position.target!=="mouse"?g.left=c.position.left-d.dimensions.width:g.left=e.cache.mouse.x-d.dimensions.width,i.x="Right"),h.top?(e.options.position.target!=="mouse"?g.top=c.position.top+c.dimensions.height:g.top=e.cache.mouse.y,i.y="top"):h.bottom&&(e.options.position.target!=="mouse"?g.top=c.position.top-d.dimensions.height:g.top=e.cache.mouse.y-d.dimensions.height,i.y="bottom"),g.left<0&&(g.left=b.left,i.x=!1),g.top<0&&(g.top=b.top,i.y=!1),e.options.style.tip.corner!==!1&&(g.corner=new String(d.corner),i.x!==!1&&(g.corner=g.corner.replace(/Left|Right|Middle/,i.x)),i.y!==!1&&(g.corner=g.corner.replace(/top|bottom/,i.y)),g.corner!==e.elements.tip.attr("rel")&&f.call(e,g.corner)),g)}function m(b,c){var d,e;d=a.extend(!0,{},b);for(e in d)c===!0&&e.search(/(tip|classes)/i)!==-1?delete d[e]:!c&&e.search(/(width|border|tip|title|classes|user)/i)!==-1&&delete d[e];return d}function n(a){return typeof a.tip!="object"&&(a.tip={corner:a.tip}),typeof a.tip.size!="object"&&(a.tip.size={width:a.tip.size,height:a.tip.size}),typeof a.border!="object"&&(a.border={width:a.border}),typeof a.width!="object"&&(a.width={value:a.width}),typeof a.width.max=="string"&&(a.width.max=parseInt(a.width.max.replace(/([0-9]+)/i,"$1"))),typeof a.width.min=="string"&&(a.width.min=parseInt(a.width.min.replace(/([0-9]+)/i,"$1"))),typeof a.tip.size.x=="number"&&(a.tip.size.width=a.tip.size.x,delete a.tip.size.x),typeof a.tip.size.y=="number"&&(a.tip.size.height=a.tip.size.y,delete a.tip.size.y),a}function o(){var b,c,d,e,f,g;b=this,d=[!0,{}];for(c=0;c<arguments.length;c++)d.push(arguments[c]);e=[a.extend.apply(a,d)];while(typeof e[0].name=="string")e.unshift(n(a.fn.qtip.styles[e[0].name]));return e.unshift(!0,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},a.fn.qtip.styles.defaults),f=a.extend.apply(a,e),g=a.browser.msie?1:0,f.tip.size.width+=g,f.tip.size.height+=g,f.tip.size.width%2>0&&(f.tip.size.width+=1),f.tip.size.height%2>0&&(f.tip.size.height+=1),f.tip.corner===!0&&(f.tip.corner=b.options.position.corner.tooltip==="center"?!1:b.options.position.corner.tooltip),f}function p(a,b,c){var d={bottomRight:[[0,0],[b,c],[b,0]],bottomLeft:[[0,0],[b,0],[0,c]],topRight:[[0,c],[b,0],[b,c]],topLeft:[[0,0],[0,c],[b,c]],topMiddle:[[0,c],[b/2,0],[b,c]],bottomMiddle:[[0,0],[b,0],[b/2,c]],rightMiddle:[[0,0],[b,c/2],[0,c]],leftMiddle:[[b,0],[b,c],[0,c/2]]};return d.leftTop=d.bottomRight,d.rightTop=d.bottomLeft,d.leftBottom=d.topRight,d.rightBottom=d.topLeft,d[a]}function q(b){var c;return a("<canvas>").get(0).getContext?c={topLeft:[b,b],topRight:[0,b],bottomLeft:[b,0],bottomRight:[0,0]}:a.browser.msie&&(c={topLeft:[-90,90,0],topRight:[-90,90,-b],bottomLeft:[90,270,0],bottomRight:[90,270,-b]}),c}function r(){var a,b,c;a=this,c=a.getDimensions(),b='<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:'+c.height+"px; width:"+c.width+'px" />',a.elements.bgiframe=a.elements.wrapper.prepend(b).children(".qtip-bgiframe:first")}a.fn.qtip=function(d,e){var f,g,h,i,j,k,l,m;if(typeof d=="string"){typeof a(this).data("qtip")!="object"&&a.fn.qtip.log.error.call(self,1,a.fn.qtip.constants.NO_TOOLTIP_PRESENT,!1);if(d=="api")return a(this).data("qtip").interfaces[a(this).data("qtip").current];if(d=="interfaces")return a(this).data("qtip").interfaces}else{d||(d={});if(typeof d.content!="object"||d.content.jquery&&d.content.length>0)d.content={text:d.content};typeof d.content.title!="object"&&(d.content.title={text:d.content.title}),typeof d.position!="object"&&(d.position={corner:d.position}),typeof d.position.corner!="object"&&(d.position.corner={target:d.position.corner,tooltip:d.position.corner}),typeof d.show!="object"&&(d.show={when:d.show}),typeof d.show.when!="object"&&(d.show.when={event:d.show.when}),typeof d.show.effect!="object"&&(d.show.effect={type:d.show.effect}),typeof d.hide!="object"&&(d.hide={when:d.hide}),typeof d.hide.when!="object"&&(d.hide.when={event:d.hide.when}),typeof d.hide.effect!="object"&&(d.hide.effect={type:d.hide.effect}),typeof d.style!="object"&&(d.style={name:d.style}),d.style=n(d.style),i=a.extend(!0,{},a.fn.qtip.defaults,d),i.style=o.call({options:i},i.style),i.user=a.extend(!0,{},d)}return a(this).each(function(){if(typeof d=="string"){k=d.toLowerCase(),h=a(this).qtip("interfaces");if(typeof h=="object")if(e===!0&&k=="destroy")while(h.length>0)h[h.length-1].destroy();else{e!==!0&&(h=[a(this).qtip("api")]);for(f=0;f<h.length;f++)k=="destroy"?h[f].destroy():h[f].status.rendered===!0&&(k=="show"?h[f].show():k=="hide"?h[f].hide():k=="focus"?h[f].focus():k=="disable"?h[f].disable(!0):k=="enable"&&h[f].disable(!1))}}else{l=a.extend(!0,{},i),l.hide.effect.length=i.hide.effect.length,l.show.effect.length=i.show.effect.length,l.position.container===!1&&(l.position.container=a(document.body)),l.position.target===!1&&(l.position.target=a(this)),l.show.when.target===!1&&(l.show.when.target=a(this)),l.hide.when.target===!1&&(l.hide.when.target=a(this)),g=a.fn.qtip.interfaces.length;for(f=0;f<g;f++)if(typeof a.fn.qtip.interfaces[f]=="undefined"){g=
f;break}j=new b(a(this),l,g),a.fn.qtip.interfaces[g]=j,typeof a(this).data("qtip")=="object"?(typeof a(this).attr("qtip")=="undefined"&&(a(this).data("qtip").current=a(this).data("qtip").interfaces.length),a(this).data("qtip").interfaces.push(j)):a(this).data("qtip",{current:0,interfaces:[j]}),l.content.prerender===!1&&l.show.when.event!==!1&&l.show.ready!==!0?l.show.when.target.bind(l.show.when.event+".qtip-"+g+"-create",{qtip:g},function(b){m=a.fn.qtip.interfaces[b.data.qtip],m.options.show.when.target.unbind(m.options.show.when.event+".qtip-"+b.data.qtip+"-create"),m.cache.mouse={x:b.pageX,y:b.pageY},c.call(m),m.options.show.when.target.trigger(m.options.show.when.event)}):(j.cache.mouse={x:l.show.when.target.offset().left,y:l.show.when.target.offset().top},c.call(j))}})},a(document).ready(function(){a.fn.qtip.cache={screen:{scroll:{left:a(window).scrollLeft(),top:a(window).scrollTop()},width:a(window).width(),height:a(window).height()}};var b;a(window).bind("resize scroll",function(c){clearTimeout(b),b=setTimeout(function(){c.type==="scroll"?a.fn.qtip.cache.screen.scroll={left:a(window).scrollLeft(),top:a(window).scrollTop()}:(a.fn.qtip.cache.screen.width=a(window).width(),a.fn.qtip.cache.screen.height=a(window).height());for(i=0;i<a.fn.qtip.interfaces.length;i++){var b=a.fn.qtip.interfaces[i];b.status.rendered===!0&&(b.options.position.type!=="static"||b.options.position.adjust.scroll&&c.type==="scroll"||b.options.position.adjust.resize&&c.type==="resize")&&b.updatePosition(c,!0)}},100)}),a(document).bind("mousedown.qtip",function(b){a(b.target).parents("div.qtip").length===0&&a(".qtip[unfocus]").each(function(){var c=a(this).qtip("api");a(this).is(":visible")&&!c.status.disabled&&a(b.target).add(c.elements.target).length>1&&c.hide(b)})})}),a.fn.qtip.interfaces=[],a.fn.qtip.log={error:function(){return this}},a.fn.qtip.constants={},a.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(){}}},a.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)
