/*
* qTip - The jQuery tooltip plugin
* http://craigsworks.com/projects/qtip/
*
* Version: 2.0.0pre
* Copyright 2009 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPL Version 2 licenses
*   http://en.wikipedia.org/wiki/MIT_License
*   http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sat Aug 28 23:20:50 2010 +0100
*/

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

