/*
* 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: Sun Jan 2 05:32:48 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */

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

