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

