/*
* qTip2 - Pretty pwoerful 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 Dec 24 05:40:57 2010 +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 */

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

