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