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