/*  Prototip 2.2.5 - 21-09-2011
 *  Copyright (c) 2008-2011 Nick Stakenburg (http://www.nickstakenburg.com)
 *
 *  Licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License
 *  http://creativecommons.org/licenses/by-nc-nd/3.0/
 *
 *  More information on this project:
 *  http://www.nickstakenburg.com/projects/prototip2/
 */

var Prototip = {
  Version: '2.2.5'
};

var Tips = {
  options: {
    // paths can be relative to this file or an absolute url
    paths: {
      images:     '/lturfly/css/cssimg/prototip/',
      javascript: '/lturfly/css/'
    },
    zIndex: 6000
  }
};

//replace with content of styles.js to skip loading that file
Prototip.Styles = null;

Object.extend(Prototip, {
    REQUIRED_Prototype: "1.7",
    support: {
        canvas: !! document.createElement("canvas").getContext
    },
    insertScript: function (a) {
        try {
            document.write("<script type='text/javascript' src='" + a + "'></script>")
        } catch (b) {
            $$("head")[0].insert(new Element("script", {
                src: a,
                type: "text/javascript"
            }))
        }
    },
    start: function () {
        this.require("Prototype"), window.jQuery && window.$ && window.$ == window.jQuery && alert("Prototip detected jQuery on the page without jQuery.noConflict enabled.\njQuery.noConflict has to be enabled for Prototip to work.\n\nYou can find documentation for it on the jQuery website, there's also\nan example in the Troubleshooting section of the Prototip website.");
        var a = /prototip([\w\d-_.]+)?\.js(.*)/;
        this.path = (($$("script[src]").find(function (b) {
            return b.src.match(a)
        }) || {}).src || "").replace(a, ""), Tips.paths = {
            images: /^(https?:\/\/|\/)/.test(Tips.options.paths.images) ? Tips.options.paths.images : this.path + Tips.options.paths.images,
            javascript: /^(https?:\/\/|\/)/.test(Tips.options.paths.javascript) ? Tips.options.paths.javascript : this.path + Tips.options.paths.javascript
        }, Prototip.Styles || this.insertScript(Tips.paths.javascript + "styles.js"), this.support.canvas || (document.documentMode >= 8 && !document.namespaces.ns_vml ? document.namespaces.add("ns_vml", "urn:schemas-microsoft-com:vml", "#default#VML") : document.observe("dom:loaded", function () {
            document.createStyleSheet().cssText = "ns_vml\\:*{behavior:url(#default#VML)}"
        })), Tips.initialize(), Element.observe(window, "unload", this.unload)
    },
    require: function (a) {
        if (typeof window[a] == "undefined" || this.convertVersionString(window[a].Version) < this.convertVersionString(this["REQUIRED_" + a])) throw "Prototip requires " + a + " >= " + this["REQUIRED_" + a]
    },
    convertVersionString: function (a) {
        var b = a.replace(/_.*|\./g, ""),
            b = parseInt(b + "0".times(4 - b.length));
        return a.indexOf("_") > -1 ? b - 1 : b
    },
    toggleInt: function (a) {
        return a > 0 ? -1 * a : a.abs()
    },
    unload: function () {
        Tips.removeAll()
    }
}), Object.extend(Tips, function () {
    function a(a) {
        a && (a.deactivate(), a.tooltip && (a.wrapper.remove(), Tips.fixIE && a.iframeShim.remove()), Tips.tips = Tips.tips.without(a))
    }
    return {
        tips: [],
        visible: [],
        initialize: function () {
            this.zIndexTop = this.zIndex
        },
        _inverse: {
            left: "right",
            right: "left",
            top: "bottom",
            bottom: "top",
            middle: "middle",
            horizontal: "vertical",
            vertical: "horizontal"
        },
        _stemTranslation: {
            width: "horizontal",
            height: "vertical"
        },
        inverseStem: function (a, b) {
            return b ? this._inverse[a] : a
        },
        fixIE: function (a) {
            return (a = /MSIE ([\d.]+)/.exec(a)) ? parseFloat(a[1]) < 7 : !1
        }(navigator.userAgent),
        WebKit419: Prototype.Browser.WebKit && !document.evaluate,
        add: function (a) {
            this.tips.push(a)
        },
        remove: function (b) {
            for (var c, d = [], e = 0, f = this.tips.length; e < f; e++) {
                var g = this.tips[e];
                !c && g.element == $(b) ? c = g : g.element.parentNode || d.push(g)
            }
            a(c), e = 0;
            for (f = d.length; e < f; e++) g = d[e], a(g);
            b.prototip = null
        },
        removeAll: function () {
            for (var b = 0, c = this.tips.length; b < c; b++) a(this.tips[b])
        },
        raise: function (a) {
            if (a != this._highest) {
                if (this.visible.length === 0) {
                    this.zIndexTop = this.options.zIndex;
                    for (var b = 0, c = this.tips.length; b < c; b++) this.tips[b].wrapper.setStyle({
                        zIndex: this.options.zIndex
                    })
                }
                a.wrapper.setStyle({
                    zIndex: this.zIndexTop++
                }), a.loader && a.loader.setStyle({
                    zIndex: this.zIndexTop
                }), this._highest = a
            }
        },
        addVisibile: function (a) {
            this.removeVisible(a), this.visible.push(a)
        },
        removeVisible: function (a) {
            this.visible = this.visible.without(a)
        },
        hideAll: function () {
            Tips.visible.invoke("hide")
        },
        hook: function (a, b, c) {
            a = $(a), b = $(b);
            var c = Object.extend({
                offset: {
                    x: 0,
                    y: 0
                },
                position: !1
            }, c || {}),
                d = c.mouse || b.cumulativeOffset();
            d.left += c.offset.x, d.top += c.offset.y;
            var e = c.mouse ? [0, 0] : b.cumulativeScrollOffset(),
                f = document.viewport.getScrollOffsets(),
                g = c.mouse ? "mouseHook" : "target";
            d.left += -1 * (e[0] - f[0]), d.top += -1 * (e[1] - f[1]);
            if (c.mouse) {
                var h = [0, 0];
                h.width = 0, h.height = 0
            }
            e = {
                element: a.getDimensions()
            }, f = {
                element: Object.clone(d)
            }, e[g] = c.mouse ? h : b.getDimensions(), f[g] = Object.clone(d);
            for (var i in f) switch (c[i]) {
            case "topRight":
            case "rightTop":
                f[i].left += e[i].width;
                break;
            case "topMiddle":
                f[i].left += e[i].width / 2;
                break;
            case "rightMiddle":
                f[i].left += e[i].width, f[i].top += e[i].height / 2;
                break;
            case "bottomLeft":
            case "leftBottom":
                f[i].top += e[i].height;
                break;
            case "bottomRight":
            case "rightBottom":
                f[i].left += e[i].width, f[i].top += e[i].height;
                break;
            case "bottomMiddle":
                f[i].left += e[i].width / 2, f[i].top += e[i].height;
                break;
            case "leftMiddle":
                f[i].top += e[i].height / 2
            }
            return d.left += -1 * (f.element.left - f[g].left), d.top += -1 * (f.element.top - f[g].top), c.position && a.setStyle({
                left: d.left + "px",
                top: d.top + "px"
            }), d
        }
    }
}()), Tips.initialize();
var Tip = Class.create({
    initialize: function (a, b, c) {
        this.element = $(a);
        if (!this.element) throw "Prototip: Element not available, cannot create a tooltip.";
        Tips.remove(this.element), c = (a = Object.isString(b) || Object.isElement(b)) ? c || [] : b, this.content = a ? b : null, c.style && (c = Object.extend(Object.clone(Prototip.Styles[c.style]), c)), this.options = Object.extend(Object.extend({
            ajax: !1,
            border: 0,
            borderColor: "#000000",
            radius: 0,
            className: Tips.options.className,
            closeButton: Tips.options.closeButtons,
            delay: !c.showOn || c.showOn != "click" ? .14 : !1,
            hideAfter: !1,
            hideOn: "mouseleave",
            hideOthers: !1,
            hook: c.hook,
            offset: c.hook ? {
                x: 0,
                y: 0
            } : {
                x: 16,
                y: 16
            },
            fixed: c.hook && !c.hook.mouse ? !0 : !1,
            showOn: "mousemove",
            stem: !1,
            style: "default",
            target: this.element,
            title: !1,
            viewport: c.hook && !c.hook.mouse ? !1 : !0,
            width: !1
        }, Prototip.Styles["default"]), c), this.target = $(this.options.target), this.radius = this.options.radius, this.border = this.radius > this.options.border ? this.radius : this.options.border, this.images = this.options.images ? this.options.images.include("://") ? this.options.images : Tips.paths.images + this.options.images : Tips.paths.images + "styles/" + (this.options.style || "") + "/", this.images.endsWith("/") || (this.images += "/"), Object.isString(this.options.stem) && (this.options.stem = {
            position: this.options.stem
        }), this.options.stem.position && (this.options.stem = Object.extend(Object.clone(Prototip.Styles[this.options.style].stem) || {}, this.options.stem), this.options.stem.position = [this.options.stem.position.match(/[a-z]+/)[0].toLowerCase(), this.options.stem.position.match(/[A-Z][a-z]+/)[0].toLowerCase()], this.options.stem.orientation = ["left", "right"].member(this.options.stem.position[0]) ? "horizontal" : "vertical", this.stemInverse = {
            horizontal: !1,
            vertical: !1
        }), this.options.ajax && (this.options.ajax.options = Object.extend({
            onComplete: Prototype.emptyFunction
        }, this.options.ajax.options || {})), this.options.hook.mouse && (b = this.options.hook.tip.match(/[a-z]+/)[0].toLowerCase(), this.mouseHook = Tips._inverse[b] + Tips._inverse[this.options.hook.tip.match(/[A-Z][a-z]+/)[0].toLowerCase()].capitalize()), this.fixSafari2 = Tips.WebKit419 && this.radius, this.setup(), Tips.add(this), this.activate(), Prototip.extend(this)
    },
    setup: function () {
        this.wrapper = (new Element("div", {
            className: "prototip"
        })).setStyle({
            zIndex: Tips.options.zIndex
        }), this.fixSafari2 && (this.wrapper.hide = function () {
            return this.setStyle("left:-9500px;top:-9500px;visibility:hidden;"), this
        }, this.wrapper.show = function () {
            return this.setStyle("visibility:visible"), this
        }, this.wrapper.visible = function () {
            return this.getStyle("visibility") == "visible" && parseFloat(this.getStyle("top").replace("px", "")) > -9500
        }), this.wrapper.hide(), Tips.fixIE && (this.iframeShim = (new Element("iframe", {
            className: "iframeShim",
            src: "javascript:false;",
            frameBorder: 0
        })).setStyle({
            display: "none",
            zIndex: Tips.options.zIndex - 1,
            opacity: 0
        })), this.options.ajax && (this.showDelayed = this.showDelayed.wrap(this.ajaxShow)), this.tip = new Element("div", {
            className: "content"
        }), this.title = (new Element("div", {
            className: "title"
        })).hide();
        if (this.options.closeButton || this.options.hideOn.element && this.options.hideOn.element == "closeButton") this.closeButton = (new Element("div", {
            className: "close"
        })).setPngBackground(this.images + "close.png")
    },
    build: function () {
        if (document.loaded) return this._build(), this._isBuilding = !0;
        if (!this._isBuilding) return document.observe("dom:loaded", this._build), !1
    },
    _build: function () {
        $(document.body).insert(this.wrapper), Tips.fixIE && $(document.body).insert(this.iframeShim), this.options.ajax && $(document.body).insert(this.loader = (new Element("div", {
            className: "prototipLoader"
        })).setPngBackground(this.images + "loader.gif").hide());
        var a = "wrapper";
        if (this.options.stem.position) {
            this.stem = (new Element("div", {
                className: "prototip_Stem"
            })).setStyle({
                height: this.options.stem[this.options.stem.orientation == "vertical" ? "height" : "width"] + "px"
            });
            var b = this.options.stem.orientation == "horizontal";
            this[a].insert(this.stemWrapper = (new Element("div", {
                className: "prototip_StemWrapper clearfix"
            })).insert(this.stemBox = new Element("div", {
                className: "prototip_StemBox clearfix"
            }))), this.stem.insert(this.stemImage = (new Element("div", {
                className: "prototip_StemImage"
            })).setStyle({
                height: this.options.stem[b ? "width" : "height"] + "px",
                width: this.options.stem[b ? "height" : "width"] + "px"
            })), Tips.fixIE && !this.options.stem.position[1].toUpperCase().include("MIDDLE") && this.stemImage.setStyle({
                display: "inline"
            }), a = "stemBox"
        }
        if (this.border) {
            var c = this.border,
                d;
            this[a].insert(this.borderFrame = (new Element("ul", {
                className: "borderFrame"
            })).insert(this.borderTop = (new Element("li", {
                className: "borderTop borderRow"
            })).setStyle("height: " + c + "px").insert((new Element("div", {
                className: "prototip_CornerWrapper prototip_CornerWrapperTopLeft"
            })).insert(new Element("div", {
                className: "prototip_Corner"
            }))).insert(d = (new Element("div", {
                className: "prototip_BetweenCorners"
            })).setStyle({
                height: c + "px"
            }).insert((new Element("div", {
                className: "prototip_Between"
            })).setStyle({
                margin: "0 " + c + "px",
                height: c + "px"
            }))).insert((new Element("div", {
                className: "prototip_CornerWrapper prototip_CornerWrapperTopRight"
            })).insert(new Element("div", {
                className: "prototip_Corner"
            })))).insert(this.borderMiddle = (new Element("li", {
                className: "borderMiddle borderRow"
            })).insert(this.borderCenter = (new Element("div", {
                className: "borderCenter"
            })).setStyle("padding: 0 " + c + "px"))).insert(this.borderBottom = (new Element("li", {
                className: "borderBottom borderRow"
            })).setStyle("height: " + c + "px").insert((new Element("div", {
                className: "prototip_CornerWrapper prototip_CornerWrapperBottomLeft"
            })).insert(new Element("div", {
                className: "prototip_Corner"
            }))).insert(d.cloneNode(!0)).insert((new Element("div", {
                className: "prototip_CornerWrapper prototip_CornerWrapperBottomRight"
            })).insert(new Element("div", {
                className: "prototip_Corner"
            })))));
            var a = "borderCenter",
                e = this.borderFrame.select(".prototip_Corner");
            $w("tl tr bl br").each(function (a, b) {
                this.radius > 0 ? Prototip.createCorner(e[b], a, {
                    backgroundColor: this.options.borderColor,
                    border: c,
                    radius: this.options.radius
                }) : e[b].addClassName("prototip_Fill"), e[b].setStyle({
                    width: c + "px",
                    height: c + "px"
                }).addClassName("prototip_Corner" + a.capitalize())
            }.bind(this)), this.borderFrame.select(".prototip_Between", ".borderMiddle", ".prototip_Fill").invoke("setStyle", {
                backgroundColor: this.options.borderColor
            })
        }
        this[a].insert(this.tooltip = (new Element("div", {
            className: "tooltip " + this.options.className
        })).insert(this.toolbar = (new Element("div", {
            className: "toolbar"
        })).insert(this.title))), this.options.width && (a = this.options.width, Object.isNumber(a) && (a += "px"), this.tooltip.setStyle("width:" + a)), this.stem && (a = {}, a[this.options.stem.orientation == "horizontal" ? "top" : "bottom"] = this.stem, this.wrapper.insert(a), this.positionStem()), this.tooltip.insert(this.tip), this.options.ajax || this._update({
            title: this.options.title,
            content: this.content
        })
    },
    _update: function (a) {
        var b = this.wrapper.getStyle("visibility");
        this.wrapper.setStyle("height:auto;width:auto;visibility:hidden").show(), this.border && (this.borderTop.setStyle("height:0"), this.borderTop.setStyle("height:0")), a.title ? (this.title.show().update(a.title), this.toolbar.show()) : this.closeButton || (this.title.hide(), this.toolbar.hide()), Object.isElement(a.content) && a.content.show(), (Object.isString(a.content) || Object.isElement(a.content)) && this.tip.update(a.content), this.tooltip.setStyle({
            width: this.tooltip.getWidth() + "px"
        }), this.wrapper.setStyle("visibility:visible").show(), this.tooltip.show();
        var c = this.tooltip.getDimensions(),
            d = {
                width: c.width + "px"
            },
            e = [this.wrapper];
        Tips.fixIE && e.push(this.iframeShim), this.closeButton && (this.title.show().insert({
            top: this.closeButton
        }), this.toolbar.show()), (a.title || this.closeButton) && this.toolbar.setStyle("width: 100%"), d.height = null, this.wrapper.setStyle({
            visibility: b
        }), this.tip.addClassName("clearfix"), (a.title || this.closeButton) && this.title.addClassName("clearfix"), this.border && (this.borderTop.setStyle("height:" + this.border + "px"), this.borderTop.setStyle("height:" + this.border + "px"), d = "width: " + (c.width + 2 * this.border) + "px", e.push(this.borderFrame)), e.invoke("setStyle", d), this.stem && (this.positionStem(), this.options.stem.orientation == "horizontal" && this.wrapper.setStyle({
            width: this.wrapper.getWidth() + this.options.stem.height + "px"
        })), this.wrapper.hide()
    },
    activate: function () {
        this.eventShow = this.showDelayed.bindAsEventListener(this), this.eventHide = this.hide.bindAsEventListener(this), this.options.fixed && this.options.showOn == "mousemove" && (this.options.showOn = "mouseover"), this.options.showOn && this.options.showOn == this.options.hideOn && (this.eventToggle = this.toggle.bindAsEventListener(this), this.element.observe(this.options.showOn, this.eventToggle)), this.closeButton && this.closeButton.observe("mouseover", function (a) {
            a.setPngBackground(this.images + "close_hover.png")
        }.bind(this, this.closeButton)).observe("mouseout", function (a) {
            a.setPngBackground(this.images + "close.png")
        }.bind(this, this.closeButton));
        var a = {
            element: this.eventToggle ? [] : [this.element],
            target: this.eventToggle ? [] : [this.target],
            tip: this.eventToggle ? [] : [this.wrapper],
            closeButton: [],
            none: []
        },
            b = this.options.hideOn.element;
        this.hideElement = b || (this.options.hideOn ? "element" : "none"), this.hideTargets = a[this.hideElement], !this.hideTargets && b && Object.isString(b) && (this.hideTargets = this.tip.select(b)), $w("show hide").each(function (a) {
            a.capitalize(), this[a + "Action"] = this.options[a + "On"].event || this.options[a + "On"]
        }.bind(this)), !this.eventToggle && this.options.showOn && this.element.observe(this.options.showOn, this.eventShow), this.hideTargets && this.options.hideOn && this.hideTargets.invoke("observe", this.hideAction, this.eventHide), !this.options.fixed && this.options.showOn == "click" && (this.eventPosition = this.position.bindAsEventListener(this), this.element.observe("mousemove", this.eventPosition)), this.buttonEvent = this.hide.wrap(function (a, b) {
            var c = b.findElement(".close");
            c && (c.blur(), b.stop(), a(b))
        }).bindAsEventListener(this), (this.closeButton || this.options.hideOn && this.options.hideOn.element == ".close") && this.wrapper.observe("click", this.buttonEvent), this.options.showOn != "click" && this.hideElement != "element" && (this.eventCheckDelay = function () {
            this.clearTimer("show")
        }.bindAsEventListener(this), this.element.observe("mouseleave", this.eventCheckDelay));
        if (this.options.hideOn || this.options.hideAfter) a = [this.element, this.wrapper], this.activityEnter = function () {
            Tips.raise(this), this.cancelHideAfter()
        }.bindAsEventListener(this), this.activityLeave = this.hideAfter.bindAsEventListener(this), a.invoke("observe", "mouseenter", this.activityEnter).invoke("observe", "mouseleave", this.activityLeave);
        this.options.ajax && this.options.showOn != "click" && (this.ajaxHideEvent = this.ajaxHide.bindAsEventListener(this), this.element.observe("mouseleave", this.ajaxHideEvent))
    },
    deactivate: function () {
        this.options.showOn && this.options.showOn == this.options.hideOn ? this.element.stopObserving(this.options.showOn, this.eventToggle) : (this.options.showOn && this.element.stopObserving(this.options.showOn, this.eventShow), this.hideTargets && this.options.hideOn && this.hideAction && this.eventHide && this.hideTargets.invoke("stopObserving", this.hideAction, this.eventHide)), this.eventPosition && this.element.stopObserving("mousemove", this.eventPosition), this.eventCheckDelay && this.element.stopObserving("mouseout", this.eventCheckDelay), this.wrapper.stopObserving(), (this.options.hideOn || this.options.hideAfter) && this.element.stopObserving("mouseenter", this.activityEnter).stopObserving("mouseleave", this.activityLeave), this.ajaxHideEvent && this.element.stopObserving("mouseleave", this.ajaxHideEvent)
    },
    ajaxShow: function (a, b) {
        if (this.tooltip || this.build()) if (this.position(b), !this.ajaxContentLoading) if (this.ajaxContentLoaded) a(b);
        else {
            this.ajaxContentLoading = !0;
            var c = {
                fakePointer: {
                    pointerX: 0,
                    pointerY: 0
                }
            };
            if (b.pointer) var d = b.pointer(),
                e = document.viewport.getScrollOffsets(),
                c = {
                    fakePointer: {
                        pointerX: d.x - e[0],
                        pointerY: d.y - e[1]
                    }
                };
            else b.fakePointer && (c.fakePointer = b.fakePointer);
            var f = Object.clone(this.options.ajax.options);
            return f.onComplete = f.onComplete.wrap(function (a, b) {
                this._update({
                    title: this.options.title,
                    content: b.responseText
                }), this.position(c), function () {
                    a(b);
                    var c = this.loader && this.loader.visible();
                    this.loader && (this.clearTimer("loader"), this.loader.remove(), this.loader = null), c && this.show(), this.ajaxContentLoaded = !0, this.ajaxContentLoading = null
                }.bind(this).delay(.6)
            }.bind(this)), this.loaderTimer = Element.show.delay(this.options.delay, this.loader), this.wrapper.hide(), this.ajaxContentLoading = !0, this.loader.show(), this.ajaxTimer = function () {
                new Ajax.Request(this.options.ajax.url, f)
            }.bind(this).delay(this.options.delay), !1
        }
    },
    ajaxHide: function () {
        this.clearTimer("loader")
    },
    showDelayed: function (a) {
        if (this.tooltip || this.build()) if (this.position(a), !this.wrapper.visible()) this.clearTimer("show"), this.showTimer = this.show.bind(this).delay(this.options.delay)
    },
    clearTimer: function (a) {
        this[a + "Timer"] && clearTimeout(this[a + "Timer"])
    },
    show: function () {
        this.wrapper.visible() || (Tips.fixIE && this.iframeShim.show(), this.options.hideOthers && Tips.hideAll(), Tips.addVisibile(this), this.tooltip.show(), this.wrapper.show(), this.stem && this.stem.show(), this.element.fire("prototip:shown"))
    },
    hideAfter: function () {
        this.options.ajax && this.loader && this.options.showOn != "click" && this.loader.hide(), this.options.hideAfter && (this.cancelHideAfter(), this.hideAfterTimer = this.hide.bind(this).delay(this.options.hideAfter))
    },
    cancelHideAfter: function () {
        this.options.hideAfter && this.clearTimer("hideAfter")
    },
    hide: function () {
        this.clearTimer("show"), this.clearTimer("loader"), this.wrapper.visible() && this.afterHide()
    },
    afterHide: function () {
        Tips.fixIE && this.iframeShim.hide(), this.loader && this.loader.hide(), this.wrapper.hide(), (this.borderFrame || this.tooltip).show(), Tips.removeVisible(this), this.element.fire("prototip:hidden")
    },
    toggle: function (a) {
        this.wrapper && this.wrapper.visible() ? this.hide(a) : this.showDelayed(a)
    },
    positionStem: function (a) {
        var b = this.options.stem,
            a = a || this.stemInverse,
            c = Tips.inverseStem(b.position[0], a[b.orientation]),
            d = Tips.inverseStem(b.position[1], a[Tips._inverse[b.orientation]]),
            e = b.margin || 0;
        this.stemImage.setPngBackground(this.images + c + d + ".png");
        if (b.orientation == "horizontal") this.stemWrapper.setStyle("left: " + (c == "left" ? b.height : 0) + "px;"), this.stemImage.setStyle({
            "float": c
        }), this.stem.setStyle({
            left: 0,
            top: d == "bottom" ? "100%" : d == "middle" ? "50%" : 0,
            marginTop: (d == "bottom" ? -1 * b.width : d == "middle" ? -0.5 * b.width : 0) + (d == "bottom" ? -1 * e : d == "top" ? e : 0) + "px"
        });
        else if (this.stemWrapper.setStyle(c == "top" ? "margin: 0; padding: " + b.height + "px 0 0 0;" : "padding: 0; margin: 0 0 " + b.height + "px 0;"), this.stem.setStyle(c == "top" ? "top: 1px; bottom: auto;" : "top: auto; bottom: 1px;"), this.stemImage.setStyle({
            margin: 0,
            "float": d != "middle" ? d : "none"
        }), d == "middle" ? this.stemImage.setStyle("margin: 0 auto;") : this.stemImage.setStyle("margin-" + d + ": " + e + "px;"), Tips.WebKit419) c == "bottom" ? (this.stem.setStyle({
            position: "relative",
            clear: "both",
            top: "auto",
            bottom: "auto",
            "float": "left",
            width: "100%",
            margin: -1 * b.height + 10 + "px 0 0 0"
        }), this.stem.style.display = "block") : this.stem.setStyle({
            position: "absolute",
            "float": "none",
            margin: 0
        });
        this.stemInverse = a
    },
    position: function (a) {
        if (this.tooltip || this.build()) {
            Tips.raise(this);
            if (Tips.fixIE) {
                var b = this.wrapper.getDimensions();
                (!this.iframeShimDimensions || this.iframeShimDimensions.height != b.height || this.iframeShimDimensions.width != b.width) && this.iframeShim.setStyle({
                    width: b.width + "px",
                    height: b.height + "px"
                }), this.iframeShimDimensions = b
            }
            if (this.options.hook) {
                if (this.mouseHook) {
                    var c = document.viewport.getScrollOffsets(),
                        b = a.fakePointer || {},
                        d;
                    switch (this.mouseHook.toUpperCase()) {
                    case "LEFTTOP":
                    case "TOPLEFT":
                        d = {
                            x: -2,
                            y: -2
                        };
                        break;
                    case "TOPMIDDLE":
                        d = {
                            x: 0,
                            y: -2
                        };
                        break;
                    case "TOPRIGHT":
                    case "RIGHTTOP":
                        d = {
                            x: 2,
                            y: -2
                        };
                        break;
                    case "RIGHTMIDDLE":
                        d = {
                            x: 2,
                            y: 0
                        };
                        break;
                    case "RIGHTBOTTOM":
                    case "BOTTOMRIGHT":
                        d = {
                            x: 2,
                            y: 2
                        };
                        break;
                    case "BOTTOMMIDDLE":
                        d = {
                            x: 0,
                            y: 2
                        };
                        break;
                    case "BOTTOMLEFT":
                    case "LEFTBOTTOM":
                        d = {
                            x: -2,
                            y: 2
                        };
                        break;
                    case "LEFTMIDDLE":
                        d = {
                            x: -2,
                            y: 0
                        }
                    }
                    d.x += this.options.offset.x, d.y += this.options.offset.y, b = Object.extend({
                        offset: d
                    }, {
                        element: this.options.hook.tip,
                        mouseHook: this.mouseHook,
                        mouse: {
                            top: b.pointerY || Event.pointerY(a) - c.top,
                            left: b.pointerX || Event.pointerX(a) - c.left
                        }
                    }), a = Tips.hook(this.wrapper, this.target, b), this.options.viewport && (a = this.getPositionWithinViewport(a), c = a.stemInverse, a = a.position, a.left += c.vertical ? 2 * Prototip.toggleInt(d.x - this.options.offset.x) : 0, a.top += c.vertical ? 2 * Prototip.toggleInt(d.y - this.options.offset.y) : 0, this.stem && (this.stemInverse.horizontal != c.horizontal || this.stemInverse.vertical != c.vertical) && this.positionStem(c)), a = {
                        left: a.left + "px",
                        top: a.top + "px"
                    }, this.wrapper.setStyle(a)
                } else b = Object.extend({
                    offset: this.options.offset
                }, {
                    element: this.options.hook.tip,
                    target: this.options.hook.target
                }), a = Tips.hook(this.wrapper, this.target, Object.extend({
                    position: !0
                }, b)), a = {
                    left: a.left + "px",
                    top: a.top + "px"
                };
                this.loader && Tips.hook(this.loader, this.target, Object.extend({
                    position: !0
                }, b))
            } else d = this.target.cumulativeOffset(), b = a.fakePointer || {}, a = {
                left: (this.options.fixed ? d[0] : b.pointerX || Event.pointerX(a)) + this.options.offset.x,
                top: (this.options.fixed ? d[1] : b.pointerY || Event.pointerY(a)) + this.options.offset.y
            }, !this.options.fixed && this.element !== this.target && (b = this.element.cumulativeOffset(), a.left += -1 * (b[0] - d[0]), a.top += -1 * (b[1] - d[1])), !this.options.fixed && this.options.viewport && (a = this.getPositionWithinViewport(a), c = a.stemInverse, a = a.position, this.stem && (this.stemInverse.horizontal != c.horizontal || this.stemInverse.vertical != c.vertical) && this.positionStem(c)), a = {
                left: a.left + "px",
                top: a.top + "px"
            }, this.wrapper.setStyle(a), this.loader && this.loader.setStyle(a);
            Tips.fixIE && this.iframeShim.setStyle(a)
        }
    },
    getPositionWithinViewport: function (a) {
        var b = {
            horizontal: !1,
            vertical: !1
        },
            c = this.wrapper.getDimensions(),
            d = document.viewport.getScrollOffsets(),
            e = document.viewport.getDimensions(),
            f = {
                left: "width",
                top: "height"
            },
            g;
        for (g in f) a[g] + c[f[g]] - d[g] > e[f[g]] && (a[g] -= c[f[g]] + 2 * this.options.offset[g == "left" ? "x" : "y"], this.stem && (b[Tips._stemTranslation[f[g]]] = !0));
        return {
            position: a,
            stemInverse: b
        }
    }
});
Object.extend(Prototip, {
    createCorner: function (a, b, c) {
        var c = c || this.options,
            d = c.radius,
            e = c.border,
            f = b.charAt(0) == "t",
            g = b.charAt(1) == "l";
        this.support.canvas ? (b = new Element("canvas", {
            className: "cornerCanvas" + b.capitalize(),
            width: e + "px",
            height: e + "px"
        }), a.insert(b), a = b.getContext("2d"), a.fillStyle = c.backgroundColor, a.arc(g ? d : e - d, f ? d : e - d, d, 0, Math.PI * 2, !0), a.fill(), a.fillRect(g ? d : 0, 0, e - d, e), a.fillRect(0, f ? d : 0, e, e - d)) : (a.insert(a = (new Element("div")).setStyle({
            width: e + "px",
            height: e + "px",
            margin: 0,
            padding: 0,
            display: "block",
            position: "relative",
            overflow: "hidden"
        })), c = (new Element("ns_vml:roundrect", {
            fillcolor: c.backgroundColor,
            strokeWeight: "1px",
            strokeColor: c.backgroundColor,
            arcSize: (d / e * .5).toFixed(2)
        })).setStyle({
            width: 2 * e - 1 + "px",
            height: 2 * e - 1 + "px",
            position: "absolute",
            left: (g ? 0 : -1 * e) + "px",
            top: (f ? 0 : -1 * e) + "px"
        }), a.insert(c), c.outerHTML = c.outerHTML)
    }
}), Element.addMethods({
    setPngBackground: function (a, b, c) {
        return a = $(a), c = Object.extend({
            align: "top left",
            repeat: "no-repeat",
            sizingMethod: "scale",
            backgroundColor: ""
        }, c || {}), a.setStyle(Tips.fixIE ? {
            filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + b + "'', sizingMethod='" + c.sizingMethod + "')"
        } : {
            background: c.backgroundColor + " url(" + b + ") " + c.align + " " + c.repeat
        }), a
    }
}), Prototip.Methods = {
    hold: function (a) {
        return a.element && !a.element.parentNode ? !0 : !1
    },
    show: function () {
        if (!Prototip.Methods.hold(this)) {
            Tips.raise(this), this.cancelHideAfter();
            var a = {};
            if (this.options.hook && !this.options.hook.mouse) a.fakePointer = {
                pointerX: 0,
                pointerY: 0
            };
            else {
                var b = this.target.cumulativeOffset(),
                    c = this.target.cumulativeScrollOffset(),
                    d = document.viewport.getScrollOffsets();
                b.left += -1 * (c[0] - d[0]), b.top += -1 * (c[1] - d[1]), a.fakePointer = {
                    pointerX: b.left,
                    pointerY: b.top
                }
            }
            this.options.ajax && !this.ajaxContentLoaded ? this.ajaxShow(this.showDelayed, a) : this.showDelayed(a), this.hideAfter()
        }
    }
}, Prototip.extend = function (a) {
    a.element.prototip = {}, Object.extend(a.element.prototip, {
        show: Prototip.Methods.show.bind(a),
        hide: a.hide.bind(a),
        remove: Tips.remove.bind(Tips, a.element)
    })
}, Prototip.start()
