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

