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