/* * qTip2 - Pretty powerful tooltips * http://craigsworks.com/projects/qtip2/ * * Version: 2.0.0pre * Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com * * Dual licensed under MIT or GPLv2 licenses * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * * Date: Thu Jan 6 22:14:48 2011 +0000 */ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ /*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */ /*global window: false, jQuery: false */ (function(c,K,P){function U(e){var a;if(!e)return m;if("object"!==typeof e.metadata)e.metadata={type:e.metadata};if("content"in e){if("object"!==typeof e.content||e.content.jquery)e.content={text:e.content};a=e.content.text||m;if(!c.isFunction(a)&&(!a&&!a.attr||a.length<1||"object"===typeof a&&!a.jquery))a=e.content.text=m;if("title"in e.content&&"object"!==typeof e.content.title)e.content.title={text:e.content.title}}if("position"in e)if("object"!==typeof e.position)e.position={my:e.position,at:e.position}; if("show"in e)if("object"!==typeof e.show)e.show=e.show.jquery?{target:e.show}:{event:e.show};if("hide"in e)if("object"!==typeof e.hide)e.hide=e.hide.jquery?{target:e.hide}:{event:e.hide};if("style"in e)if("object"!==typeof e.style)e.style={classes:e.style};c.each(c.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(e)});return e}function Y(e,a,o){function h(b){var f,i=b.split("."),l=a[i[0]];for(b=1;b",{"class":"ui-state-default "+(a.style.widget?"":H+"-icon"),title:"Close"}).prepend(c("",{"class":"ui-icon ui-icon-close",html:"×"}));b.button.prependTo(b.titlebar).attr("role","button").hover(function(i){c(this).toggleClass("ui-state-hover", i.type==="mouseenter")}).click(function(i){g.hasClass(M)||d.hide(i);return m}).bind("mousedown keydown mouseup keyup mouseout",function(i){c(this).toggleClass("ui-state-active ui-state-focus",/down$/i.test(i.type))});d.redraw()}function z(){var b=d.elements,f=H+"-"+d.id+"-title";b.titlebar&&s();b.titlebar=c("
",{"class":H+"-titlebar "+(a.style.widget?"ui-widget-header":"")}).append(b.title=c("
",{id:f,"class":H+"-title",html:a.content.title.text})).insertBefore(b.content);e.attr("aria-labelledby", f);if(a.content.title.button)q();else d.rendered===u&&d.redraw()}function B(b){var f=d.elements;if(!d.rendered||!b)return m;if(c.isFunction(b))b=b.call(e);b.jquery&&b.length>0?f.content.empty().append(b.css({display:"block"})):f.content.html(b);g.queue("fx",function(i){function l(r){n=n.not(r);if(n.length===0){d.redraw();d.rendered===u&&d.reposition(d.cache.event);i()}}var n=c("img:not([height]):not([width])",d.elements.content);n.each(function(r,C){var F=["abort","error","load","unload",""].join(".qtip-image "); c(this).bind(F,function(){clearTimeout(d.timers.img[r]);l(this)});(function x(){if(C.height)return l(C);d.timers.img[r]=setTimeout(x,20)})();return u});n.length===0&&l(n)});return d}function G(b,f,i,l){function n(v){if(g.hasClass(M))return m;E.show.trigger("qtip-"+o+"-inactive");clearTimeout(d.timers.show);clearTimeout(d.timers.hide);var t=function(){d.show(v)};if(a.show.delay>0)d.timers.show=setTimeout(t,a.show.delay);else t()}function r(v){if(g.hasClass(M))return m;var t=c(v.relatedTarget||v.target).parents(R)[0]=== g[0],Q=c(v.relatedTarget||v.target)[0]===E.show[0];clearTimeout(d.timers.show);clearTimeout(d.timers.hide);if(a.hide.fixed&&(A.target==="mouse"&&t||/mouse(out|leave|move)/.test(v.type)&&(t||Q))){v.stopPropagation();v.preventDefault();return m}g.stop(1,1);if(a.hide.delay>0)d.timers.hide=setTimeout(function(){d.hide(v)},a.hide.delay);else d.hide(v)}function C(v){if(g.hasClass(M))return m;clearTimeout(d.timers.inactive);d.timers.inactive=setTimeout(function(){d.hide(v)},a.hide.inactive)}function F(v){if(!d.cache.processing){d.cache.processing= 1;j()&&d.reposition(v);d.cache.processing=0}}var x=".qtip-"+o,A=a.position,E={show:a.show.target,hide:a.hide.target,container:A.container[0]===y?document:A.container},L={show:String(a.show.event).split(" "),hide:String(a.hide.event).split(" ")},N=c.browser.msie&&parseInt(c.browser.version,10)===6;if(i){if(a.hide.fixed){E.hide=E.hide.add(g);g.bind("mouseover"+x,function(){g.hasClass(M)||clearTimeout(d.timers.hide)})}g.bind("mouseenter"+x+" mouseleave"+x,function(v){d[v.type==="mouseenter"?"focus": "blur"](v)})}if(f){if("number"===typeof a.hide.inactive){E.show.bind("qtip-"+o+"-inactive",C);c.each(c.fn.qtip.inactiveEvents,function(v,t){E.hide.add(d.elements.tooltip).bind(t+x+"-inactive",C)})}c.each(L.hide,function(v,t){var Q=c.inArray(t,L.show);if(Q>-1&&c(E.hide).add(E.show).length===c(E.hide).length||t==="unfocus"){E.show.bind(t+x,function(I){j()?r(I):n(I)});delete L.show[Q]}else E.hide.bind(t+x,r)})}b&&c.each(L.show,function(v,t){E.show.bind(t+x,n)});if(l){if(A.adjust.resize||A.viewport)c(c.event.special.resize? A.viewport:K).bind("resize"+x,F);if(A.viewport||N&&g.css("position")==="fixed")c(A.viewport).bind("scroll"+x,F);/unfocus/i.test(a.hide.event)&&c(document).bind("mousedown"+x,function(v){c(v.target).parents(R).length===0&&c(v.target).add(e).length>1&&j()&&!g.hasClass(M)&&d.hide(v)});A.target==="mouse"&&c(document).bind("mousemove"+x,function(v){if(A.adjust.mouse&&!g.hasClass(M)&&j())d.reposition(v||c.fn.qtip.mouse)})}}function k(b,f,i,l){l=parseInt(l,10)!==0;var n=".qtip-"+o;f={show:b?a.show.target: D,hide:f?a.hide.target:D,tooltip:i?d.elements.tooltip:D,content:i?d.elements.content:D,container:l?a.position.container[0]===y?document:a.position.container:D,window:l?K:D};if(d.rendered)c([]).pushStack(c.grep([f.show,f.hide,f.tooltip,f.container,f.content,f.window],function(){return this!==null})).unbind(n);else b&&f.show.unbind(n+"-create")}var d=this,y=document.body,g;d.id=o;d.rendered=m;d.elements={target:e};d.timers={img:[]};d.options=a;d.plugins={};d.cache={event:{},target:D,disabled:m,lastFocus:y}; c.extend(d,{render:function(b){if(d.rendered)return m;var f=d.elements,i=c.Event("tooltiprender");e.attr("aria-describedby",H+"-"+o+"-content");g=f.tooltip=c("
").attr({id:H+"-"+o,role:"alert","class":H+" qtip ui-helper-reset "+a.style.classes,tabindex:-1}).toggleClass(M,d.cache.disabled).data("qtip",d).appendTo(a.position.container).append(f.content=c("
",{"class":H+"-content",id:H+"-"+o+"-content"}));d.rendered=u;a.content.title.text&&z();B(a.content.text);c.each(c.fn.qtip.plugins,function(){this.initialize=== "render"&&this(d)});G(1,1,1,1);c.each(a.events,function(l,n){if(n)g.bind(l==="toggle"?"tooltipshow tooltiphide":"tooltip"+l,n)});g.queue("fx",function(l){i.originalEvent=d.cache.event;g.trigger(i,[d]);if(a.show.ready||b){g.hide();d.show(d.cache.event)}l()});return d},get:function(b){switch(b.toLowerCase()){case "dimensions":b={height:g.outerHeight(),width:g.outerWidth()};break;case "offset":b=p(g[0],a.position.container);break;default:b=h(b.toLowerCase());b=b[0].precedance?b[0].string():b[0].jquery? b[0]:b[0][b[1]];break}return b},set:function(b,f){b=b.toLowerCase();var i=h(b),l=d.elements,n,r,C,F={builtin:{"^id$":function(){var x=f===u?c.fn.qtip.nextid:f,A=H+"-"+x;if(x!==m&&x.length>0&&!c("#"+A).length){g[0].id=A;l.content[0].id=A+"-content";l.title[0].id=A+"-title"}},"^content.text$":function(){B(f)},"^content.title.text$":function(){if(d.rendered)if(!d.elements.title&&f){z();d.reposition()}else f?d.elements.title.html(f):s()},"^content.title.button$":function(){var x=d.elements.button,A=d.elements.title; if(d.rendered)if(f){A||z();q()}else x.remove()},"^position.(my|at)$":function(){var x=/my$/i.test(b)?"my":"at";if("string"===typeof f)a.position[x]=new c.fn.qtip.plugins.Corner(f)},"^position.container$":function(){d.rendered===u&&g.appendTo(f)},"^(show|hide).(event|target|fixed|delay|inactive)$":function(x,A,E,L){var N=b.search(/fixed/i)>-1?[0,[0,1,1,1]]:[b.substr(0,3),b.charAt(0)==="s"?[1,0,0,0]:[0,1,0,0]];if(N[0])x[A]=L;k.apply(d,N[1]);if(N[0])x[A]=E;G.apply(d,N[1])},"^show.ready$":function(){d.rendered=== m&&d.show()},"^style.classes$":function(){g.attr("class",H+" qtip ui-helper-reset "+f)},"^style.widget|content.title":w,"^events.(render|show|move|hide|focus|blur)$":function(x,A,E){l.tooltip[(c.isFunction(f)?"":"un")+"bind"]("tooltip"+A,E)},"^position.(my|at|adjust|target|container)|style|content":function(){d.reposition()}}};c.each(d.plugins,function(x){if("object"===typeof this.checks)F[x]=this.checks});n=i[0][i[1]];i[0][i[1]]=f.nodeType?c(f):f;U(a);for(r in F)for(C in F[r])RegExp(C,"i").test(b)&& F[r][C].call(d,i[0],i[1],f,n);return d},toggle:function(b,f){function i(){if(b)c.browser.msie&&g[0].style.removeAttribute("filter");else g.css({display:"block",visibility:"hidden",width:"",opacity:"",left:V,top:V})}if(d.rendered===m)return m;var l=b?"show":"hide",n=a[l],r=j();if((typeof b).search("boolean|number"))b=!r;if(!r&&!b||g.is(":animated"))return d;if(f){if(/over|enter/.test(f.type)&&/out|leave/.test(d.cache.event.type)&&f.target===a.show.target[0]&&g.has(f.relatedTarget).length)return d; d.cache.event=c.extend({},f)}r=c.Event("tooltip"+l);r.originalEvent=f?d.cache.event:D;g.trigger(r,[d,90]);if(r.isDefaultPrevented())return d;if(b){g.hide().css({visibility:""});d.focus(f);d.reposition(f,0);n.solo&&c(R).not(g).qtip("hide")}else{clearTimeout(d.timers.show);d.blur(f)}g.attr("aria-hidden",Boolean(!b));g.stop(1,1);if(c.isFunction(n.effect)){n.effect.call(g,d);g.queue("fx",function(C){i.call(this,C);C()})}else if(n.effect===m){g[l]();i.call(g)}else g.fadeTo(90,b?1:0,i);b&&n.target.trigger("qtip-"+ o+"-inactive");return d},show:function(b){d.toggle(u,b)},hide:function(b){d.toggle(m,b)},focus:function(b){if(d.rendered===m)return m;var f=c(R),i=parseInt(g[0].style.zIndex,10),l=c.fn.qtip.zindex+f.length;b=c.extend({},b);if(!g.hasClass(T)){if(i!==l){f.each(function(){if(this.style.zIndex>i)this.style.zIndex-=1});c(R+"."+T).qtip("blur",b)}d.cache.lastFocus=document.activeElement;f=c.Event("tooltipfocus");f.originalEvent=b;g.trigger(f,[d,l]);if(!f.isDefaultPrevented())g.addClass(T)[0].style.zIndex= l}return d},blur:function(b){b=c.extend({},b);var f;g.removeClass(T);f=c.Event("tooltipblur");f.originalEvent=b;g.trigger(f,[d]);d.cache.lastFocus.focus()},reposition:function(b,f){if(d.rendered===m)return m;var i=a.position.target,l=a.position,n=l.my,r=l.at,C=l.adjust,F=g.outerWidth(),x=g.outerHeight(),A=0,E=0,L=c.Event("tooltipmove"),N=g.css("position")==="fixed",v=l.viewport.jquery?l.viewport:c(K),t={left:0,top:0},Q={left:function(I){var J=v.scrollLeft,O=r.x==="left"?A:r.x==="right"?-A:-A/2,S= J-I;J=I+F-v.width-J;O=(n.x==="left"?F:n.x==="right"?-F:-F/2)-(n.precedance==="x"||n.x===n.y?O:0);if(S>0&&(n.x!=="left"||J>0))t.left-=O;else if(J>0&&(n.x!=="right"||S>0))t.left-=(n.x==="center"?-1:1)*O+2*C.x;if(t.left<0&&-t.left>J)t.left=I;return t.left-I},top:function(I){var J=v.scrollTop,O=r.y==="top"?E:r.y==="bottom"?-E:-E/2,S=J-I;J=I+x-v.height-J;O=(n.y==="top"?x:n.y==="bottom"?-x:-x/2)-(n.precedance==="y"||n.x===n.y?O:0);if(S>0&&(n.y!=="top"||J>0))t.top-=O;else if(J>0&&(n.y!=="bottom"||S>0))t.top-= (n.y==="center"?-1:1)*O+2*C.y;if(t.top<0&&-t.top>J)t.top=I;return t.top-I}};f=f===P||!!f||m;v=!v?m:{elem:v,height:v[(v[0]===K?"h":"outerH")+"eight"](),width:v[(v[0]===K?"w":"outerW")+"idth"](),scrollLeft:v.scrollLeft(),scrollTop:v.scrollTop()};if(i==="mouse"){r={x:"left",y:"top"};b=b&&(b.type==="resize"||b.type==="scroll")?d.cache.event:C.mouse||!b||!b.pageX?c.extend({},c.fn.qtip.mouse):b;t={top:b.pageY,left:b.pageX}}else{if(i==="event")i=b&&b.target&&b.type!=="scroll"&&b.type!=="resize"?d.cache.target= c(b.target):d.cache.target;i=c(i).eq(0);if(i.length===0)return d;else if(i[0]===document||i[0]===K){A=i.width();E=i.height();if(i[0]===K)t={top:N?0:v.scrollTop,left:N?0:v.scrollLeft}}else if(i.is("area")&&c.fn.qtip.plugins.imagemap){t=c.fn.qtip.plugins.imagemap(i,r);A=t.width;E=t.height;t=t.offset}else{A=i.outerWidth();E=i.outerHeight();t=p(i[0],l.container[0])}t.left+=r.x==="right"?A:r.x==="center"?A/2:0;t.top+=r.y==="bottom"?E:r.y==="center"?E/2:0}t.left+=C.x+(n.x==="right"?-F:n.x==="center"?-F/ 2:0);t.top+=C.y+(n.y==="bottom"?-x:n.y==="center"?-x/2:0);t.adjusted=l.viewport.jquery&&i[0]!==K&&i[0]!==y?{left:Q.left(t.left),top:Q.top(t.top)}:{left:0,top:0};g.attr("class",function(){return c(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(H+"-pos-"+n.abbreviation());L.originalEvent=c.extend({},b);g.trigger(L,[d,t,v.elem]);if(L.isDefaultPrevented())return d;delete t.adjusted;if(!f||!isNaN(t.left,t.top))g.css(t);else if(j()&&c.isFunction(l.effect)){l.effect.call(g,d,t);g.queue(function(I){c(this).css({opacity:"", height:""});c.browser.msie&&this.style&&this.style.removeAttribute("filter");I()})}return d},redraw:function(){if(!d.rendered||!(c.browser.msie&&c.browser.version<8))return m;var b=H+"-fluid",f;g.css({width:"auto",height:"auto"}).addClass(b);f={height:g.outerHeight(),width:g.outerWidth()};c.each(["width","height"],function(i,l){var n=parseInt(g.css("max-"+l),10)||0,r=parseInt(g.css("min-"+l),10)||0;f[l]=n+r?Math.min(Math.max(f[l],r),n):f[l]});g.css(f).removeClass(b)},disable:function(b){var f=M;if("boolean"!== typeof b)b=!(g.hasClass(f)||d.cache.disabled);if(d.rendered)g.toggleClass(f,b);else d.cache.disabled=!!b;return d},destroy:function(){var b=e.data("oldtitle");if(d.rendered){g.remove();c.each(d.plugins,function(){this.initialize==="render"&&this.destroy()})}clearTimeout(d.timers.show);clearTimeout(d.timers.hide);k(1,1,1,1);e.removeData("qtip");b&&e.attr("title",b);e.removeAttr("aria-describedby").removeAttr("aria-labelledby");return e}})}function Z(e,a){var o,h,p=c(this),j=c(document.body),w=this=== document?j:p;h=p.metadata?p.metadata(a.metadata):D;var s=c.extend(u,{},c.fn.qtip.defaults,a,U((h&&a.metadata.type==="html5"?h[a.metadata.name]:D)||h));p.removeData("metadata");h=s.position;if("boolean"===typeof s.content.text)if(s.content.attr!==m&&p.attr(s.content.attr))s.content.text=p.attr(s.content.attr);else return m;if(h.container===m)h.container=j;if(h.target===m)h.target=w;if(s.show.target===m)s.show.target=w;if(s.hide.target===m)s.hide.target=w;if(s.position.viewport===u)s.position.viewport= h.container;h.at=new c.fn.qtip.plugins.Corner(h.at);h.my=new c.fn.qtip.plugins.Corner(h.my);if(p.data("qtip"))if(s.overwrite)p.qtip("destroy");else if(s.overwrite===m)return m;p.attr("title")&&p.data("oldtitle",p.attr("title")).removeAttr("title");o=new Y(p,s,e);p.data("qtip",o);p.bind("remove.qtip",function(){o.destroy()});return o}function $(e){var a=this,o=e.elements.tooltip,h=e.options.content.ajax;a.checks={"^content.ajax":function(p,j){if(j==="once")a.once();else h&&h.url&&a.load()}};c.extend(a, {init:function(){if(h&&h.url){a.load();o.one("tooltipshow",a.once)}},once:function(){h.once?a.destroy():o.bind("tooltipshow.qtip-ajax",a.load)},load:function(){c.ajax(c.extend({success:function(p){e.set("content.text",p)},error:function(p,j,w){e.set("content.text",j+": "+w)},context:e},h));return a},destroy:function(){o.unbind(".qtip-ajax")}});a.init()}function X(e,a,o){var h=Math.ceil(a/2),p=Math.ceil(o/2);a={bottomright:[[0,0],[a,o],[a,0]],bottomleft:[[0,0],[a,0],[0,o]],topright:[[0,o],[a,0],[a, o]],topleft:[[0,0],[0,o],[a,o]],topcenter:[[0,o],[h,0],[a,o]],bottomcenter:[[0,0],[a,0],[h,o]],rightcenter:[[0,0],[a,p],[0,o]],leftcenter:[[a,0],[a,o],[0,p]]};a.lefttop=a.bottomright;a.righttop=a.bottomleft;a.leftbottom=a.topright;a.rightbottom=a.topleft;return a[e.string()]}function aa(e){function a(k,d,y){if(j.tip){k=c.extend({},h.corner);d=y.adjusted;var g;if(h.corner.fixed!==u){if(d.left)k.x=k.x==="center"?d.left>0?"left":"right":k.x==="left"?"right":"left";if(d.top)k.y=k.y==="center"?d.top>0? "top":"bottom":k.y==="top"?"bottom":"top";if(k.string()!==s.corner&&(s.top!==d.top||s.left!==d.left))g=h.update(k)}g||(g=h.position(k,0));if(g.right!==P)g.left=g.right;if(g.bottom!==P)g.top=g.bottom;g.option=Math.max(0,p.offset);y.left-=g.left.charAt?g.option:(g.right?-1:1)*g.left;y.top-=g.top.charAt?g.option:(g.bottom?-1:1)*g.top;s.left=d.left;s.top=d.top;s.corner=k.string()}}function o(k,d,y){d=!d?k[k.precedance]:d;d="border-"+d+"-width";k=parseInt((j.titlebar&&k.y==="top"?j.titlebar:j.content).css(d), 10);return(y?k||parseInt(w.css(d),10):k)||0}var h=this,p=e.options.style.tip,j=e.elements,w=j.tooltip,s={top:0,left:0,corner:""},q={width:p.width,height:p.height},z={},B=p.border||0,G=p.method||m;h.corner=D;h.mimic=D;h.checks={"^position.my|style.tip.(corner|mimic|method|border)$":function(){h.init()||h.destroy();e.reposition()},"^style.tip.(height|width)$":function(){q={width:p.width,height:p.height};h.create();h.update();e.reposition()},"^content.title.text|style.(classes|widget)$":function(){j.tip&& h.update()}};c.extend(h,{init:function(){var k=h.detectCorner();if(k){if(G!=="polygon")G=c("")[0].getContext?"canvas":c.browser.msie?"vml":"polygon";h.create();h.update();w.unbind(".qtip-tip").bind("tooltipmove.qtip-tip",a)}return k},detectCorner:function(){var k=p.corner,d=e.options.position,y=d.at;d=d.my.string?d.my.string():d.my;if(k===m||d===m&&y===m)return m;else if(k===u)h.corner=new c.fn.qtip.plugins.Corner(d);else if(!k.string){h.corner=new c.fn.qtip.plugins.Corner(k);h.corner.fixed= u}return h.corner.string()!=="centercenter"},detectColours:function(){var k=j.tip.css({backgroundColor:"",border:""}),d=h.corner,y=d[d.precedance],g="border-"+y+"-color";y="border"+y.charAt(0)+y.substr(1)+"Color";var b=/rgba?\(0, 0, 0(, 0)?\)|transparent/i;d=j.titlebar&&(d.y==="top"||d.y==="center"&&k.position().top+q.height/2+p.offset",{"class":"ui-tooltip-tip"}).css(q).prependTo(w);switch(G){case "canvas":c('').appendTo(j.tip)[0].getContext("2d").save(); break;case "vml":k='';j.tip.html(B?k+=k:k);break;case "polygon":j.tip.append('
').append(B?'
':"");break}},update:function(k){var d=j.tip.children(),y=q.width,g=q.height,b=p.mimic,f,i,l,n,r;if(!k)k=h.corner; if(b===m)b=k;else{b=new c.fn.qtip.plugins.Corner(b);b.precedance=k.precedance;if(b.x==="inherit")b.x=k.x;else if(b.y==="inherit")b.y=k.y;else if(b.x===b.y)b[k.precedance]=k[k.precedance]}B=p.border===u?o(k,D,u):p.border;f=B>0?0:1;n=b.string().indexOf("center")>-1;r=Math[/b|r/.test(b[b.precedance==="y"?"x":"y"])?"ceil":"floor"];k=h.position(k,1);h.detectColours();switch(G){case "canvas":i=d[0].getContext("2d");i.restore&&i.restore();i.clearRect(0,0,3E3,3E3);for(l=X(b,y,g);f<2;f++){if(f){i.save();i.translate(r((b.x=== "left"?1:b.x==="right"?-1:0)*(B+1)*(b.precedance==="y"?0.5:1)),r((b.y==="top"?1:b.y==="bottom"?-1:0)*(B+1)*(b.precedance==="x"?0.5:1)))}i.beginPath();i.moveTo(l[0][0],l[0][1]);i.lineTo(l[1][0],l[1][1]);i.lineTo(l[2][0],l[2][1]);i.closePath();i.fillStyle=z[f?"fill":"border"];i.fill()}break;case "vml":l=X(b,y,g);l="m"+l[0][0]+","+l[0][1]+" l"+l[1][0]+","+l[1][1]+" "+l[2][0]+","+l[2][1]+" xe";d.each(function(C){c(this).attr({path:l,fillcolor:z[C||!B?"fill":"border"]}).css("antialias",""+n)});break;case "polygon":d.removeAttr("style").css({position:"absolute", left:0,top:0}).each(function(C){var F={x:b.precedance==="x"?b.x==="left"?"right":"left":b.x,y:b.precedance==="y"?b.y==="top"?"bottom":"top":b.y},x=b.x==="center"?["left","right",F.y,g,y]:["top","bottom",F.x,y,g];C=z[!C&&B?"border":"fill"];b.x==="center"||b.y==="center"?c(this).css("border-"+x[2],x[3]+"px solid "+C).css("border-"+x[0],r(x[4]/2)+"px dashed transparent").css("border-"+x[1],r(x[4]/2)+"px dashed transparent"):c(this).css("border-width",r(g/2)+"px "+r(y/2)+"px").css("border-"+F.x,r(y/2)+ "px solid "+C).css("border-"+F.y,r(g/2)+"px solid "+C)});break}if(G!=="canvas"&&B){f=[B*2.75,B];f=b.precedance==="y"?[b.x==="left"?f[1]:b.x==="right"?-f[1]:0,b.y==="bottom"?-f[0]:f[0]]:[b.x==="left"?f[0]:-f[0],b.y==="bottom"?-f[1]:b.y==="top"?f[1]:0];d.eq(1).css({left:f[0],top:f[1]})}return k},position:function(k,d){var y=j.tip,g={},b=Math.max(0,p.offset),f,i;if(p.corner===m||!y)return m;k=k||h.corner;f=k.precedance;i=q[f==="x"?"width":"height"];c.each(f==="y"?[k.x,k.y]:[k.y,k.x],function(l,n){var r; if(n==="center"){r=f==="y"?"left":"top";g[r]="50%";g["margin-"+r]=-Math.floor(i/2)+b}else{o(k,n,u);if(l||B===P)r=o(k,n);else{r=c.browser.mozilla;var C=k.y+(r?"":"-")+k.x;r=(r?"-moz-":c.browser.webkit?"-webkit-":"")+(r?"border-radius-"+C:"border-"+C+"-radius");r=parseInt((j.titlebar&&k.y==="top"?j.titlebar:j.content).css(r),10)||parseInt(w.css(r),10)||0;r=b+r}g[n]=r}});g[k[f]]-=i;d&&y.css({top:"",bottom:"",left:"",right:"",margin:""}).css(g);return g},destroy:function(){j.tip&&j.tip.remove();w.unbind(".qtip-tip")}}); h.init()}function ba(e){var a=this,o=e.options.show.modal,h=e.elements,p=h.tooltip;a.checks={"^show.modal.(on|blur)$":function(){a.init();h.overlay.toggle(p.is(":visible"))}};c.extend(a,{init:function(){if(o.on){p.unbind(".qtipmodal").bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(j,w,s){j=j.type.replace("tooltip","");c.isFunction(o[j])?o[j].call(h.overlay,s,w):a[j](s)});a.create();o.blur===u&&h.overlay.unbind(".qtipmodal"+e.id).bind("click.qtipmodal"+e.id,function(){e.hide.call(e)})}}, create:function(){var j=c("#qtip-overlay");if(j.length)h.overlay=j;else{h.overlay=c("
",{id:"#qtip-overlay".substr(1),css:{position:"absolute",top:0,left:0,display:"none",zIndex:parseInt(p.css("z-index"),10)-1}}).appendTo(document.body);c(K).bind("resize.qtipmodal",function(){h.overlay.css({height:Math.max(c(K).height(),c(document).height()),width:Math.max(c(K).width(),c(document).width())})}).trigger("resize")}},toggle:function(j){var w=h.overlay,s=e.options.show.modal.effect,q=j?"show":"hide"; w.stop(u,m);if(c.isFunction(s))s.call(w,j);else s===m?w[q]():w.fadeTo(90,j?0.7:0,function(){j||c(this).hide()})},show:function(){a.toggle(u)},hide:function(){a.toggle(m)},destroy:function(){var j=u;c("*").each(function(){var w=c(this).data("qtip");if(w&&w.id!==e.id&&w.options.show.modal)return j=m});if(j){h.overlay.remove();c(K).unbind(".qtipmodal")}else h.overlay.unbind(".qtipmodal"+e.id);p.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});a.init()}function ca(e){var a=this,o=e.elements,h= o.tooltip,p=".bgiframe-"+e.id,j="tooltipmove"+p+" tooltipshow"+p;c.extend(a,{init:function(){o.bgiframe=c('');o.bgiframe.appendTo(h);h.bind(j,a.adjust)},adjust:function(){var w=e.get("dimensions"),s=e.plugins.tip,q=e.elements.tip,z;z=parseInt(h.css("border-left-width"),10)||0;z={left:-z,top:-z};if(s&&q){s=s.corner.precedance=== "x"?["width","left"]:["height","top"];z[s[1]]-=q[s[0]]()}o.bgiframe.css(z).css(w)},destroy:function(){a.iframe.remove();h.unbind(j)}});a.init()}var u=true,m=false,D=null,H="ui-tooltip",W="ui-widget",M="ui-state-disabled",R=".qtip."+H,T=H+"-focus",V="-31000px";c.fn.qtip=function(e,a,o){var h=String(e).toLowerCase(),p=D,j=h==="disable"?[u]:c.makeArray(arguments).slice(1,10),w=j[j.length-1],s;if(!arguments.length&&this.data("qtip")||h==="api")return(s=this.data("qtip"))?s:P;else if("string"===typeof e){this.each(function(){var q= c(this).data("qtip");if(!q)return u;if(/option|set/.test(h)&&a)if(o!==P)q.set(a,o);else p=q.get(a);else{if(!q.rendered&&(h==="show"||h==="toggle")){if(w&&w.timeStamp)q.cache.event=w;q.render(1)}else if(h==="enable"){h="disable";j=[m]}q[h]&&q[h].apply(q[h],j)}});return p!==D?p:this}else if("object"===typeof e||!arguments.length){s=U(c.extend(u,{},e));return c.fn.qtip.bind.call(this,s,w)}};c.fn.qtip.bind=function(e,a){return this.each(function(){function o(z){function B(){q.render(typeof z==="object"|| h.show.ready);p.show.unbind(j.show);p.hide.unbind(j.hide)}if(q.cache.disabled)return m;q.cache.event=c.extend({},z);if(h.show.delay>0){clearTimeout(q.timers.show);q.timers.show=setTimeout(B,h.show.delay);j.show!==j.hide&&p.hide.bind(j.hide,function(){clearTimeout(q.timers.show)})}else B()}var h,p,j,w=e.id=!e.id||e.id===m||e.id.length<1||c("#"+H+"-"+e.id).length?c.fn.qtip.nextid++:e.id,s=".qtip-"+w+"-create",q=Z.call(this,w,e);if(q===m)return u;h=q.options;c.each(c.fn.qtip.plugins,function(){this.initialize=== "initialize"&&this(q)});p={show:h.show.target,hide:h.hide.target};j={show:String(h.show.event).replace(" ",s+" ")+s,hide:String(h.hide.event).replace(" ",s+" ")+s};p.show.bind(j.show,o);if(h.show.ready||h.prerender)o(a)})};c.each({attr:function(e){var a=c(this),o=a.data("qtip");return arguments.length===1&&e==="title"&&o&&o.rendered===u?a.data("oldtitle"):D},remove:c.ui?D:function(e,a){c(this).each(function(){if(!a)if(!e||c.filter(e,[this]).length)c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})})}}, function(e,a){if(!a)return u;c.fn["Old"+e]=c.fn[e];c.fn[e]=function(){return a.apply(this,arguments)||c.fn["Old"+e].apply(this,arguments)}});c(document).ready(function(){var e=document.body;c(e).attr("role",function(a,o){return!o?"application":o});c(document).bind("mousemove.qtip",function(a){c.fn.qtip.mouse={pageX:a.pageX,pageY:a.pageY}});document.activeElement===P&&document.addEventListener("focus",function(a){if(a&&a.target)document.activeElement=a.target===document?e:a.target},true)});c.fn.qtip.version= "2.0.0pre";c.fn.qtip.nextid=0;c.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");c.fn.qtip.zindex=15E3;c.fn.qtip.plugins={Corner:function(e){e=String(e).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(e.match(/left|right/i)||e.match(/center/)||["inherit"])[0].toLowerCase();this.y=(e.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.precedance=e.charAt(0).search(/^(t|b)/)>-1?"y":"x";this.string=function(){return this.precedance=== "y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var a=this.x.substr(0,1),o=this.y.substr(0,1);return a===o?a:a==="c"||a!=="c"&&o!=="c"?o+a:a+o}},iOS:parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1};c.fn.qtip.defaults={prerender:m,id:m,overwrite:u,metadata:{type:"class"},content:{text:u,attr:"title",title:{text:m,button:m}},position:{my:"top left",at:"bottom right",target:m,container:m,viewport:m,adjust:{x:0,y:0,mouse:u, resize:u},effect:u},show:{target:m,event:"mouseenter",effect:u,delay:90,solo:m,ready:m},hide:{target:m,event:"mouseleave",effect:u,delay:0,fixed:m,inactive:m},style:{classes:"",widget:m},events:{render:D,move:D,show:D,hide:D,toggle:D,focus:D,blur:D}};c.fn.qtip.plugins.ajax=function(e){var a=e.plugins.ajax;return"object"===typeof a?a:e.plugins.ajax=new $(e)};c.fn.qtip.plugins.ajax.initialize="render";c.fn.qtip.plugins.ajax.sanitize=function(e){var a=e.content;if(a&&"ajax"in a){a=a.ajax;if(typeof a!== "object")a=e.content.ajax={url:a};if("boolean"!==typeof a.once&&a.once)a.once=!!a.once}};c.extend(u,c.fn.qtip.defaults,{content:{ajax:{once:u}}});c.fn.qtip.plugins.tip=function(e){var a=e.plugins.tip;return"object"===typeof a?a:e.plugins.tip=new aa(e)};c.fn.qtip.plugins.tip.initialize="render";c.fn.qtip.plugins.tip.sanitize=function(e){var a=e.style;if(a&&"tip"in a){a=e.style.tip;if(typeof a!=="object")e.style.tip={corner:a};if(!/string|boolean/i.test(typeof a.corner))a.corner=u;if(typeof a.method!== "string")a.method=u;if(!/canvas|polygon/i.test(a.method))a.method=u;typeof a.width!=="number"&&delete a.width;typeof a.height!=="number"&&delete a.height;typeof a.border!=="number"&&a.border!==u&&delete a.border;typeof a.offset!=="number"&&delete a.offset}};c.extend(u,c.fn.qtip.defaults,{style:{tip:{corner:u,mimic:m,method:u,width:8,height:8,border:u,offset:0}}});c.fn.qtip.plugins.imagemap=function(e,a){function o(G,k){for(var d=0,y=1,g=1,b=0,f=0,i=G.width,l=G.height;i>0&&l>0&&y>0&&g>0;){i=Math.floor(i/ 2);l=Math.floor(l/2);if(a.x==="left")y=i;else if(a.x==="right")y=G.width-i;else y+=Math.floor(i/2);if(a.y==="top")g=l;else if(a.y==="bottom")g=G.height-l;else g+=Math.floor(l/2);for(d=k.length;d--;){if(k.length<2)break;b=k[d][0]-G.offset.left;f=k[d][1]-G.offset.top;if(a.x==="left"&&b>=y||a.x==="right"&&b<=y||a.x==="center"&&(bG.width-y)||a.y==="top"&&f>=g||a.y==="bottom"&&f<=g||a.y==="center"&&(fG.height-g))k.splice(d,1)}}return{left:k[0][0],top:k[0][1]}}var h=e.attr("shape").toLowerCase(), p=e.attr("coords").split(","),j=[],w=c('img[usemap="#'+e.parent("map").attr("name")+'"]'),s=w.offset(),q={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},z=0,B=0;s.left+=Math.ceil((w.outerWidth()-w.width())/2);s.top+=Math.ceil((w.outerHeight()-w.height())/2);if(h==="poly")for(z=p.length;z--;){B=[parseInt(p[--z],10),parseInt(p[z+1],10)];if(B[0]>q.offset.right)q.offset.right=B[0];if(B[0]q.offset.bottom)q.offset.bottom=B[1];if(B[1]