/*
* 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: Fri Jan 28 11:38:45 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(a,M,T){function $(){var c=M.console;return c&&(c.error||c.log||a.noop).apply(c,arguments)}function W(c){var b;if(!c||"object"!==typeof c)return o;if("object"!==typeof c.metadata)c.metadata={type:c.metadata};if("content"in c){if("object"!==typeof c.content||c.content.jquery)c.content={text:c.content};b=c.content.text||o;if(!a.isFunction(b)&&(!b&&!b.attr||b.length<1||"object"===typeof b&&!b.jquery))c.content.text=o;if("title"in c.content){if("object"!==typeof c.content.title)c.content.title=
{text:c.content.title};b=c.content.title.text||o;if(!a.isFunction(b)&&(!b&&!b.attr||b.length<1||"object"===typeof b&&!b.jquery))c.content.title.text=o}}if("position"in c)if("object"!==typeof c.position)c.position={my:c.position,at:c.position};if("show"in c)if("object"!==typeof c.show)c.show=c.show.jquery?{target:c.show}:{event:c.show};if("hide"in c)if("object"!==typeof c.hide)c.hide=c.hide.jquery?{target:c.hide}:{event:c.hide};if("style"in c)if("object"!==typeof c.style)c.style={classes:c.style};
a.each(a.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(c)});return c}function aa(c,b,i,k){function q(e){var f,j=e.split("."),s=b[j[0]];for(e=1;e<j.length;e+=1){f=s[j[e]];if(typeof f==="object"&&!f.jquery&&!f.precedance)s=s[j[e]];else break}return j[e]!==T?[s,j[e]]:[b,j[0]]}function h(e,f){var j={left:0,top:0},s=!a.fn.qtip.plugins.iOS,p,u;if(f){if(f.offsetParent!==v){j=h(f);j.left*=-1;j.top*=-1;j.left+=parseInt(a.css(f,"margin-left"),10)||0;j.top+=parseInt(a.css(f,"margin-top"),10)||0}else{j.left+=
v.scrollLeft;j.top+=v.scrollTop}if(f!==v)if(a.css(f,"overflow")!=="visible"){j.left-=f.scrollLeft;j.top-=f.scrollTop}}if(e.offsetParent){do{p=e.offsetParent;u=p===f;j.left+=e.offsetLeft-(s&&p&&!u?p.scrollLeft:0);j.top+=e.offsetTop-(s&&p&&!u?p.scrollTop:0)}while(e=p)}return j}function m(){return g.css("left")!==ba&&g.css("visibility")!=="hidden"}function x(){var e=d.elements,f=b.style.widget;g.toggleClass(Z,f);e.content.toggleClass(Z+"-content",f);e.titlebar&&e.titlebar.toggleClass(Z+"-header",f);
e.button&&e.button.toggleClass(N+"-icon",!f)}function n(){var e=d.elements;if(e.title){e.titlebar.remove();e.titlebar=e.title=e.button=E;d.reposition()}}function z(){var e=d.elements,f=b.content.title.button;e.button&&e.button.remove();e.button=f.jquery?f:a("<a />",{"class":"ui-state-default "+(b.style.widget?"":N+"-icon"),title:"Close tooltip","aria-label":"Close tooltip"}).prepend(a("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"}));e.button.appendTo(e.titlebar).attr("role","button").hover(function(j){a(this).toggleClass("ui-state-hover",
j.type==="mouseenter")}).click(function(j){g.hasClass(S)||d.hide(j);return o}).bind("mousedown keydown mouseup keyup mouseout",function(j){a(this).toggleClass("ui-state-active ui-state-focus",j.type.substr(-4)==="down")});d.redraw()}function y(){var e=d.elements,f=C+"-title";e.titlebar&&n();e.titlebar=a("<div />",{"class":N+"-titlebar "+(b.style.widget?"ui-widget-header":"")}).append(e.title=a("<div />",{id:f,"class":N+"-title","aria-atomic":w})).insertBefore(e.content);if(b.content.title.button)z();
else d.rendered===w&&d.redraw()}function A(e){var f=d.elements.title;if(!d.rendered||!e)return o;if(a.isFunction(e))e=e.call(c,d)||"";e.jquery&&e.length>0?f.empty().append(e.css({display:"block"})):f.html(e);d.redraw();d.rendered===w&&d.reposition(d.cache.event)}function O(e){var f=d.elements.content;if(!d.rendered||!e)return o;if(a.isFunction(e))e=e.call(c,d)||"";e.jquery&&e.length>0?f.empty().append(e.css({display:"block"})):f.html(e);g.queue("fx",function(j){function s(u){p=p.not(u);if(p.length===
0){d.redraw();d.rendered===w&&d.reposition(d.cache.event);j()}}var p=f.find("img:not([height]):not([width])");p.each(function(u,G){var K=["abort","error","load","unload",""].join(".qtip-image ");a(this).bind(K,function(){clearTimeout(d.timers.img[u]);s(this)});(function B(){if(G.height)return s(G);d.timers.img[u]=setTimeout(B,20)})();return w});p.length===0&&s(p)});return d}function l(e,f,j,s){function p(t){if(g.hasClass(S))return o;F.show.trigger("qtip-"+i+"-inactive");clearTimeout(d.timers.show);
clearTimeout(d.timers.hide);var H=function(){d.show(t)};if(b.show.delay>0)d.timers.show=setTimeout(H,b.show.delay);else H()}function u(t){if(g.hasClass(S))return o;var H=a(t.relatedTarget||t.target),J=H.closest(X)[0]===g[0];H=H[0]===F.show[0];clearTimeout(d.timers.show);clearTimeout(d.timers.hide);if(D.target==="mouse"&&J||b.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(J||H)){t.stopPropagation();t.preventDefault();return o}g.stop(1,1);if(b.hide.delay>0)d.timers.hide=setTimeout(function(){d.hide(t)},
b.hide.delay);else d.hide(t)}function G(t){if(g.hasClass(S))return o;clearTimeout(d.timers.inactive);d.timers.inactive=setTimeout(function(){d.hide(t)},b.hide.inactive)}function K(t){if(!d.cache.processing){d.cache.processing=1;m()&&d.reposition(t);d.cache.processing=0}}var B=".qtip-"+i,D=b.position,F={show:b.show.target,hide:b.hide.target,container:D.container[0]===v?document:D.container},Q={show:String(b.show.event).split(" "),hide:String(b.hide.event).split(" ")},R=a(document),I=a.browser.msie&&
parseInt(a.browser.version,10)===6;if(j){if(b.hide.fixed){F.hide=F.hide.add(g);g.bind("mouseover"+B,function(){g.hasClass(S)||clearTimeout(d.timers.hide)})}g.bind("mouseenter"+B+" mouseleave"+B,function(t){d[t.type==="mouseenter"?"focus":"blur"](t)})}if(f){if("number"===typeof b.hide.inactive){F.show.bind("qtip-"+i+"-inactive",G);a.each(a.fn.qtip.inactiveEvents,function(t,H){F.hide.add(d.elements.tooltip).bind(H+B+"-inactive",G)})}a.each(Q.hide,function(t,H){var J=a.inArray(H,Q.show),L=a(F.hide);
if(J>-1&&L.add(F.show).length===L.length||H==="unfocus"){F.show.bind(H+B,function(P){m()?u(P):p(P)});delete Q.show[J]}else F.hide.bind(H+B,u)})}e&&a.each(Q.show,function(t,H){F.show.bind(H+B,p)});if(s){if(D.adjust.resize||D.viewport)a(a.event.special.resize?D.viewport:M).bind("resize"+B,K);if(D.viewport||I&&g.css("position")==="fixed")a(D.viewport).bind("scroll"+B,K);/unfocus/i.test(b.hide.event)&&R.bind("mousedown"+B,function(t){var H=a(t.target);H.parents(X).length===0&&H.add(c).length>1&&m()&&
!g.hasClass(S)&&d.hide(t)});D.target==="mouse"&&R.bind("mousemove"+B,function(t){if(D.adjust.mouse&&!g.hasClass(S)&&m())d.reposition(t||a.fn.qtip.mouse)})}}function r(e,f,j,s){s=parseInt(s,10)!==0;var p=".qtip-"+i;f={show:e?b.show.target:E,hide:f?b.hide.target:E,tooltip:j?d.elements.tooltip:E,content:j?d.elements.content:E,container:s?b.position.container[0]===v?document:b.position.container:E,window:s?M:E};if(d.rendered)a([]).pushStack(a.grep([f.show,f.hide,f.tooltip,f.container,f.content,f.window],
function(){return this!==null})).unbind(p);else e&&f.show.unbind(p+"-create")}var d=this,v=document.body,C=N+"-"+i,g;d.id=i;d.rendered=o;d.elements={target:c};d.timers={img:[]};d.options=b;d.plugins={};d.cache={event:{},target:E,disabled:o,lastFocus:v,attr:k};a.extend(d,{render:function(e){if(d.rendered)return o;var f=d.elements,j=b.content.text,s=b.content.title.text,p=a.Event("tooltiprender");a.attr(c[0],"aria-describedby",C);g=f.tooltip=a("<div/>").attr({id:C,"class":N+" qtip ui-helper-reset "+
b.style.classes,role:"alert","aria-live":"polite","aria-atomic":o,"aria-describedby":C+"-content","aria-hidden":w}).toggleClass(S,d.cache.disabled).data("qtip",d).appendTo(b.position.container).append(f.content=a("<div />",{"class":N+"-content",id:C+"-content","aria-atomic":w}));d.rendered=w;if(s){y();A(s)}O(j);x();a.each(a.fn.qtip.plugins,function(){this.initialize==="render"&&this(d)});l(1,1,1,1);a.each(b.events,function(u,G){if(G)g.bind(u==="toggle"?"tooltipshow tooltiphide":"tooltip"+u,G)});g.css("visibility",
"hidden").queue("fx",function(u){p.originalEvent=d.cache.event;g.trigger(p,[d]);if(b.show.ready||e)d.show(d.cache.event);u()});return d},get:function(e){switch(e.toLowerCase()){case "dimensions":e={height:g.outerHeight(),width:g.outerWidth()};break;case "offset":e=h(g[0],b.position.container[0]);break;default:e=q(e.toLowerCase());e=e[0].precedance?e[0].string():e[0].jquery?e[0]:e[0][e[1]];break}return e},set:function(e,f){e=e.toLowerCase();var j=q(e),s=d.elements,p,u,G,K={builtin:{"^id$":function(){var B=
f===w?a.fn.qtip.nextid:f,D=N+"-"+B;if(B!==o&&B.length>0&&!a("#"+D).length){g[0].id=D;s.content[0].id=D+"-content";s.title[0].id=D+"-title"}},"^content.text$":function(){O(f)},"^content.title.text$":function(){if(!f)return n();!d.elements.title&&f&&y();A(f)},"^content.title.button$":function(){var B=d.elements.button,D=d.elements.title;if(d.rendered)if(f){D||y();z()}else B.remove()},"^position.(my|at)$":function(){var B=/my$/i.test(e)?"my":"at";if("string"===typeof f)b.position[B]=new a.fn.qtip.plugins.Corner(f)},
"^position.container$":function(){d.rendered===w&&g.appendTo(f)},"^(show|hide).(event|target|fixed|delay|inactive)$":function(B,D,F,Q){var R=e.search(/fixed/i)>-1?[0,[0,1,1,1]]:[e.substr(0,3),e.charAt(0)==="s"?[1,0,0,0]:[0,1,0,0]];if(R[0])B[D]=Q;r.apply(d,R[1]);if(R[0])B[D]=F;l.apply(d,R[1])},"^show.ready$":function(){d.rendered===o&&d.show()},"^style.classes$":function(){a.attr(g[0],"class",N+" qtip ui-helper-reset "+f)},"^style.widget|content.title":x,"^events.(render|show|move|hide|focus|blur)$":function(B,
D,F){s.tooltip[(a.isFunction(f)?"":"un")+"bind"]("tooltip"+D,F)},"^position.(my|at|adjust|target|container)|style|content":function(){d.reposition()}}};a.each(d.plugins,function(B){if("object"===typeof this.checks)K[B]=this.checks});p=j[0][j[1]];j[0][j[1]]=f.nodeType?a(f):f;W(b);for(u in K)for(G in K[u])RegExp(G,"i").test(e)&&K[u][G].call(d,j[0],j[1],f,p);return d},toggle:function(e,f){function j(){if(e)a.browser.msie&&g[0].style.removeAttribute("filter");else g.css({display:"",visibility:"hidden",
width:"",opacity:"",left:"",top:""})}if(d.rendered===o)return o;var s=e?"show":"hide",p=b[s],u=m();if((typeof e).search("boolean|number"))e=!u;if(u===e)return d;if(f){if(/over|enter/.test(f.type)&&/out|leave/.test(d.cache.event.type)&&f.target===b.show.target[0]&&g.has(f.relatedTarget).length)return d;d.cache.event=a.extend({},f)}u=a.Event("tooltip"+s);u.originalEvent=f?d.cache.event:E;g.trigger(u,[d,90]);if(u.isDefaultPrevented())return d;a.attr(g[0],"aria-hidden",!!!e);if(e){g.hide().css({visibility:""});
d.focus(f);d.reposition(f,0);p.solo&&a(X).not(g).qtip("hide")}else{clearTimeout(d.timers.show);d.blur(f)}g.stop(1,1);if(a.isFunction(p.effect)){p.effect.call(g,d);g.queue("fx",function(G){j.call(this,G);G()})}else if(p.effect===o){g[s]();j.call(g)}else g.fadeTo(90,e?1:0,j);e&&p.target.trigger("qtip-"+i+"-inactive");return a.fn.qtip.lastShown=d},show:function(e){d.toggle(w,e)},hide:function(e){d.toggle(o,e)},focus:function(e){if(d.rendered===o)return o;var f=a(X),j=parseInt(g[0].style.zIndex,10),s=
a.fn.qtip.zindex+f.length;e=a.extend({},e);if(!g.hasClass(Y)){if(j!==s){f.each(function(){if(this.style.zIndex>j)this.style.zIndex-=1});f.filter("."+Y).qtip("blur",e)}d.cache.lastFocus=document.activeElement;f=a.Event("tooltipfocus");f.originalEvent=e;g.trigger(f,[d,s]);if(!f.isDefaultPrevented())g.addClass(Y)[0].style.zIndex=s}return d},blur:function(e){e=a.extend({},e);var f;g.removeClass(Y);f=a.Event("tooltipblur");f.originalEvent=e;g.trigger(f,[d])},reposition:function(e,f){if(d.rendered===o)return o;
var j=b.position.target,s=b.position,p=s.my,u=s.at,G=s.adjust,K=g.outerWidth(),B=g.outerHeight(),D=0,F=0,Q=a.Event("tooltipmove"),R=g.css("position")==="fixed",I=s.viewport.jquery?s.viewport:a(M),t={left:0,top:0},H={left:function(J){var L=I.scrollLeft,P=u.x==="left"?D:u.x==="right"?-D:-D/2,U=L-J;L=J+K-I.width-L;P=(p.x==="left"?K:p.x==="right"?-K:-K/2)-(p.precedance==="x"||p.x===p.y?P:0);if(U>0&&(p.x!=="left"||L>0))t.left-=P;else if(L>0&&(p.x!=="right"||U>0))t.left-=(p.x==="center"?-1:1)*P+2*G.x;if(t.left<
0&&-t.left>L)t.left=J;return t.left-J},top:function(J){var L=I.scrollTop,P=u.y==="top"?F:u.y==="bottom"?-F:-F/2,U=L-J;L=J+B-I.height-L;P=(p.y==="top"?B:p.y==="bottom"?-B:-B/2)-(p.precedance==="y"||p.x===p.y?P:0);if(U>0&&(p.y!=="top"||L>0))t.top-=P;else if(L>0&&(p.y!=="bottom"||U>0))t.top-=(p.y==="center"?-1:1)*P+2*G.y;if(t.top<0&&-t.top>L)t.top=J;return t.top-J}};f=f===T||!!f||o;I=!I?o:{elem:I,height:I[(I[0]===M?"h":"outerH")+"eight"](),width:I[(I[0]===M?"w":"outerW")+"idth"](),scrollLeft:I.scrollLeft(),
scrollTop:I.scrollTop()};if(j==="mouse"){u={x:"left",y:"top"};e=e&&(e.type==="resize"||e.type==="scroll")?d.cache.event:G.mouse||!e||!e.pageX?a.extend({},a.fn.qtip.mouse):e;t={top:e.pageY,left:e.pageX}}else{if(j==="event")j=e&&e.target&&e.type!=="scroll"&&e.type!=="resize"?d.cache.target=a(e.target):d.cache.target;j=a(j).eq(0);if(j.length===0)return d;else if(j[0]===document||j[0]===M){D=j.width();F=j.height();if(j[0]===M)t={top:R?0:I.scrollTop,left:R?0:I.scrollLeft}}else if(j.is("area")&&a.fn.qtip.plugins.imagemap){t=
a.fn.qtip.plugins.imagemap(j,u);D=t.width;F=t.height;t=t.offset}else if(j[0].namespaceURI=="http://www.w3.org/2000/svg"&&a.fn.qtip.plugins.svg){t=a.fn.qtip.plugins.svg(j,u);D=t.width;F=t.height;t=t.offset}else{D=j.outerWidth();F=j.outerHeight();t=h(j[0],s.container[0])}t.left+=u.x==="right"?D:u.x==="center"?D/2:0;t.top+=u.y==="bottom"?F:u.y==="center"?F/2:0}t.left+=G.x+(p.x==="right"?-K:p.x==="center"?-K/2:0);t.top+=G.y+(p.y==="bottom"?-B:p.y==="center"?-B/2:0);t.adjusted=s.viewport.jquery&&j[0]!==
M&&j[0]!==v?{left:H.left(t.left),top:H.top(t.top)}:{left:0,top:0};g.attr("class",function(){return a.attr(this,"class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass(N+"-pos-"+p.abbreviation());Q.originalEvent=a.extend({},e);g.trigger(Q,[d,t,I.elem]);if(Q.isDefaultPrevented())return d;delete t.adjusted;if(!f||!isNaN(t.left,t.top))g.css(t);else if(m()&&a.isFunction(s.effect)){s.effect.call(g,d,t);g.queue(function(J){a(this).css({opacity:"",height:""});a.browser.msie&&this.style&&this.style.removeAttribute("filter");
J()})}return d},redraw:function(){if(!d.rendered||!(a.browser.msie&&a.browser.version<8))return o;var e=N+"-fluid",f;g.css({width:"auto",height:"auto"}).addClass(e);f={height:g.outerHeight(),width:g.outerWidth()};a.each(["width","height"],function(j,s){var p=parseInt(g.css("max-"+s),10)||0,u=parseInt(g.css("min-"+s),10)||0;f[s]=p+u?Math.min(Math.max(f[s],u),p):f[s]});g.css(f).removeClass(e)},disable:function(e){var f=S;if("boolean"!==typeof e)e=!(g.hasClass(f)||d.cache.disabled);if(d.rendered){g.toggleClass(f,
e);a.attr(g[0],"aria-disabled",e)}else d.cache.disabled=!!e;return d},destroy:function(){var e=c[0],f=a.data(e,V);if(d.rendered){g.remove();a.each(d.plugins,function(){this.initialize==="render"&&this.destroy()})}clearTimeout(d.timers.show);clearTimeout(d.timers.hide);r(1,1,1,1);a.removeData(e,"qtip");f&&a.attr(e,"title",f);c.removeAttr("aria-describedby");return c}})}function ca(c,b){var i,k,q,h,m=a(this),x=a(document.body),n=this===document?x:m;k=m.metadata?m.metadata(b.metadata):E;h=b.metadata.type===
"html5"&&k?k[b.metadata.name]:E;var z=m.data(b.metadata.name||"qtipopts");try{z=typeof z==="string"?(new Function("return "+z))():z}catch(y){$("Unable to parse HTML5 attribute data: "+z)}h=a.extend(w,{},a.fn.qtip.defaults,b,typeof z==="object"?W(z):E,W(h||k));k&&a.removeData(this,"metadata");k=h.position;if("boolean"===typeof h.content.text){q=m.attr(h.content.attr);if(h.content.attr!==o&&q)h.content.text=q;else return o}if(k.container===o)k.container=x;if(k.target===o)k.target=n;if(h.show.target===
o)h.show.target=n;if(h.hide.target===o)h.hide.target=n;if(h.position.viewport===w)h.position.viewport=k.container;k.at=new a.fn.qtip.plugins.Corner(k.at);k.my=new a.fn.qtip.plugins.Corner(k.my);if(a.data(this,"qtip"))if(h.overwrite)m.qtip("destroy");else if(h.overwrite===o)return o;if(a.attr(this,"title")){a.data(this,V,a.attr(this,"title"));m.removeAttr("title")}i=new aa(m,h,c,!!q);a.data(this,"qtip",i);m.bind("remove.qtip",function(){i.destroy()});return i}function da(c){var b=this,i=c.elements.tooltip,
k=c.options.content.ajax,q=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;b.checks={"^content.ajax":function(h,m){if(m==="once")b.once();else k&&k.url&&b.load()}};a.extend(b,{init:function(){if(k&&k.url){b.load();i.one("tooltipshow",b.once)}},once:function(){k.once?b.destroy():i.bind("tooltipshow.qtip-ajax",b.load)},load:function(){var h=k.url.indexOf(" "),m=k.url,x;if(h>-1){x=m.substr(h);m=m.substr(0,h)}a.ajax(a.extend({success:function(n){if(x)n=a("<div/>").append(n.replace(q,"")).find(x);
c.set("content.text",n)},error:function(n,z,y){c.set("content.text",z+": "+y)},context:c},k,{url:m}));return b},destroy:function(){i.unbind(".qtip-ajax")}});b.init()}function ea(c,b,i){var k=Math.ceil(b/2),q=Math.ceil(i/2);b={bottomright:[[0,0],[b,i],[b,0]],bottomleft:[[0,0],[b,0],[0,i]],topright:[[0,i],[b,0],[b,i]],topleft:[[0,0],[0,i],[b,i]],topcenter:[[0,i],[k,0],[b,i]],bottomcenter:[[0,0],[b,0],[k,i]],rightcenter:[[0,0],[b,q],[0,i]],leftcenter:[[b,0],[b,i],[0,q]]};b.lefttop=b.bottomright;b.righttop=
b.bottomleft;b.leftbottom=b.topright;b.rightbottom=b.topleft;return b[c.string()]}function fa(c){function b(l,r,d){if(m.tip){l=a.extend({},q.corner);r=d.adjusted;var v;if(q.corner.fixed!==w){if(r.left)l.x=l.x==="center"?r.left>0?"left":"right":l.x==="left"?"right":"left";if(r.top)l.y=l.y==="center"?r.top>0?"top":"bottom":l.y==="top"?"bottom":"top";if(l.string()!==n.corner&&(n.top!==r.top||n.left!==r.left))v=q.update(l)}v||(v=q.position(l,0));if(v.right!==T)v.left=v.right;if(v.bottom!==T)v.top=v.bottom;
v.option=Math.max(0,h.offset);d.left-=v.left.charAt?v.option:(v.right?-1:1)*v.left;d.top-=v.top.charAt?v.option:(v.bottom?-1:1)*v.top;n.left=r.left;n.top=r.top;n.corner=l.string()}}function i(l,r,d){r=!r?l[l.precedance]:r;r="border-"+r+"-width";l=parseInt((m.titlebar&&l.y==="top"?m.titlebar:m.content).css(r),10);return(d?l||parseInt(x.css(r),10):l)||0}function k(l){var r=l.precedance==="y",d=z[r?"width":"height"],v=z[r?"height":"width"],C=l.string().indexOf("center")>-1,g=d*(C?0.5:1),e=Math.pow;l=
Math.round;var f=Math.sqrt(e(g,2)+e(v,2));g=[A/g*f,A/v*f];g[2]=Math.sqrt(e(g[0],2)-e(A,2));g[3]=Math.sqrt(e(g[1],2)-e(A,2));C=(f+g[2]+g[3]+(C?0:g[0]))/f;d=[l(C*v),l(C*d)];return{height:d[r?0:1],width:d[r?1:0]}}var q=this,h=c.options.style.tip,m=c.elements,x=m.tooltip,n={top:0,left:0,corner:""},z={width:h.width,height:h.height},y={},A=h.border||0,O=a("<canvas />")[0].getContext;q.corner=E;q.mimic=E;q.checks={"^position.my|style.tip.(corner|mimic|border)$":function(){q.init()||q.destroy();c.reposition()},
"^style.tip.(height|width)$":function(){z={width:h.width,height:h.height};q.create();q.update();c.reposition()},"^content.title.text|style.(classes|widget)$":function(){m.tip&&q.update()}};a.extend(q,{init:function(){var l=q.detectCorner()&&(O||a.browser.msie);if(l){q.create();q.update();x.unbind(".qtip-tip").bind("tooltipmove.qtip-tip",b)}return l},detectCorner:function(){var l=h.corner,r=c.options.position,d=r.at;r=r.my.string?r.my.string():r.my;if(l===o||r===o&&d===o)return o;else if(l===w)q.corner=
new a.fn.qtip.plugins.Corner(r);else if(!l.string){q.corner=new a.fn.qtip.plugins.Corner(l);q.corner.fixed=w}return q.corner.string()!=="centercenter"},detectColours:function(){var l=m.tip.css({backgroundColor:"",border:""}),r=q.corner,d=r[r.precedance],v="border-"+d+"-color";d="border"+d.charAt(0)+d.substr(1)+"Color";var C=/rgba?\(0, 0, 0(, 0)?\)|transparent/i;r=m.titlebar&&(r.y==="top"||r.y==="center"&&l.position().top+z.height/2+h.offset<m.titlebar.outerHeight(1))?m.titlebar:m.content;y.fill=l.css("background-color")||
"transparent";y.border=l[0].style[d];if(!y.fill||C.test(y.fill)){y.fill=r.css("background-color");if(C.test(y.fill))y.fill=x.css("background-color")}if(!y.border||C.test(y.border)){y.border=x.css(v);if(C.test(y.border)||y.border===a(document.body).css("color"))y.border=r.css(v)!==a(c.elements.content).css("color")?r.css(v):"transparent"}a("*",l).add(l).css("background-color","transparent").css("border","0px dashed transparent")},create:function(){var l=z.width,r=z.height;m.tip&&m.tip.remove();m.tip=
a("<div />",{"class":"ui-tooltip-tip"}).css({width:l,height:r}).prependTo(x);if(O)a("<canvas />").appendTo(m.tip)[0].getContext("2d").save();else{l='<vml:shape coordorigin="0,0" style="display:block; position:absolute; behavior:url(#default#VML);"></vml:shape>';m.tip.html(A?l+=l:l)}},update:function(l){var r=m.tip,d=r.children(),v=z.width,C=z.height,g=h.mimic,e=Math.round,f,j,s;if(!l)l=q.corner;if(g===o)g=l;else{g=new a.fn.qtip.plugins.Corner(g);g.precedance=l.precedance;if(g.x==="inherit")g.x=l.x;
else if(g.y==="inherit")g.y=l.y;else if(g.x===g.y)g[l.precedance]=l[l.precedance]}f=g.precedance;q.detectColours();A=y.border==="transparent"||y.border==="#123456"?0:h.border===w?i(l,E,w):h.border;j=ea(g,v,C);s=k(l);r.css(s);r=l.precedance==="y"?[e(g.x==="left"?A:g.x==="right"?s.width-v-A:(s.width-v)/2),e(g.y==="top"?s.height-C:0)]:[e(g.x==="left"?s.width-v:0),e(g.y==="top"?A:g.y==="bottom"?s.height-C-A:(s.height-C)/2)];if(O){d.attr(s);d=d[0].getContext("2d");d.restore();d.save();d.clearRect(0,0,
3E3,3E3);d.translate(r[0],r[1]);d.beginPath();d.moveTo(j[0][0],j[0][1]);d.lineTo(j[1][0],j[1][1]);d.lineTo(j[2][0],j[2][1]);d.closePath();d.fillStyle=y.fill;d.strokeStyle=y.border;d.lineWidth=A*2;d.lineJoin="miter";d.miterLimit=100;d.stroke();d.fill()}else{j="m"+j[0][0]+","+j[0][1]+" l"+j[1][0]+","+j[1][1]+" "+j[2][0]+","+j[2][1]+" xe";r[2]=A&&/^(r|b)/i.test(l.string())?1:0;d.css({antialias:""+(g.string().indexOf("center")>-1),left:r[0]-r[2]*Number(f==="x"),top:r[1]-r[2]*Number(f==="y"),width:v+A,
height:C+A}).each(function(p){var u=a(this);u.attr({coordsize:v+A+" "+(C+A),path:j,fillcolor:y.fill,filled:!!p,stroked:!!!p}).css({display:A||p?"block":"none"});!p&&A>0&&u.html()===""&&u.html('<vml:stroke weight="'+A*2+'px" color="'+y.border+'" miterlimit="1000" joinstyle="miter"  style="behavior:url(#default#VML); display:block;" />')})}return q.position(l,1)},position:function(l,r){var d=m.tip,v={},C=Math.max(0,h.offset),g,e,f;if(h.corner===o||!d)return o;l=l||q.corner;g=l.precedance;e=k(l);f=a.browser.msie&&
A&&/^(b|r)/i.test(l.string())?1:0;a.each(g==="y"?[l.x,l.y]:[l.y,l.x],function(j,s){var p,u;if(s==="center"){p=g==="y"?"left":"top";v[p]="50%";v["margin-"+p]=-Math.round(e[g==="y"?"width":"height"]/2)+C}else{p=i(l,s,w);u=a.browser.mozilla;var G=l.y+(u?"":"-")+l.x;u=(u?"-moz-":a.browser.webkit?"-webkit-":"")+(u?"border-radius-"+G:"border-"+G+"-radius");u=parseInt((m.titlebar&&l.y==="top"?m.titlebar:m.content).css(u),10)||parseInt(x.css(u),10)||0;v[s]=j||!A?i(l,s):C+(u>p?u:0)}});v[l[g]]-=e[g==="x"?"width":
"height"]+f;r&&d.css({top:"",bottom:"",left:"",right:"",margin:""}).css(v);return v},destroy:function(){m.tip&&m.tip.remove();x.unbind(".qtip-tip")}});q.init()}function ga(c){var b=this,i=c.options.show.modal,k=c.elements,q=k.tooltip;b.checks={"^show.modal.(on|blur)$":function(){b.init();k.overlay.toggle(q.is(":visible"))}};a.extend(b,{init:function(){if(i.on){q.unbind(".qtipmodal").bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(h,m,x){h=h.type.replace("tooltip","");a.isFunction(i[h])?
i[h].call(k.overlay,x,m):b[h](x)});b.create();i.blur===w&&k.overlay.unbind(".qtipmodal"+c.id).bind("click.qtipmodal"+c.id,function(){c.hide.call(c)})}},create:function(){var h=a("#qtip-overlay");if(h.length)k.overlay=h;else{k.overlay=a("<div />",{id:"#qtip-overlay".substr(1),css:{position:"absolute",top:0,left:0,display:"none",zIndex:parseInt(q.css("z-index"),10)-1}}).appendTo(document.body);a(M).bind("resize.qtipmodal",function(){k.overlay.css({height:Math.max(a(M).height(),a(document).height()),
width:Math.max(a(M).width(),a(document).width())})}).trigger("resize")}},toggle:function(h){var m=k.overlay,x=c.options.show.modal.effect,n=h?"show":"hide";m.stop(w,o);if(a.isFunction(x))x.call(m,h);else x===o?m[n]():m.fadeTo(90,h?0.7:0,function(){h||a(this).hide()})},show:function(){b.toggle(w)},hide:function(){b.toggle(o)},destroy:function(){var h=w;a("*").each(function(){var m=a(this).data("qtip");if(m&&m.id!==c.id&&m.options.show.modal)return h=o});if(h){k.overlay.remove();a(M).unbind(".qtipmodal")}else k.overlay.unbind(".qtipmodal"+
c.id);q.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});b.init()}function ha(c){var b=this,i=c.elements,k=i.tooltip,q=".bgiframe-"+c.id,h="tooltipmove"+q+" tooltipshow"+q;a.extend(b,{init:function(){i.bgiframe=a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>');i.bgiframe.appendTo(k);k.bind(h,b.adjust)},adjust:function(){var m=c.get("dimensions"),x=c.plugins.tip,
n=c.elements.tip,z;z=parseInt(k.css("border-left-width"),10)||0;z={left:-z,top:-z};if(x&&n){x=x.corner.precedance==="x"?["width","left"]:["height","top"];z[x[1]]-=n[x[0]]()}i.bgiframe.css(z).css(m)},destroy:function(){b.iframe.remove();k.unbind(h)}});b.init()}var w=true,o=false,E=null,N="ui-tooltip",Z="ui-widget",S="ui-state-disabled",X="div.qtip."+N,Y=N+"-focus",ba="-31000px",V="oldtitle";a.fn.qtip=function(c,b,i){var k=String(c).toLowerCase(),q=E,h=k==="disable"?[w]:a.makeArray(arguments).slice(1,
10),m=h[h.length-1],x=this[0]?a.data(this[0],"qtip"):E;if(!arguments.length&&x||k==="api")return x;else if("string"===typeof c){this.each(function(){var n=a.data(this,"qtip");if(!n)return w;if(/option|set/.test(k)&&b)if(i!==T)n.set(b,i);else q=n.get(b);else{if(!n.rendered&&(k==="show"||k==="toggle")){if(m&&m.timeStamp)n.cache.event=m;n.render(1)}else if(k==="enable"){k="disable";h=[o]}n[k]&&n[k].apply(n[k],h)}});return q!==E?q:this}else if("object"===typeof c||!arguments.length){x=W(a.extend(w,{},
c));return a.fn.qtip.bind.call(this,x,m)}};a.fn.qtip.bind=function(c,b){return this.each(function(){function i(z){function y(){n.render(typeof z==="object"||k.show.ready);q.show.unbind(h.show);q.hide.unbind(h.hide)}if(n.cache.disabled)return o;n.cache.event=a.extend({},z);if(k.show.delay>0){clearTimeout(n.timers.show);n.timers.show=setTimeout(y,k.show.delay);h.show!==h.hide&&q.hide.bind(h.hide,function(){clearTimeout(n.timers.show)})}else y()}var k,q,h,m=c.id=!c.id||c.id===o||c.id.length<1||a("#"+
N+"-"+c.id).length?a.fn.qtip.nextid++:c.id,x=".qtip-"+m+"-create",n=ca.call(this,m,c);if(n===o)return w;k=n.options;a.each(a.fn.qtip.plugins,function(){this.initialize==="initialize"&&this(n)});q={show:k.show.target,hide:k.hide.target};h={show:String(k.show.event).replace(" ",x+" ")+x,hide:String(k.hide.event).replace(" ",x+" ")+x};q.show.bind(h.show,i);if(k.show.ready||k.prerender)i(b)})};a.each({attr:function(c,b){if(this.length){var i=this[0],k=a.data(i,"qtip");if(c==="title")if(arguments.length<
2)return a.data(i,V);else if(typeof k==="object"){k&&k.rendered&&k.options.content.attr==="title"&&k.cache.attr&&k.set("content.text",b);a.fn.attr_replacedByqTip.apply(this,arguments);a.data(i,V,a.attr(i,"title"));return this.removeAttr("title")}}},clone:function(){var c=a([]),b;a("*",this).add(this).each(function(){var i=a.data(this,V);if(i){a.attr(this,"title",i);c=c.add(this)}});b=a.fn.clone_replacedByqTip.apply(this,arguments);c.removeAttr("title");return b},remove:a.ui?E:function(c,b){a(this).each(function(){if(!b)if(!c||
a.filter(c,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}},function(c,b){if(!b)return w;var i=a.fn[c+"_replacedByqTip"]=a.fn[c];a.fn[c]=function(){return b.apply(this,arguments)||i.apply(this,arguments)}});a(M).load(function(){var c=document,b=c.body;a(c).bind("mousemove.qtip",function(i){a.fn.qtip.mouse={pageX:i.pageX,pageY:i.pageY}});c.activeElement===T&&c.addEventListener("focus",function(i){if(i&&i.target)c.activeElement=i.target===c?b:i.target},true)});
a.fn.qtip.version="2.0.0pre";a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.plugins={Corner:function(c){c=String(c).replace(/([A-Z])/," $1").replace(/middle/gi,"center").toLowerCase();this.x=(c.match(/left|right/i)||c.match(/center/)||["inherit"])[0].toLowerCase();this.y=(c.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase();this.precedance=c.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 b=this.x.substr(0,1),i=this.y.substr(0,1);return b===i?b:b==="c"||b!=="c"&&i!=="c"?i+b:b+i}},iOS:parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))<4.1};a.fn.qtip.defaults={prerender:o,id:o,overwrite:w,content:{text:w,attr:"title",title:{text:o,button:o}},position:{my:"top left",at:"bottom right",target:o,container:o,viewport:o,adjust:{x:0,
y:0,mouse:w,resize:w},effect:w},show:{target:o,event:"mouseenter",effect:w,delay:90,solo:o,ready:o},hide:{target:o,event:"mouseleave",effect:w,delay:0,fixed:o,inactive:o},style:{classes:"",widget:o},events:{render:E,move:E,show:E,hide:E,toggle:E,focus:E,blur:E}};a.fn.qtip.plugins.ajax=function(c){var b=c.plugins.ajax;return"object"===typeof b?b:c.plugins.ajax=new da(c)};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(c){var b=c.content;if(b&&"ajax"in b){b=b.ajax;
if(typeof b!=="object")b=c.content.ajax={url:b};if("boolean"!==typeof b.once&&b.once)b.once=!!b.once}};a.extend(w,a.fn.qtip.defaults,{content:{ajax:{once:w}}});a.fn.qtip.plugins.tip=function(c){var b=c.plugins.tip;return"object"===typeof b?b:c.plugins.tip=new fa(c)};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(c){var b=c.style;if(b&&"tip"in b){b=c.style.tip;if(typeof b!=="object")c.style.tip={corner:b};if(!/string|boolean/i.test(typeof b.corner))b.corner=w;typeof b.width!==
"number"&&delete b.width;typeof b.height!=="number"&&delete b.height;typeof b.border!=="number"&&b.border!==w&&delete b.border;typeof b.offset!=="number"&&delete b.offset}};a.extend(w,a.fn.qtip.defaults,{style:{tip:{corner:w,mimic:o,width:6,height:6,border:w,offset:0}}});a.fn.qtip.plugins.imagemap=function(c,b){function i(A,O){for(var l=0,r=1,d=1,v=0,C=0,g=A.width,e=A.height;g>0&&e>0&&r>0&&d>0;){g=Math.floor(g/2);e=Math.floor(e/2);if(b.x==="left")r=g;else if(b.x==="right")r=A.width-g;else r+=Math.floor(g/
2);if(b.y==="top")d=e;else if(b.y==="bottom")d=A.height-e;else d+=Math.floor(e/2);for(l=O.length;l--;){if(O.length<2)break;v=O[l][0]-A.offset.left;C=O[l][1]-A.offset.top;if(b.x==="left"&&v>=r||b.x==="right"&&v<=r||b.x==="center"&&(v<r||v>A.width-r)||b.y==="top"&&C>=d||b.y==="bottom"&&C<=d||b.y==="center"&&(C<d||C>A.height-d))O.splice(l,1)}}return{left:O[0][0],top:O[0][1]}}var k=c.attr("shape").toLowerCase(),q=c.attr("coords").split(","),h=[],m=a('img[usemap="#'+c.parent("map").attr("name")+'"]'),
x=m.offset(),n={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},z=0,y=0;x.left+=Math.ceil((m.outerWidth()-m.width())/2);x.top+=Math.ceil((m.outerHeight()-m.height())/2);if(k==="poly")for(z=q.length;z--;){y=[parseInt(q[--z],10),parseInt(q[z+1],10)];if(y[0]>n.offset.right)n.offset.right=y[0];if(y[0]<n.offset.left)n.offset.left=y[0];if(y[1]>n.offset.bottom)n.offset.bottom=y[1];if(y[1]<n.offset.top)n.offset.top=y[1];h.push(y)}else h=a.map(q,function(A){return parseInt(A,10)});switch(k){case "rect":n=
{width:Math.abs(h[2]-h[0]),height:Math.abs(h[3]-h[1]),offset:{left:h[0],top:h[1]}};break;case "circle":n={width:h[2]+2,height:h[2]+2,offset:{left:h[0],top:h[1]}};break;case "poly":a.extend(n,{width:Math.abs(n.offset.right-n.offset.left),height:Math.abs(n.offset.bottom-n.offset.top)});n.offset=b.string()==="centercenter"?{left:n.offset.left+n.width/2,top:n.offset.top+n.height/2}:i(n,h.slice());n.width=n.height=0;break}n.offset.left+=x.left;n.offset.top+=x.top;return n};a.fn.qtip.plugins.svg=function(c){var b=
a(document),i=c[0];c={width:0,height:0,offset:{top:1E10,left:1E10}};var k,q,h;if(i.getBBox){k=i.getBBox();q=i.getScreenCTM();i=i.farthestViewportElement||i;if(!i.createSVGPoint)return c;i=i.createSVGPoint();i.x=k.x;i.y=k.y;h=i.matrixTransform(q);c.offset.left=h.x;c.offset.top=h.y;i.x+=k.width;i.y+=k.height;h=i.matrixTransform(q);c.width=h.x-c.offset.left;c.height=h.y-c.offset.top;c.offset.left+=b.scrollLeft();c.offset.top+=b.scrollTop()}return c};a.fn.qtip.plugins.modal=function(c){var b=c.plugins.modal;
return"object"===typeof b?b:c.plugins.modal=new ga(c)};a.fn.qtip.plugins.modal.initialize="render";a.fn.qtip.plugins.modal.sanitize=function(c){if(c.show)if(typeof c.show.modal!=="object")c.show.modal={on:!!c.show.modal};else if(typeof c.show.modal.on==="undefined")c.show.modal.on=w};a.extend(w,a.fn.qtip.defaults,{show:{modal:{on:o,effect:w,blur:w}}});a.fn.qtip.plugins.bgiframe=function(c){if(!(a.browser.msie&&/^6\.[0-9]/.test(a.browser.version)&&a("select, object").length))return o;var b=c.plugins.bgiframe;
if(b)return b;else{c.plugins.bgiframe=new ha(c);return c.plugins.bgiframe}};a.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);
