(function(a){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")}function q(b){var c;if(a("<canvas>").get(0).getContext){c={topLeft:[b,b],topRight:[0,b],bottomLeft:[b,0],bottomRight:[0,0]}}else if(a.browser.msie){c={topLeft:[-90,90,0],topRight:[-90,90,-b],bottomLeft:[90,270,0],bottomRight:[90,270,-b]}}return c}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]]};d.leftTop=d.bottomRight;d.rightTop=d.bottomLeft;d.leftBottom=d.topRight;d.rightBottom=d.topLeft;return d[a]}function o(){var b,c,d,e,f,g;b=this;d=[true,{}];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]))}e.unshift(true,{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;if(f.tip.size.width%2>0)f.tip.size.width+=1;if(f.tip.size.height%2>0)f.tip.size.height+=1;if(f.tip.corner===true)f.tip.corner=b.options.position.corner.tooltip==="center"?false:b.options.position.corner.tooltip;return f}function n(a){if(typeof a.tip!=="object")a.tip={corner:a.tip};if(typeof a.tip.size!=="object")a.tip.size={width:a.tip.size,height:a.tip.size};if(typeof a.border!=="object")a.border={width:a.border};if(typeof a.width!=="object")a.width={value:a.width};if(typeof a.width.max=="string")a.width.max=parseInt(a.width.max.replace(/([0-9]+)/i,"$1"));if(typeof a.width.min=="string")a.width.min=parseInt(a.width.min.replace(/([0-9]+)/i,"$1"));if(typeof a.tip.size.x=="number"){a.tip.size.width=a.tip.size.x;delete a.tip.size.x}if(typeof a.tip.size.y=="number"){a.tip.size.height=a.tip.size.y;delete a.tip.size.y}return a}function m(b,c){var d,e;d=a.extend(true,{},b);for(e in d){if(c===true&&e.search(/(tip|classes)/i)!==-1)delete d[e];else if(!c&&e.search(/(width|border|tip|title|classes|user)/i)!==-1)delete d[e]}return d}function l(b,c,d){var e,g,h,i,j,k;e=this;if(d.corner=="center")return c.position;g=a.extend({},b);i={x:false,y:false};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};if(h.left){if(e.options.position.target!=="mouse")g.left=c.position.left+c.dimensions.width;else g.left=e.cache.mouse.x;i.x="Left"}else if(h.right){if(e.options.position.target!=="mouse")g.left=c.position.left-d.dimensions.width;else g.left=e.cache.mouse.x-d.dimensions.width;i.x="Right"}if(h.top){if(e.options.position.target!=="mouse")g.top=c.position.top+c.dimensions.height;else g.top=e.cache.mouse.y;i.y="top"}else if(h.bottom){if(e.options.position.target!=="mouse")g.top=c.position.top-d.dimensions.height;else g.top=e.cache.mouse.y-d.dimensions.height;i.y="bottom"}if(g.left<0){g.left=b.left;i.x=false}if(g.top<0){g.top=b.top;i.y=false}if(e.options.style.tip.corner!==false){g.corner=new String(d.corner);if(i.x!==false)g.corner=g.corner.replace(/Left|Right|Middle/,i.x);if(i.y!==false)g.corner=g.corner.replace(/top|bottom/,i.y);if(g.corner!==e.elements.tip.attr("rel"))f.call(e,g.corner)}return g}function k(){function h(c){if(b.status.disabled===true)return;if(b.options.hide.fixed===true&&b.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&a(c.relatedTarget).parents("div.qtip[qtip]").length>0){c.stopPropagation();c.preventDefault();clearTimeout(b.timers.hide);return false}clearTimeout(b.timers.show);clearTimeout(b.timers.hide);b.elements.tooltip.stop(true,true);b.timers.hide=setTimeout(function(){b.hide(c)},b.options.hide.delay)}function g(c){if(b.status.disabled===true)return;if(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)}var b,c,d,e;b=this;c=b.options.show.when.target;d=b.options.hide.when.target;if(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===true)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 if(b.options.hide.fixed===true){b.elements.tooltip.bind("mouseover.qtip",function(){if(b.status.disabled===true)return;clearTimeout(b.timers.hide)})}if(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){if(b.cache.toggle==0)g(a);else h(a)})}else{c.bind(b.options.show.when.event+".qtip",g);if(b.options.hide.when.event!=="inactive")d.bind(b.options.hide.when.event+".qtip",h)}if(b.options.position.type.search(/(fixed|absolute)/)!==-1)b.elements.tooltip.bind("mouseover.qtip",b.focus);if(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};if(b.status.disabled===false&&b.options.position.adjust.mouse===true&&b.options.position.type!=="static"&&b.elements.tooltip.css("display")!=="none")b.updatePosition(a)})}}function j(){var b=this;if(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,true)).css({zoom:a.browser.msie?1:0}).prependTo(b.elements.contentWrapper);if(b.options.content.title.text)b.updateTitle.call(b,b.options.content.title.text);if(b.options.content.title.button!==false&&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,true)).html(b.options.content.title.button).prependTo(b.elements.title).click(function(a){if(!b.status.disabled)b.hide(a)})}}function h(b){var c,d,e,f,g;c=this;if(c.options.style.tip.corner===false||!c.elements.tip)return;if(!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);if(b.search(/top|bottom/)!==-1){if(a.browser.msie){if(parseInt(a.browser.version.charAt(0))===6)positionAdjust=b.search(/top/)!==-1?-3:1;else positionAdjust=b.search(/top/)!==-1?1:2}if(b.search(/Middle/)!==-1)c.elements.tip.css({left:"50%",marginLeft:-(c.options.style.tip.size.width/2)});else if(b.search(/Left/)!==-1)c.elements.tip.css({left:c.options.style.border.radius-d});else if(b.search(/Right/)!==-1)c.elements.tip.css({right:c.options.style.border.radius+d});if(b.search(/top/)!==-1)c.elements.tip.css({top:-positionAdjust});else c.elements.tip.css({bottom:positionAdjust})}else if(b.search(/left|right/)!==-1){if(a.browser.msie)positionAdjust=parseInt(a.browser.version.charAt(0))===6?1:b.search(/left/)!==-1?1:2;if(b.search(/Middle/)!==-1)c.elements.tip.css({top:"50%",marginTop:-(c.options.style.tip.size.height/2)});else if(b.search(/Top/)!==-1)c.elements.tip.css({top:c.options.style.border.radius-d});else if(b.search(/Bottom/)!==-1)c.elements.tip.css({bottom:c.options.style.border.radius+d});if(b.search(/left/)!==-1)c.elements.tip.css({left:-positionAdjust});else 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);if(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 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 f(b){var c,d,e,f,i;c=this;if(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===false)return;else if(!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;">';if(a("<canvas>").get(0).getContext)c.elements.tip+='<canvas height="'+c.options.style.tip.size.height+'" width="'+c.options.style.tip.size.width+'"></canvas>';else if(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);if(a("<canvas>").get(0).getContext)g.call(c,c.elements.tip.find("canvas:first"),e,d);if(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 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,false);e.fill()}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">';if(a("<canvas>").get(0).getContext)i[c]+='<canvas height="'+f+'" width="'+f+'" style="vertical-align: top"></canvas>';else if(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);if(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)})}else if(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 c(){var b,c,e,g,h,i,l;b=this;b.beforeRender.call(b);b.status.rendered=true;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));if(a.browser.msie)b.elements.wrapper.add(b.elements.content).css({zoom:1});if(b.options.hide.when.event=="unfocus")b.elements.tooltip.attr("unfocus",true);if(typeof b.options.style.width.value=="number")b.updateWidth();if(a("<canvas>").get(0).getContext||a.browser.msie){if(b.options.style.border.radius>0)d.call(b);else b.elements.contentWrapper.css({border:b.options.style.border.width+"px solid "+b.options.style.border.color});if(b.options.style.tip.corner!==false)f.call(b)}else{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=false;a.fn.qtip.log.error.call(b,2,a.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if(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;else if(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","")}else if(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","")}else{e=" ";a.fn.qtip.log.error.call(b,1,a.fn.qtip.constants.NO_VALID_CONTENT,"render")}if(b.options.content.title.text!==false)j.call(b);b.updateContent(e);k.call(b);if(b.options.show.ready===true)b.show();if(b.options.content.url!==false){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 b(b,c,d){var f=this;f.id=d;f.options=c;f.status={animated:false,rendered:false,disabled:false,focused:false};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(){if(f.options.position.type!=="static")f.focus();f.onShow.call(f,b);if(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(true,false);c=f.beforeShow.call(f,b);if(c===false)return f;f.cache.toggle=1;if(f.options.position.type!=="static")f.updatePosition(b,f.options.show.effect.length>0);if(typeof f.options.show.solo=="object")d=a(f.options.show.solo);else if(f.options.show.solo===true)d=a("div.qtip").not(f.elements.tooltip);if(d)d.each(function(){if(a(this).qtip("api").status.rendered===true)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();if(f.options.position.type!=="static")f.updatePosition(b,true)});break;case"grow":f.elements.tooltip.show(f.options.show.effect.length,e);break;default:f.elements.tooltip.show(null,e);break}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");else if(f.elements.tooltip.css("display")==="none")return f;clearTimeout(f.timers.show);f.elements.tooltip.stop(true,false);c=f.beforeHide.call(f,b);if(c===false)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);break}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,s,t;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition");else 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++){if(d%2==0){if(h[d]>e.dimensions.width)e.dimensions.width=h[d];if(h[d]<h[0])e.position.left=Math.floor(j.left+h[d])}else{if(h[d]>e.dimensions.height)e.dimensions.height=h[d];if(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");break}e.dimensions.width-=2;e.dimensions.height-=2}else if(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()}}else{if(typeof f.options.position.target.attr("qtip")!=="undefined")e.position=f.options.position.target.qtip("api").cache.position;else 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);if(e.corner.search(/right/i)!==-1)k.left+=e.dimensions.width;if(e.corner.search(/bottom/i)!==-1)k.top+=e.dimensions.height;if(e.corner.search(/((top|bottom)Middle)|center/)!==-1)k.left+=e.dimensions.width/2;if(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}}if(g.corner.search(/right/i)!==-1)k.left-=g.dimensions.width;if(g.corner.search(/bottom/i)!==-1)k.top-=g.dimensions.height;if(g.corner.search(/((top|bottom)Middle)|center/)!==-1)k.left-=g.dimensions.width/2;if(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;if(f.options.style.border.radius>0){if(g.corner.search(/Left/)!==-1)k.left-=f.options.style.border.radius;else if(g.corner.search(/Right/)!==-1)k.left+=f.options.style.border.radius;if(g.corner.search(/Top/)!==-1)k.top-=f.options.style.border.radius;else if(g.corner.search(/Bottom/)!==-1)k.top+=f.options.style.border.radius}if(m){if(g.corner.search(/top/)!==-1)k.top-=m;else if(g.corner.search(/bottom/)!==-1)k.top+=m;if(g.corner.search(/left/)!==-1)k.left-=m;else if(g.corner.search(/right/)!==-1)k.left+=m;if(g.corner.search(/leftMiddle|rightMiddle/)!==-1)k.top-=1}if(f.options.position.adjust.screen===true)k=l.call(f,k,e,g);if(f.options.position.target==="mouse"&&f.options.position.adjust.mouse===true){if(f.options.position.adjust.screen===true&&f.elements.tip)p=f.elements.tip.attr("rel");else p=f.options.position.corner.tooltip;k.left+=p.search(/right/i)!==-1?-6:6;k.top+=p.search(/bottom/i)!==-1?-6:6}if(!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();if(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;s=f.getPosition();if(k.left!=s.left||k.top!=s.top){t=f.beforePositionUpdate.call(f,b);if(t===false)return f;f.cache.position=k;if(c===true){f.status.animated=true;f.elements.tooltip.animate(k,200,"swing",function(){f.status.animated=false})}else f.elements.tooltip.css(k);f.onPositionUpdate.call(f,b);if(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;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth");else if(b&&typeof b!=="number")return 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);if(!b){if(typeof f.options.style.width.value=="number")b=f.options.style.width.value;else{f.elements.tooltip.css({width:"auto"});c.hide();if(a.browser.msie)f.elements.wrapper.add(f.elements.contentWrapper.children()).css({zoom:"normal"});b=f.getDimensions().width+1;if(!f.options.style.width.value){if(b>f.options.style.width.max)b=f.options.style.width.max;if(b<f.options.style.width.min)b=f.options.style.width.min}}}if(b%2!==0)b-=1;f.elements.tooltip.width(b);c.show();if(f.options.style.border.radius){f.elements.tooltip.find(".qtip-betweenCorners").each(function(c){a(this).width(b-f.options.style.border.radius*2)})}if(a.browser.msie){f.elements.wrapper.add(f.elements.contentWrapper.children()).css({zoom:"1"});f.elements.wrapper.width(b);if(f.elements.bgiframe)f.elements.bgiframe.width(b).height(f.getDimensions.height)}return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(b){var c,d,h,i,j;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle");else if(typeof b!=="string"||!a.fn.qtip.styles[b])return 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));if(f.options.content.title.text!==false)f.elements.title.css(m(f.options.style.title,true));f.elements.contentWrapper.css({borderColor:f.options.style.border.color});if(f.options.style.tip.corner!==false){if(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)}else if(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)}}if(f.options.style.border.radius>0){f.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:f.options.style.border.color});if(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)})}else if(a.browser.msie){f.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){a(this).attr("fillcolor",f.options.style.border.color)})}}return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(b,c){function i(){f.updateWidth();if(c!==false){if(f.options.position.type!=="static")f.updatePosition(f.elements.tooltip.is(":visible"),true);if(f.options.style.tip.corner!==false)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");else 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===false)return;if(a.browser.msie)f.elements.contentWrapper.children().css({zoom:"normal"});if(b.jquery&&b.length>0)b.clone(true).appendTo(f.elements.content).show();else f.elements.content.html(b);e=f.elements.content.find("img[complete=false]");if(e.length>0){g=0;e.each(function(b){a('<img src="'+a(this).attr("src")+'" />').load(function(){if(++g==e.length)i()})})}else i();f.onContentUpdate.call(f);return 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;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent");e=f.beforeContentLoad.call(f);if(e===false)return f;if(d=="post")a.post(b,c,g);else a.get(b,c,g);return f},updateTitle:function(b){if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle");else if(!b)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle");returned=f.beforeTitleUpdate.call(f);if(returned===false)return f;if(f.elements.button)f.elements.button=f.elements.button.clone(true);f.elements.title.html(b);if(f.elements.button)f.elements.title.prepend(f.elements.button);f.onTitleUpdate.call(f);return a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_TITLE_UPDATED,"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");else 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===false)return f;a("div.qtip[qtip]").not(f.elements.tooltip).each(function(){if(a(this).qtip("api").status.rendered===true){e=parseInt(a(this).css("z-index"));if(typeof e=="number"&&e>-1)a(this).css({zIndex:parseInt(a(this).css("z-index"))-1});a(this).qtip("api").status.focused=false}});f.elements.tooltip.css({zIndex:d});f.status.focused=true;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){if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable");if(b){if(!f.status.disabled){f.status.disabled=true;a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_DISABLED,"disable")}else a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}else{if(f.status.disabled){f.status.disabled=false;a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_ENABLED,"disable")}else a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}return f},destroy:function(){var b,c,d;c=f.beforeDestroy.call(f);if(c===false)return f;if(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()}else 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++)if(d[b].id==f.id)d.splice(b,1)}}delete a.fn.qtip.interfaces[f.id];if(typeof d=="object"&&d.length>0)f.elements.target.data("qtip").current=d.length-1;else f.elements.target.removeData("qtip");f.onDestroy.call(f);a.fn.qtip.log.error.call(f,1,a.fn.qtip.constants.EVENT_DESTROYED,"destroy");return f.elements.target},getPosition:function(){var b,c;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition");b=f.elements.tooltip.css("display")!=="none"?false:true;if(b)f.elements.tooltip.css({visiblity:"hidden"}).show();c=f.elements.tooltip.offset();if(b)f.elements.tooltip.css({visiblity:"visible"}).hide();return c},getDimensions:function(){var b,c;if(!f.status.rendered)return a.fn.qtip.log.error.call(f,2,a.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions");b=!f.elements.tooltip.is(":visible")?true:false;if(b)f.elements.tooltip.css({visiblity:"hidden"}).show();c={height:f.elements.tooltip.outerHeight(),width:f.elements.tooltip.outerWidth()};if(b)f.elements.tooltip.css({visiblity:"visible"}).hide();return c}})}a.fn.qtip=function(d,e){var f,g,h,i,j,k,l,m;if(typeof d=="string"){if(typeof a(this).data("qtip")!=="object")a.fn.qtip.log.error.call(self,1,a.fn.qtip.constants.NO_TOOLTIP_PRESENT,false);if(d=="api")return a(this).data("qtip").interfaces[a(this).data("qtip").current];else if(d=="interfaces")return a(this).data("qtip").interfaces}else{if(!d)d={};if(typeof d.content!=="object"||d.content.jquery&&d.content.length>0)d.content={text:d.content};if(typeof d.content.title!=="object")d.content.title={text:d.content.title};if(typeof d.position!=="object")d.position={corner:d.position};if(typeof d.position.corner!=="object")d.position.corner={target:d.position.corner,tooltip:d.position.corner};if(typeof d.show!=="object")d.show={when:d.show};if(typeof d.show.when!=="object")d.show.when={event:d.show.when};if(typeof d.show.effect!=="object")d.show.effect={type:d.show.effect};if(typeof d.hide!=="object")d.hide={when:d.hide};if(typeof d.hide.when!=="object")d.hide.when={event:d.hide.when};if(typeof d.hide.effect!=="object")d.hide.effect={type:d.hide.effect};if(typeof d.style!=="object")d.style={name:d.style};d.style=n(d.style);i=a.extend(true,{},a.fn.qtip.defaults,d);i.style=o.call({options:i},i.style);i.user=a.extend(true,{},d)}return a(this).each(function(){if(typeof d=="string"){k=d.toLowerCase();h=a(this).qtip("interfaces");if(typeof h=="object"){if(e===true&&k=="destroy")while(h.length>0)h[h.length-1].destroy();else{if(e!==true)h=[a(this).qtip("api")];for(f=0;f<h.length;f++){if(k=="destroy")h[f].destroy();else if(h[f].status.rendered===true){if(k=="show")h[f].show();else if(k=="hide")h[f].hide();else if(k=="focus")h[f].focus();else if(k=="disable")h[f].disable(true);else if(k=="enable")h[f].disable(false)}}}}}else{l=a.extend(true,{},i);l.hide.effect.length=i.hide.effect.length;l.show.effect.length=i.show.effect.length;if(l.position.container===false)l.position.container=a(document.body);if(l.position.target===false)l.position.target=a(this);if(l.show.when.target===false)l.show.when.target=a(this);if(l.hide.when.target===false)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;if(typeof a(this).data("qtip")=="object"){if(typeof a(this).attr("qtip")==="undefined")a(this).data("qtip").current=a(this).data("qtip").interfaces.length;a(this).data("qtip").interfaces.push(j)}else a(this).data("qtip",{current:0,interfaces:[j]});if(l.content.prerender===false&&l.show.when.event!==false&&l.show.ready!==true){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)})}else{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(){if(c.type==="scroll")a.fn.qtip.cache.screen.scroll={left:a(window).scrollLeft(),top:a(window).scrollTop()};else{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];if(b.status.rendered===true&&(b.options.position.type!=="static"||b.options.position.adjust.scroll&&c.type==="scroll"||b.options.position.adjust.resize&&c.type==="resize")){b.updatePosition(c,true)}}},100)});a(document).bind("mousedown.qtip",function(b){if(a(b.target).parents("div.qtip").length===0){a(".qtip[unfocus]").each(function(){var c=a(this).qtip("api");if(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:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},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:false,color:false,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:5,radius:0,color:"#bfb59e"},title:{background:"#eae5d9",color:"#bfb59e"},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)

