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

