(function(f) {
    function p(a, b, c) {
        var h = c.relative ? a.position().top : a.offset().top,
            d = c.relative ? a.position().left : a.offset().left,
            i = c.position[0];
        h -= b.outerHeight() - c.offset[0];
        d += a.outerWidth() + c.offset[1];
        if (/iPad/i.test(navigator.userAgent)) h -= f(window).scrollTop();
        var j = b.outerHeight() + a.outerHeight();
        if (i == "center") h += j / 2;
        if (i == "bottom") h += j;
        i = c.position[1];
        a = b.outerWidth() + a.outerWidth();
        if (i == "center") d -= a / 2;
        if (i == "left") d -= a;
        return {
            top: h,
            left: d
        }
    }
    function u(a, b) {
        var c = this,
            h = a.add(c),
            d, i = 0,
            j = 0,
            m = a.attr("title"),
            q = a.attr("data-tooltip"),
            r = o[b.effect],
            l, s = a.is(":input"),
            v = s && a.is(":checkbox, :radio, select, :button, :submit"),
            t = a.attr("type"),
            k = b.events[t] || b.events[s ? v ? "widget" : "input" : "def"];
        if (!r) throw 'Nonexistent effect "' + b.effect + '"';
        k = k.split(/,\s*/);
        if (k.length != 2) throw "Tooltip: bad events configuration for " + t;
        a.bind(k[0], function(e) {
            clearTimeout(i);
            if (b.predelay) j = setTimeout(function() {
                c.show(e)
            }, b.predelay);
            else c.show(e)
        }).bind(k[1], function(e) {
            clearTimeout(j);
            if (b.delay) i = setTimeout(function() {
                c.hide(e)
            }, b.delay);
            else c.hide(e)
        });
        if (m && b.cancelDefault) {
            a.removeAttr("title");
            a.data("title", m)
        }
        f.extend(c, {
            show: function(e) {
                if (!d) {
                    if (q) d = f(q);
                    else if (b.tip) d = f(b.tip).eq(0);
                    else if (m) d = f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);
                    else {
                        d = a.next();
                        d.length || (d = a.parent().next())
                    }
                    if (!d.length) throw "Cannot find tooltip for " + a;
                }
                if (c.isShown()) return c;
                d.stop(true, true);
                var g = p(a, d, b);
                b.tip && d.html(a.data("title"));
                e = e || f.Event();
                e.type = "onBeforeShow";
                h.trigger(e, [g]);
                if (e.isDefaultPrevented()) return c;
                g = p(a, d, b);
                d.css({
                    position: "absolute",
                    top: g.top,
                    left: g.left
                });
                l = true;
                r[0].call(c, function() {
                    e.type = "onShow";
                    l = "full";
                    h.trigger(e)
                });
                g = b.events.tooltip.split(/,\s*/);
                if (!d.data("__set")) {
                    d.bind(g[0], function() {
                        clearTimeout(i);
                        clearTimeout(j)
                    });
                    g[1] && !a.is("input:not(:checkbox, :radio), textarea") && d.bind(g[1], function(n) {
                        n.relatedTarget != a[0] && a.trigger(k[1].split(" ")[0])
                    });
                    d.data("__set", true)
                }
                return c
            },
            hide: function(e) {
                if (!d || !c.isShown()) return c;
                e = e || f.Event();
                e.type = "onBeforeHide";
                h.trigger(e);
                if (!e.isDefaultPrevented()) {
                    l = false;
                    o[b.effect][1].call(c, function() {
                        e.type = "onHide";
                        h.trigger(e)
                    });
                    return c
                }
            },
            isShown: function(e) {
                return e ? l == "full" : l
            },
            getConf: function() {
                return b
            },
            getTip: function() {
                return d
            },
            getTrigger: function() {
                return a
            }
        });
        f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(e, g) {
            f.isFunction(b[g]) && f(c).bind(g, b[g]);
            c[g] = function(n) {
                n && f(c).bind(g, n);
                return c
            }
        })
    }
    f.tools = f.tools || {
        version: "1.2.5"
    };
    f.tools.tooltip = {
        conf: {
            effect: "toggle",
            fadeOutSpeed: "fast",
            predelay: 0,
            delay: 30,
            opacity: 1,
            tip: 0,
            position: ["top", "center"],
            offset: [0, 0],
            relative: false,
            cancelDefault: true,
            events: {
                def: "mouseenter,mouseleave",
                input: "focus,blur",
                widget: "focus mouseenter,blur mouseleave",
                tooltip: "mouseenter,mouseleave"
            },
            layout: "<div/>",
            tipClass: "tooltip"
        },
        addEffect: function(a, b, c) {
            o[a] = [b, c]
        }
    };
    var o = {
        toggle: [function(a) {
            var b = this.getConf(),
                c = this.getTip();
            b = b.opacity;
            b < 1 && c.css({
                opacity: b
            });
            c.show();
            a.call()
        }, function(a) {
            this.getTip().hide();
            a.call()
        }],
        fade: [function(a) {
            var b = this.getConf();
            this.getTip().fadeTo(b.fadeInSpeed, b.opacity, a)
        }, function(a) {
            this.getTip().fadeOut(this.getConf().fadeOutSpeed, a)
        }]
    };
    f.fn.tooltip = function(a) {
        var b = this.data("tooltip");
        if (b) return b;
        a = f.extend(true, {}, f.tools.tooltip.conf, a);
        if (typeof a.position == "string") a.position = a.position.split(/,?\s/);
        this.each(function() {
            b = new u(f(this), a);
            f(this).data("tooltip", b)
        });
        return a.api ? b : this
    }
})(jQuery);
(function($) {
    var t = $.tools.tooltip;
    t.dynamic = {
        conf: {
            classNames: "top right bottom left"
        }
    };

    function getCropping(a) {
        var w = $(window);
        var b = w.width() + w.scrollLeft();
        var c = w.height() + w.scrollTop();
        return [a.offset().top <= w.scrollTop(), b <= a.offset().left + a.width(), c <= a.offset().top + a.height(), w.scrollLeft() >= a.offset().left]
    }
    function isVisible(a) {
        var i = a.length;
        while (i--) {
            if (a[i]) {
                return false
            }
        }
        return true
    }
    $.fn.dynamic = function(f) {
        if (typeof f == 'number') {
            f = {
                speed: f
            }
        }
        f = $.extend({}, t.dynamic.conf, f);
        var g = f.classNames.split(/\s/),
            orig;
        this.each(function() {
            var d = $(this).tooltip().onBeforeShow(function(e, a) {
                var b = this.getTip(),
                    tipConf = this.getConf();
                if (!orig) {
                    orig = [tipConf.position[0], tipConf.position[1], tipConf.offset[0], tipConf.offset[1], $.extend({}, tipConf)]
                }
                $.extend(tipConf, orig[4]);
                tipConf.position = [orig[0], orig[1]];
                tipConf.offset = [orig[2], orig[3]];
                b.css({
                    visibility: 'hidden',
                    position: 'absolute',
                    top: a.top,
                    left: a.left
                }).show();
                var c = getCropping(b);
                if (!isVisible(c)) {
                    if (c[2]) {
                        $.extend(tipConf, f.top);
                        tipConf.position[0] = 'top';
                        b.addClass(g[0])
                    }
                    if (c[3]) {
                        $.extend(tipConf, f.right);
                        tipConf.position[1] = 'right';
                        b.addClass(g[1])
                    }
                    if (c[0]) {
                        $.extend(tipConf, f.bottom);
                        tipConf.position[0] = 'bottom';
                        b.addClass(g[2])
                    }
                    if (c[1]) {
                        $.extend(tipConf, f.left);
                        tipConf.position[1] = 'left';
                        b.addClass(g[3])
                    }
                    if (c[0] || c[2]) {
                        tipConf.offset[0] *= -1
                    }
                    if (c[1] || c[3]) {
                        tipConf.offset[1] *= -1
                    }
                }
                b.css({
                    visibility: 'visible'
                }).hide()
            });
            d.onBeforeShow(function() {
                var c = this.getConf(),
                    tip = this.getTip();
                setTimeout(function() {
                    c.position = [orig[0], orig[1]];
                    c.offset = [orig[2], orig[3]]
                }, 0)
            });
            d.onHide(function() {
                var a = this.getTip();
                a.removeClass(f.classNames)
            });
            ret = d
        });
        return f.api ? ret : this
    }
})(jQuery);
(function($) {
    var t = $.tools.tooltip;
    $.extend(t.conf, {
        direction: 'up',
        bounce: false,
        slideOffset: 10,
        slideInSpeed: 200,
        slideOutSpeed: 200,
        slideFade: !$.browser.msie
    });
    var d = {
        up: ['-', 'top'],
        down: ['+', 'top'],
        left: ['-', 'left'],
        right: ['+', 'left']
    };
    t.addEffect("slide", function(a) {
        var b = this.getConf(),
            tip = this.getTip(),
            params = b.slideFade ? {
                opacity: b.opacity
            } : {},
            dir = d[b.direction] || d.up;
        params[dir[1]] = dir[0] + '=' + b.slideOffset;
        if (b.slideFade) {
            tip.css({
                opacity: 0
            })
        }
        tip.show().animate(params, b.slideInSpeed, a)
    }, function(a) {
        var b = this.getConf(),
            offset = b.slideOffset,
            params = b.slideFade ? {
                opacity: 0
            } : {},
            dir = d[b.direction] || d.up;
        var c = "" + dir[0];
        if (b.bounce) {
            c = c == '+' ? '-' : '+'
        }
        params[dir[1]] = c + '=' + offset;
        this.getTip().animate(params, b.slideOutSpeed, function() {
            $(this).hide();
            a.call()
        })
    })
})(jQuery);
(function($) {
    $.tools = $.tools || {
        version: '@VERSION'
    };
    var o = /\[type=([a-z]+)\]/,
        numRe = /^-?[0-9]*(\.[0-9]+)?$/,
        dateInput = $.tools.dateinput,
        emailRe = /^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
        urlRe = /^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,
        v;
    v = $.tools.validator = {
        conf: {
            grouped: false,
            effect: 'default',
            errorClass: 'invalid',
            inputEvent: null,
            errorInputEvent: 'keyup',
            formEvent: 'submit',
            lang: 'en',
            message: '<div/>',
            messageAttr: 'data-message',
            messageClass: 'error',
            offset: [0, 0],
            position: 'center right',
            singleError: false,
            speed: 'normal'
        },
        messages: {
            "*": {
                en: "Please correct this value"
            }
        },
        localize: function(c, d) {
            $.each(d, function(a, b) {
                v.messages[a] = v.messages[a] || {};
                v.messages[a][c] = b
            })
        },
        localizeFn: function(a, b) {
            v.messages[a] = v.messages[a] || {};
            $.extend(v.messages[a], b)
        },
        fn: function(a, b, c) {
            if ($.isFunction(b)) {
                c = b
            } else {
                if (typeof b == 'string') {
                    b = {
                        en: b
                    }
                }
                this.messages[a.key || a] = b
            }
            var d = o.exec(a);
            if (d) {
                a = isType(d[1])
            }
            q.push([a, c])
        },
        addEffect: function(a, b, c) {
            effects[a] = [b, c]
        }
    };

    function getPosition(a, b, c) {
        var d = a.offset().top,
            left = a.offset().left,
            pos = c.position.split(/,?\s+/),
            y = pos[0],
            x = pos[1];
        d -= b.outerHeight() - c.offset[0];
        left += a.outerWidth() + c.offset[1];
        if (/iPad/i.test(navigator.userAgent)) {
            d -= $(window).scrollTop()
        }
        var e = b.outerHeight() + a.outerHeight();
        if (y == 'center') {
            d += e / 2
        }
        if (y == 'bottom') {
            d += e
        }
        var f = a.outerWidth();
        if (x == 'center') {
            left -= (f + b.outerWidth()) / 2
        }
        if (x == 'left') {
            left -= f
        }
        return {
            top: d,
            left: left
        }
    }
    function isType(a) {
        function fn() {
            return this.getAttribute("type") == a
        }
        fn.key = "[type=" + a + "]";
        return fn
    }
    var q = [],
        effects = {
            'default': [function(e) {
                var f = this.getConf();
                $.each(e, function(i, a) {
                    var b = a.input;
                    b.addClass(f.errorClass);
                    var c = b.data("msg.el");
                    if (!c) {
                        c = $(f.message).addClass(f.messageClass).appendTo(document.body);
                        b.data("msg.el", c)
                    }
                    c.css({
                        visibility: 'hidden'
                    }).find("p").remove();
                    $.each(a.messages, function(i, m) {
                        $("<p/>").html(m).appendTo(c)
                    });
                    if (c.outerWidth() == c.parent().width()) {
                        c.add(c.find("p")).css({
                            display: 'inline'
                        })
                    }
                    var d = getPosition(b, c, f);
                    c.css({
                        visibility: 'visible',
                        position: 'absolute',
                        top: d.top,
                        left: d.left,
                        opacity: '0.9'
                    }).fadeIn(f.speed)
                })
            }, function(b) {
                var c = this.getConf();
                b.removeClass(c.errorClass).each(function() {
                    var a = $(this).data("msg.el");
                    if (a) {
                        a.css({
                            visibility: 'hidden'
                        })
                    }
                })
            }]
        };
    $.each("email,url,number".split(","), function(i, b) {
        $.expr[':'][b] = function(a) {
            return a.getAttribute("type") === b
        }
    });
    $.fn.oninvalid = function(a) {
        return this[a ? "bind" : "trigger"]("OI", a)
    };
    v.fn(":email", "Please enter a valid email address", function(a, v) {
        return !v || emailRe.test(v)
    });
    v.fn(":url", "Please enter a valid URL", function(a, v) {
        return !v || urlRe.test(v)
    });
    v.fn(":number", "Please enter a numeric value.", function(a, v) {
        return numRe.test(v)
    });
    v.fn("[max]", "Please enter a value smaller than $1", function(a, v) {
        if (v === '' || dateInput && a.is(":date")) {
            return true
        }
        var b = a.attr("max");
        return parseFloat(v) <= parseFloat(b) ? true : [b]
    });
    v.fn("[min]", "Please enter a value larger than $1", function(a, v) {
        if (v === '' || dateInput && a.is(":date")) {
            return true
        }
        var b = a.attr("min");
        return parseFloat(v) >= parseFloat(b) ? true : [b]
    });
    v.fn("[required]", "Please complete this mandatory field.", function(a, v) {
        if (a.is(":checkbox")) {
            return a.is(":checked")
        }
        return !!v
    });
    v.fn("[pattern]", function(a) {
        var p = new RegExp("^" + a.attr("pattern") + "$");
        return p.test(a.val())
    });

    function Validator(j, k, l) {
        var m = this,
            fire = k.add(m);
        j = j.not(":button, :image, :reset, :submit");

        function pushMessage(a, b, c) {
            if (!l.grouped && a.length) {
                return
            }
            var d;
            if (c === false || $.isArray(c)) {
                d = v.messages[b.key || b] || v.messages["*"];
                d = d[l.lang] || v.messages["*"].en;
                var e = d.match(/\$\d/g);
                if (e && $.isArray(c)) {
                    $.each(e, function(i) {
                        d = d.replace(this, c[i])
                    })
                }
            } else {
                d = c[l.lang] || c
            }
            a.push(d)
        }
        $.extend(m, {
            getConf: function() {
                return l
            },
            getForm: function() {
                return k
            },
            getInputs: function() {
                return j
            },
            reflow: function() {
                j.each(function() {
                    var a = $(this),
                        msg = a.data("msg.el");
                    if (msg) {
                        var b = getPosition(a, msg, l);
                        msg.css({
                            top: b.top,
                            left: b.left
                        })
                    }
                });
                return m
            },
            invalidate: function(d, e) {
                if (!e) {
                    var f = [];
                    $.each(d, function(a, b) {
                        var c = j.filter("[name='" + a + "']");
                        if (c.length) {
                            c.trigger("OI", [b]);
                            f.push({
                                input: c,
                                messages: [b]
                            })
                        }
                    });
                    d = f;
                    e = $.Event()
                }
                e.type = "onFail";
                fire.trigger(e, [d]);
                if (!e.isDefaultPrevented()) {
                    effects[l.effect][0].call(m, d, e)
                }
                return m
            },
            reset: function(b) {
                b = b || j;
                b.removeClass(l.errorClass).each(function() {
                    var a = $(this).data("msg.el");
                    if (a) {
                        a.remove();
                        $(this).data("msg.el", null)
                    }
                }).unbind(l.errorInputEvent || '');
                return m
            },
            destroy: function() {
                k.unbind(l.formEvent + ".V").unbind("reset.V");
                j.unbind(l.inputEvent + ".V").unbind("change.V");
                return m.reset()
            },
            checkValidity: function(f, e) {
                f = f || j;
                f = f.not(":disabled");
                if (!f.length) {
                    return true
                }
                e = e || $.Event();
                e.type = "onBeforeValidate";
                fire.trigger(e, [f]);
                if (e.isDefaultPrevented()) {
                    return e.result
                }
                var g = [];
                f.not(":radio:not(:checked)").each(function() {
                    var d = [],
                        el = $(this).data("messages", d),
                        event = dateInput && el.is(":date") ? "onHide.v" : l.errorInputEvent + ".v";
                    el.unbind(event);
                    $.each(q, function() {
                        var a = this,
                            match = a[0];
                        if (el.filter(match).length) {
                            var b = a[1].call(m, el, el.val());
                            if (b !== true) {
                                e.type = "onBeforeFail";
                                fire.trigger(e, [el, match]);
                                if (e.isDefaultPrevented()) {
                                    return false
                                }
                                var c = el.attr(l.messageAttr);
                                if (c) {
                                    d = [c];
                                    return false
                                } else {
                                    pushMessage(d, match, b)
                                }
                            }
                        }
                    });
                    if (d.length) {
                        g.push({
                            input: el,
                            messages: d
                        });
                        el.trigger("OI", [d]);
                        if (l.errorInputEvent) {
                            el.bind(event, function(e) {
                                m.checkValidity(el, e)
                            })
                        }
                    }
                    if (l.singleError && g.length) {
                        return false
                    }
                });
                var h = effects[l.effect];
                if (!h) {
                    throw "Validator: cannot find effect \"" + l.effect + "\"";
                }
                if (g.length) {
                    m.invalidate(g, e);
                    return false
                } else {
                    h[1].call(m, f, e);
                    e.type = "onSuccess";
                    fire.trigger(e, [f]);
                    f.unbind(l.errorInputEvent + ".v")
                }
                return true
            }
        });
        $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, b) {
            if ($.isFunction(l[b])) {
                $(m).bind(b, l[b])
            }
            m[b] = function(a) {
                if (a) {
                    $(m).bind(b, a)
                }
                return m
            }
        });
        if (l.formEvent) {
            k.bind(l.formEvent + ".V", function(e) {
                if (!m.checkValidity(null, e)) {
                    return e.preventDefault()
                }
            })
        }
        k.bind("reset.V", function() {
            m.reset()
        });
        if (j[0] && j[0].validity) {
            j.each(function() {
                this.oninvalid = function() {
                    return false
                }
            })
        }
        if (k[0]) {
            k[0].checkValidity = m.checkValidity
        }
        if (l.inputEvent) {
            j.bind(l.inputEvent + ".V", function(e) {
                m.checkValidity($(this), e)
            })
        }
        j.filter(":checkbox, select").filter("[required]").bind("change.V", function(e) {
            var a = $(this);
            if (this.checked || (a.is("select") && $(this).val())) {
                effects[l.effect][1].call(m, a, e)
            }
        });
        var n = j.filter(":radio").change(function(e) {
            m.checkValidity(n, e)
        });
        $(window).resize(function() {
            m.reflow()
        })
    }
    $.fn.validator = function(b) {
        var c = this.data("validator");
        if (c) {
            c.destroy();
            this.removeData("validator")
        }
        b = $.extend(true, {}, v.conf, b);
        if (this.is("form")) {
            return this.each(function() {
                var a = $(this);
                c = new Validator(a.find(":input"), a, b);
                a.data("validator", c)
            })
        } else {
            c = new Validator(this, this.eq(0).closest("form"), b);
            return this.data("validator", c)
        }
    }
})(jQuery);
(function($) {
    var f = 'NoticeMsg';
    $.fn.noticeMsg = function(b, c) {
        var d = $.extend({}, {
            message: 'Notification',
            addClass: '',
            dur: 5000,
            fade: 300
        }, c),
            m = b || d.message;
        return this.each(function() {
            var e = this == window || this == document ? document.body : this;
            var a = $(e).children('.notice-message').length ? $(e).children('.notice-message') : $('<div class="notice-message ' + d.addClass + '" />').appendTo(e);
            a.html(m).click(remove).css({
                display: 'none',
                top: $(this).offset().top + $(this).height() / 2,
                left: ($(this).offset().left + $(this).outerWidth() / 2) - a.outerWidth() / 2
            }).stop().fadeIn(d.fade);
            clearTimeout($.data(e, f));
            d.dur && $.data(e, f, setTimeout(remove, d.dur));

            function remove() {
                $.removeData(e, f);
                a.stop().fadeOut(d.fade, function() {
                    a.remove()
                })
            }
        })
    };
    $.noticeMsg = function(a, b) {
        $(document.body).noticeMsg(a, b)
    }
})(jQuery);
(function($) {
    function callFunction(a, b, c) {
        var d = a[b];
        if ($.isFunction(d)) {
            try {
                return d.call(c)
            } catch (error) {
                if (a.eAlert) alert("Error calling loadAnimation." + b + ": " + error);
                else throw error;
                return false
            }
        }
        return true
    }
    var e = null;
    var f = null;
    var g, conf = null;
    var h = 0;
    $.loadAnimation = {
        getVersion: function() {
            return [0, 2, 0]
        },
        getMask: function() {
            return e
        },
        getAnimated: function() {
            return g
        },
        getConf: function() {
            return conf
        },
        isStarted: function() {
            return e && e.is(":visible")
        },
        start: function(a, b) {
            if (this.isStarted()) return this;
            if (a) {
                g = a;
                h = g.eq(0).css("zIndex");
                conf = b
            } else {
                a = g;
                b = conf
            }
            if (!a || !a.length) return this;
            if (!e) {
                e = $('<div id="' + b.maskId + '"></div>');
                f = $('<img id="' + b.maskId + '_loading_img" />').attr('src', b.image.src).attr('alt', b.image.alt)
            }
            e.css({
                position: 'absolute',
                top: a.offset().top,
                left: a.offset().left,
                width: a.outerWidth(),
                height: a.innerHeight(),
                display: 'none',
                opacity: 0,
                zIndex: b.zIndex,
                backgroundColor: b.color
            });
            f.css({
                zIndex: b.zIndex + 1,
                position: 'absolute',
                top: (a.outerHeight() / 2 - b.image.size.height / 2),
                left: (a.width() / 2 - b.image.size.width / 2)
            });
            e.html(f);
            $("body").append(e);
            if (callFunction(b, "onBeforeLoad", this) === false) return this;
            if (!this.isStarted()) {
                e.css({
                    opacity: 0,
                    display: 'block'
                }).fadeTo(b.loadSpeed, b.opacity, function() {
                    callFunction(b, "onLoad", $.loadAnimation)
                })
            }
            return this
        },
        end: function() {
            var a = this;
            if (!this.isStarted()) {
                return a
            }
            if (callFunction(conf, "onBeforeClose", a) === false) return a;
            e.fadeOut(conf.closeSpeed, function() {
                g.css({
                    zIndex: $.browser.msie ? h : null
                });
                callFunction(conf, "onClose", a)
            })
        }
    };
    $.prototype.loadAnimation = function(a) {
        if (!this.length) return this;
        var b = {
            eAlert: true,
            maskId: 'exposeMask',
            loadSpeed: 'slow',
            closeSpeed: 'fast',
            zIndex: 998,
            opacity: 0.9,
            color: '#ccc',
            image: {
                src: '',
                alt: 'loading...',
                size: {
                    width: 100,
                    height: 10
                }
            }
        };
        if (typeof a == 'string') a = {
            color: a
        };
        if (typeof a.image == 'string') a.image = {
            src: a.image,
            alt: b.image.alt,
            size: b.image.size
        };
        if (a.image.alt == undefined) a.image.alt = b.image.alt;
        if (a.image.size == undefined) a.image.size = b.image.size;
        if (a.image.size.width == undefined) a.image.size.width = b.image.size.width;
        if (a.image.size.height == undefined) a.image.size.height = b.image.size.height;
        $.extend(b, a);
        $.loadAnimation.start(this, b);
        return this
    }
})(jQuery);
(function(a) {
    a.tools = a.tools || {
        version: "v1.2.5"
    }, a.tools.scrollable = {
        conf: {
            activeClass: "active",
            circular: !1,
            clonedClass: "cloned",
            disabledClass: "disabled",
            easing: "swing",
            initialIndex: 0,
            item: null,
            items: ".items",
            keyboard: !0,
            mousewheel: !1,
            next: ".next",
            prev: ".prev",
            speed: 400,
            vertical: !1,
            touch: !0,
            wheelSpeed: 0
        }
    };

    function b(a, b) {
        var c = parseInt(a.css(b), 10);
        if (c) return c;
        var d = a[0].currentStyle;
        return d && d.width && parseInt(d.width, 10)
    }
    function c(b, c) {
        var d = a(c);
        return d.length < 2 ? d : b.parent().find(c)
    }
    var d;

    function e(b, e) {
        var f = this,
            g = b.add(f),
            h = b.children(),
            i = 0,
            j = e.vertical;
        d || (d = f), h.length > 1 && (h = a(e.items, b)), a.extend(f, {
            getConf: function() {
                return e
            },
            getIndex: function() {
                return i
            },
            getSize: function() {
                return f.getItems().size()
            },
            getNaviButtons: function() {
                return m.add(n)
            },
            getRoot: function() {
                return b
            },
            getItemWrap: function() {
                return h
            },
            getItems: function() {
                return h.children(e.item).not("." + e.clonedClass)
            },
            move: function(a, b) {
                return f.seekTo(i + a, b)
            },
            next: function(a) {
                return f.move(1, a)
            },
            prev: function(a) {
                return f.move(-1, a)
            },
            begin: function(a) {
                return f.seekTo(0, a)
            },
            end: function(a) {
                return f.seekTo(f.getSize() - 1, a)
            },
            focus: function() {
                d = f;
                return f
            },
            addItem: function(b) {
                b = a(b), e.circular ? (h.children("." + e.clonedClass + ":last").before(b), h.children("." + e.clonedClass + ":first").replaceWith(b.clone().addClass(e.clonedClass))) : h.append(b), g.trigger("onAddItem", [b]);
                return f
            },
            seekTo: function(b, c, k) {
                b.jquery || (b *= 1);
                if (e.circular && b === 0 && i == -1 && c !== 0) return f;
                if (!e.circular && b < 0 || b > f.getSize() || b < -1) return f;
                var l = b;
                b.jquery ? b = f.getItems().index(b) : l = f.getItems().eq(b);
                var m = a.Event("onBeforeSeek");
                if (!k) {
                    g.trigger(m, [b, c]);
                    if (m.isDefaultPrevented() || !l.length) return f
                }
                var n = j ? {
                    top: -l.position().top
                } : {
                    left: -l.position().left
                };
                i = b, d = f, c === undefined && (c = e.speed), h.animate(n, c, e.easing, k ||
                function() {
                    g.trigger("onSeek", [b])
                });
                return f
            }
        }), a.each(["onBeforeSeek", "onSeek", "onAddItem"], function(b, c) {
            a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function(b) {
                b && a(f).bind(c, b);
                return f
            }
        });
        if (e.circular) {
            var k = f.getItems().slice(-1).clone().prependTo(h),
                l = f.getItems().eq(1).clone().appendTo(h);
            k.add(l).addClass(e.clonedClass), f.onBeforeSeek(function(a, b, c) {
                if (!a.isDefaultPrevented()) {
                    if (b == -1) {
                        f.seekTo(k, c, function() {
                            f.end(0)
                        });
                        return a.preventDefault()
                    }
                    b == f.getSize() && f.seekTo(l, c, function() {
                        f.begin(0)
                    })
                }
            }), f.seekTo(0, 0, function() {})
        }
        var m = c(b, e.prev).click(function() {
            f.prev()
        }),
            n = c(b, e.next).click(function() {
                f.next()
            });
        !e.circular && f.getSize() > 1 && (f.onBeforeSeek(function(a, b) {
            setTimeout(function() {
                a.isDefaultPrevented() || (m.toggleClass(e.disabledClass, b <= 0), n.toggleClass(e.disabledClass, b >= f.getSize() - 1))
            }, 1)
        }), e.initialIndex || m.addClass(e.disabledClass)), e.mousewheel && a.fn.mousewheel && b.mousewheel(function(a, b) {
            if (e.mousewheel) {
                f.move(b < 0 ? 1 : -1, e.wheelSpeed || 50);
                return !1
            }
        });
        if (e.touch) {
            var o = {};
            h[0].ontouchstart = function(a) {
                var b = a.touches[0];
                o.x = b.clientX, o.y = b.clientY
            }, h[0].ontouchmove = function(a) {
                if (a.touches.length == 1 && !h.is(":animated")) {
                    var b = a.touches[0],
                        c = o.x - b.clientX,
                        d = o.y - b.clientY;
                    f[j && d > 0 || !j && c > 0 ? "next" : "prev"](), a.preventDefault()
                }
            }
        }
        e.keyboard && a(document).bind("keydown.scrollable", function(b) {
            if (e.keyboard && !b.altKey && !b.ctrlKey && !a(b.target).is(":input")) {
                if (e.keyboard != "static" && d != f) return;
                var c = b.keyCode;
                if (j && (c == 38 || c == 40)) {
                    f.move(c == 38 ? -1 : 1);
                    return b.preventDefault()
                }
                if (!j && (c == 37 || c == 39)) {
                    f.move(c == 37 ? -1 : 1);
                    return b.preventDefault()
                }
            }
        }), e.initialIndex && f.seekTo(e.initialIndex, 0, function() {})
    }
    a.fn.scrollable = function(b) {
        var c = this.data("scrollable");
        if (c) return c;
        b = a.extend({}, a.tools.scrollable.conf, b), this.each(function() {
            c = new e(a(this), b), a(this).data("scrollable", c)
        });
        return b.api ? c : this
    }
})(jQuery);
(function(a) {
    var b = a.tools.scrollable;
    b.autoscroll = {
        conf: {
            autoplay: !0,
            interval: 3e3,
            autopause: !0
        }
    }, a.fn.autoscroll = function(c) {
        typeof c == "number" && (c = {
            interval: c
        });
        var d = a.extend({}, b.autoscroll.conf, c),
            e;
        this.each(function() {
            var b = a(this).data("scrollable");
            b && (e = b);
            var c, f = !0;
            b.play = function() {
                c || (f = !1, c = setInterval(function() {
                    b.next()
                }, d.interval))
            }, b.pause = function() {
                c = clearInterval(c)
            }, b.stop = function() {
                b.pause(), f = !0
            }, d.autopause && b.getRoot().add(b.getNaviButtons()).hover(b.pause, b.play), d.autoplay && b.play()
        });
        return d.api ? e : this
    }
})(jQuery);
(function(a) {
    var b = a.tools.scrollable;
    b.navigator = {
        conf: {
            navi: ".navi",
            naviItem: null,
            activeClass: "active",
            indexed: !1,
            idPrefix: null,
            history: !1
        }
    };

    function c(b, c) {
        var d = a(c);
        return d.length < 2 ? d : b.parent().find(c)
    }
    a.fn.navigator = function(d) {
        typeof d == "string" && (d = {
            navi: d
        }), d = a.extend({}, b.navigator.conf, d);
        var e;
        this.each(function() {
            var b = a(this).data("scrollable"),
                f = d.navi.jquery ? d.navi : c(b.getRoot(), d.navi),
                g = b.getNaviButtons(),
                h = d.activeClass,
                i = d.history && a.fn.history;
            b && (e = b), b.getNaviButtons = function() {
                return g.add(f)
            };

            function j(a, c, d) {
                b.seekTo(c);
                if (i) location.hash && (location.hash = a.attr("href").replace("#", ""));
                else return d.preventDefault()
            }
            function k() {
                return f.find(d.naviItem || "> *")
            }
            function l(b) {
                var c = a("<" + (d.naviItem || "a") + "/>").click(function(c) {
                    j(a(this), b, c)
                }).attr("href", "#" + b);
                b === 0 && c.addClass(h), d.indexed && c.text(b + 1), d.idPrefix && c.attr("id", d.idPrefix + b);
                return c.appendTo(f)
            }
            k().length ? k().each(function(b) {
                a(this).click(function(c) {
                    j(a(this), b, c)
                })
            }) : a.each(b.getItems(), function(a) {
                l(a)
            }), b.onBeforeSeek(function(a, b) {
                setTimeout(function() {
                    if (!a.isDefaultPrevented()) {
                        var c = k().eq(b);
                        !a.isDefaultPrevented() && c.length && k().removeClass(h).eq(b).addClass(h)
                    }
                }, 1)
            });

            function m(a, b) {
                var c = k().eq(b.replace("#", ""));
                c.length || (c = k().filter("[href=" + b + "]")), c.click()
            }
            b.onAddItem(function(a, c) {
                c = l(b.getItems().index(c)), i && c.history(m)
            }), i && k().history(m)
        });
        return d.api ? e : this
    }
})(jQuery);
jQuery.fn.extend({
    everyTime: function(a, b, c, d) {
        return this.each(function() {
            jQuery.timer.add(this, a, b, c, d)
        })
    },
    oneTime: function(a, b, c) {
        return this.each(function() {
            jQuery.timer.add(this, a, b, c, 1)
        })
    },
    stopTime: function(a, b) {
        return this.each(function() {
            jQuery.timer.remove(this, a, b)
        })
    }
});
jQuery.extend({
    timer: {
        global: [],
        guid: 1,
        dataKey: "jQuery.timer",
        regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
        powers: {
            'ms': 1,
            'cs': 10,
            'ds': 100,
            's': 1000,
            'das': 10000,
            'hs': 100000,
            'ks': 1000000
        },
        timeParse: function(a) {
            if (a == undefined || a == null) return null;
            var b = this.regex.exec(jQuery.trim(a.toString()));
            if (b[2]) {
                var c = parseFloat(b[1]);
                var d = this.powers[b[2]] || 1;
                return c * d
            } else {
                return a
            }
        },
        add: function(a, b, c, d, e) {
            var f = 0;
            if (jQuery.isFunction(c)) {
                if (!e) e = d;
                d = c;
                c = b
            }
            b = jQuery.timer.timeParse(b);
            if (typeof b != 'number' || isNaN(b) || b < 0) return;
            if (typeof e != 'number' || isNaN(e) || e < 0) e = 0;
            e = e || 0;
            var g = jQuery.data(a, this.dataKey) || jQuery.data(a, this.dataKey, {});
            if (!g[c]) g[c] = {};
            d.timerID = d.timerID || this.guid++;
            var h = function() {
                if ((++f > e && e !== 0) || d.call(a, f) === false) jQuery.timer.remove(a, c, d)
            };
            h.timerID = d.timerID;
            if (!g[c][d.timerID]) g[c][d.timerID] = window.setInterval(h, b);
            this.global.push(a)
        },
        remove: function(a, b, c) {
            var d = jQuery.data(a, this.dataKey),
                ret;
            if (d) {
                if (!b) {
                    for (b in d) this.remove(a, b, c)
                } else if (d[b]) {
                    if (c) {
                        if (c.timerID) {
                            window.clearInterval(d[b][c.timerID]);
                            delete d[b][c.timerID]
                        }
                    } else {
                        for (var c in d[b]) {
                            window.clearInterval(d[b][c]);
                            delete d[b][c]
                        }
                    }
                    for (ret in d[b]) break;
                    if (!ret) {
                        ret = null;
                        delete d[b]
                    }
                }
                for (ret in d) break;
                if (!ret) jQuery.removeData(a, this.dataKey)
            }
        }
    }
});
jQuery(window).bind("unload", function() {
    jQuery.each(jQuery.timer.global, function(a, b) {
        jQuery.timer.remove(b)
    })
});

(function( $ ){
  $.fn.sendForm = function(options) {
  		var settings = {
  			//klasa buttona wysyłającego formularz
  			buttonClass: 'send-button',
  			//konfiguracja walidatora
  			messageAttr: 'error-message',
  			messageClass: 'error-container',
  			position: 'left',
  			offset: [23, 8],
  			lang: 'pl',
  			//konifguracja animacji wysylania
  			animOpacity: 0.5,
  			animAjaxLoader: 'media/images/ajax-loader.gif',
  			animNoticeId: 'animation_notice',
  			animAjaxLoaderWidth: 32,
  			animAjaxLoaderHeight: 32,
  			msgColor: 'black',
  			msgNoticeId: 'msg_style'
  			
  		};
  		
  		if(options){
  				$.extend( settings, options );
  		}
  		
  		$.tools.validator.fn("select", "Pole wymagane",
			    function(input, value) {
			        return (value == '') ? false: true;
		});
			
		$.tools.validator.localize("pl", {
			'*'				: 'Popraw wpisaną wartość',
			':email'  		: 'Nieprawidłowy adres email',
			':number' 		: 'To nie jest liczba',
			'[max]'	 		: 'Maksymalny rozmiar pola to: $1',
			'[min]'	 		: 'Minimalny rozmiar pola to: $1',
			'[required]' 	: 'To pole jest wymagane'
		});
  		
  		
  		return this.each(function() {
  			
  			var obj = $(this);
  			
  			
  			
  			function LoadAnim(obj) {
			    
			    var top_notice = (obj.offset().top+obj.innerHeight()/2)-(settings.animAjaxLoaderHeight/2);
			    var left_notice = (obj.offset().left+obj.outerWidth()/2)-(settings.animAjaxLoaderWidth/2);
			    
			    
			    var disable_mask = '<div id="disable_mask" style="position:absolute;top:'+obj.offset().top+'px;backgrond:none;left:'+obj.offset().left+'px;width:'+obj.outerWidth()+'px;height:'+obj.innerHeight()+'px;"></div>';
			    var animation_ajax = '<div id="'+settings.animNoticeId+'" style="position:absolute;top:'+top_notice+'px;left:'+left_notice+'px;opacity:0;">'+
			    					 '<img src="'+settings.animAjaxLoader+'" alt="" /></div>';
				
				
				
				$(document.body).append(animation_ajax);
				$(document.body).append(disable_mask);
				$('#'+settings.animNoticeId).animate({
					opacity: 1
				},500);    
			    obj.animate({
			        opacity: 0.3
			    },
			    500);
			}
			
			function hoverNotice(obj) {
			    $('#'+settings.animNoticeId).animate({
					opacity: 0
				},500,function(){
					$(this).remove();
					$('#disable_mask').remove();
				});
				 
			    obj.animate({
			        opacity: 1
			    },
			    500);
			}
			
			function setNotice(msg, obj) {
			    $('#'+settings.animNoticeId).animate({
			    	opacity: 0
			    },500,function(){
			    	$(this).children('img').remove();
			    	$(this).html('<p id="'+settings.msgNoticeId+'">'+msg+'</p>');
			    	$(this).css('left',(obj.offset().left+obj.outerWidth()/2)-($(this).width()/2));
			    	$(this).animate({opacity:1},500);
			    });
			}
			
			var inputs = obj.validator({
		        message: '<div/>',
		        messageAttr: settings.messageAttr,
		        messageClass: settings.messageClass,
		        position: settings.position,
		        lang: settings.lang,
		        offset: settings.offset,
		        singleError: true
		    });
		    
		    if(isNaN($.browser.opera)){
			    inputs.keypress(function(e) {
			        if (e.which == 13) $('#' + id_button).trigger('click');
			    });
		    }
		    else
		    {
		    	$(window).keypress(function(e) {
			        if (e.which == 13) return false;
			    });
		    }
		    
		    var action = obj.attr('action');
  			
  			obj.find('.'+settings.buttonClass).click(function(){
  					
  					
  					if (inputs.data("validator").checkValidity()) {
  						$.ajax({
				                url: action,
				                type: "POST",
				                dataType: 'json',
				                data: inputs.serialize(),
				                beforeSend: function() {
				                    LoadAnim(obj);
				                },
				                success: function(response) {
				                    if (response.success) {
				                        if (response.reload) {
				                            window.location.href = location.href;
				                        }
				                        if (response.response_url != '') {
				                            window.location.href = 'http://' + window.location.host + response.response_url;
				                        }
				                        if (response.notice) {
				                            setNotice(response.notice,obj);
				                            setTimeout(function() {
				                                if(response.reset){
					                                inputs.each(function() {
					                                    this.reset();
					                                });
				                                }
				                                hoverNotice(obj);
				                            },
				                            3000);
				                        }
				                    } else if (!response.success) {
				                        hoverNotice(obj);
				                        setTimeout(function() {
				                            inputs.data("validator").invalidate(response.errors);
				                        },
				                        500);
				                    }
				                }
				            });
  						
  					}
  			});
  			
  		});
  };
})( jQuery );

(function($) {
    $.fn.lightBox = function(j) {
        j = jQuery.extend({
            overlayBgColor: '#000',
            overlayOpacity: 0.8,
            fixedNavigation: false,
            imageLoading: '/media/css/lightbox-ico-loading.gif',
            imageBtnPrev: '/media/css/lightbox-btn-prev.gif',
            imageBtnNext: '/media/css/lightbox-btn-next.gif',
            imageBtnClose: '/media/css/lightbox-btn-close.gif',
            imageBlank: '/media/css/lightbox-blank.gif',
            containerBorderSize: 10,
            containerResizeSpeed: 400,
            txtImage: 'Image',
            txtOf: 'of',
            keyToClose: 'c',
            keyToPrev: 'p',
            keyToNext: 'n',
            imageArray: [],
            activeImage: 0
        }, j);
        var k = this;

        function _initialize() {
            _start(this, k);
            return false
        }
        function _start(a, b) {
            $('embed, object, select').css({
                'visibility': 'hidden'
            });
            _set_interface();
            j.imageArray.length = 0;
            j.activeImage = 0;
            if (b.length == 1) {
                j.imageArray.push(new Array(a.getAttribute('href'), a.getAttribute('title')))
            } else {
                for (var i = 0; i < b.length; i++) {
                    j.imageArray.push(new Array(b[i].getAttribute('href'), b[i].getAttribute('title')))
                }
            }
            while (j.imageArray[j.activeImage][0] != a.getAttribute('href')) {
                j.activeImage++
            }
            _set_image_to_view()
        }
        function _set_interface() {
            $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + j.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + j.imageBtnClose + '"></a></div></div></div></div>');
            var c = ___getPageSize();
            $('#jquery-overlay').css({
                backgroundColor: j.overlayBgColor,
                opacity: j.overlayOpacity,
                width: c[0],
                height: c[1]
            }).fadeIn();
            var d = ___getPageScroll();
            $('#jquery-lightbox').css({
                top: d[1] + (c[3] / 10),
                left: d[0]
            }).show();
            $('#jquery-overlay,#jquery-lightbox').click(function() {
                _finish()
            });
            $('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
                _finish();
                return false
            });
            $(window).resize(function() {
                var a = ___getPageSize();
                $('#jquery-overlay').css({
                    width: a[0],
                    height: a[1]
                });
                var b = ___getPageScroll();
                $('#jquery-lightbox').css({
                    top: b[1] + (a[3] / 10),
                    left: b[0]
                })
            })
        }
        function _set_image_to_view() {
            $('#lightbox-loading').show();
            if (j.fixedNavigation) {
                $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide()
            } else {
                $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide()
            }
            var a = new Image();
            a.onload = function() {
                $('#lightbox-image').attr('src', j.imageArray[j.activeImage][0]);
                _resize_container_image_box(a.width, a.height);
                a.onload = function() {}
            };
            a.src = j.imageArray[j.activeImage][0]
        };

        function _resize_container_image_box(a, b) {
            var c = $('#lightbox-container-image-box').width();
            var d = $('#lightbox-container-image-box').height();
            var e = (a + (j.containerBorderSize * 2));
            var f = (b + (j.containerBorderSize * 2));
            var g = c - e;
            var h = d - f;
            $('#lightbox-container-image-box').animate({
                width: e,
                height: f
            }, j.containerResizeSpeed, function() {
                _show_image()
            });
            if ((g == 0) && (h == 0)) {
                if ($.browser.msie) {
                    ___pause(250)
                } else {
                    ___pause(100)
                }
            }
            $('#lightbox-container-image-data-box').css({
                width: a
            });
            $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({
                height: b + (j.containerBorderSize * 2)
            })
        };

        function _show_image() {
            $('#lightbox-loading').hide();
            $('#lightbox-image').fadeIn(function() {
                _show_image_data();
                _set_navigation()
            });
            _preload_neighbor_images()
        };

        function _show_image_data() {
            $('#lightbox-container-image-data-box').slideDown('fast');
            $('#lightbox-image-details-caption').hide();
            if (j.imageArray[j.activeImage][1]) {
                $('#lightbox-image-details-caption').html(j.imageArray[j.activeImage][1]).show()
            }
            if (j.imageArray.length > 1) {
                $('#lightbox-image-details-currentNumber').html(j.txtImage + ' ' + (j.activeImage + 1) + ' ' + j.txtOf + ' ' + j.imageArray.length).show()
            }
        }
        function _set_navigation() {
            $('#lightbox-nav').show();
            $('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({
                'background': 'transparent url(' + j.imageBlank + ') no-repeat'
            });
            if (j.activeImage != 0) {
                if (j.fixedNavigation) {
                    $('#lightbox-nav-btnPrev').css({
                        'background': 'url(' + j.imageBtnPrev + ') left 15% no-repeat'
                    }).unbind().bind('click', function() {
                        j.activeImage = j.activeImage - 1;
                        _set_image_to_view();
                        return false
                    })
                } else {
                    $('#lightbox-nav-btnPrev').unbind().hover(function() {
                        $(this).css({
                            'background': 'url(' + j.imageBtnPrev + ') left 15% no-repeat'
                        })
                    }, function() {
                        $(this).css({
                            'background': 'transparent url(' + j.imageBlank + ') no-repeat'
                        })
                    }).show().bind('click', function() {
                        j.activeImage = j.activeImage - 1;
                        _set_image_to_view();
                        return false
                    })
                }
            }
            if (j.activeImage != (j.imageArray.length - 1)) {
                if (j.fixedNavigation) {
                    $('#lightbox-nav-btnNext').css({
                        'background': 'url(' + j.imageBtnNext + ') right 15% no-repeat'
                    }).unbind().bind('click', function() {
                        j.activeImage = j.activeImage + 1;
                        _set_image_to_view();
                        return false
                    })
                } else {
                    $('#lightbox-nav-btnNext').unbind().hover(function() {
                        $(this).css({
                            'background': 'url(' + j.imageBtnNext + ') right 15% no-repeat'
                        })
                    }, function() {
                        $(this).css({
                            'background': 'transparent url(' + j.imageBlank + ') no-repeat'
                        })
                    }).show().bind('click', function() {
                        j.activeImage = j.activeImage + 1;
                        _set_image_to_view();
                        return false
                    })
                }
            }
            _enable_keyboard_navigation()
        }
        function _enable_keyboard_navigation() {
            $(document).keydown(function(a) {
                _keyboard_action(a)
            })
        }
        function _disable_keyboard_navigation() {
            $(document).unbind()
        }
        function _keyboard_action(a) {
            if (a == null) {
                keycode = event.keyCode;
                escapeKey = 27
            } else {
                keycode = a.keyCode;
                escapeKey = a.DOM_VK_ESCAPE
            }
            key = String.fromCharCode(keycode).toLowerCase();
            if ((key == j.keyToClose) || (key == 'x') || (keycode == escapeKey)) {
                _finish()
            }
            if ((key == j.keyToPrev) || (keycode == 37)) {
                if (j.activeImage != 0) {
                    j.activeImage = j.activeImage - 1;
                    _set_image_to_view();
                    _disable_keyboard_navigation()
                }
            }
            if ((key == j.keyToNext) || (keycode == 39)) {
                if (j.activeImage != (j.imageArray.length - 1)) {
                    j.activeImage = j.activeImage + 1;
                    _set_image_to_view();
                    _disable_keyboard_navigation()
                }
            }
        }
        function _preload_neighbor_images() {
            if ((j.imageArray.length - 1) > j.activeImage) {
                objNext = new Image();
                objNext.src = j.imageArray[j.activeImage + 1][0]
            }
            if (j.activeImage > 0) {
                objPrev = new Image();
                objPrev.src = j.imageArray[j.activeImage - 1][0]
            }
        }
        function _finish() {
            $('#jquery-lightbox').remove();
            $('#jquery-overlay').fadeOut(function() {
                $('#jquery-overlay').remove()
            });
            $('embed, object, select').css({
                'visibility': 'visible'
            })
        }
        function ___getPageSize() {
            var a, yScroll;
            if (window.innerHeight && window.scrollMaxY) {
                a = window.innerWidth + window.scrollMaxX;
                yScroll = window.innerHeight + window.scrollMaxY
            } else if (document.body.scrollHeight > document.body.offsetHeight) {
                a = document.body.scrollWidth;
                yScroll = document.body.scrollHeight
            } else {
                a = document.body.offsetWidth;
                yScroll = document.body.offsetHeight
            }
            var b, windowHeight;
            if (self.innerHeight) {
                if (document.documentElement.clientWidth) {
                    b = document.documentElement.clientWidth
                } else {
                    b = self.innerWidth
                }
                windowHeight = self.innerHeight
            } else if (document.documentElement && document.documentElement.clientHeight) {
                b = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight
            } else if (document.body) {
                b = document.body.clientWidth;
                windowHeight = document.body.clientHeight
            }
            if (yScroll < windowHeight) {
                pageHeight = windowHeight
            } else {
                pageHeight = yScroll
            }
            if (a < b) {
                pageWidth = a
            } else {
                pageWidth = b
            }
            arrayPageSize = new Array(pageWidth, pageHeight, b, windowHeight);
            return arrayPageSize
        };

        function ___getPageScroll() {
            var a, yScroll;
            if (self.pageYOffset) {
                yScroll = self.pageYOffset;
                a = self.pageXOffset
            } else if (document.documentElement && document.documentElement.scrollTop) {
                yScroll = document.documentElement.scrollTop;
                a = document.documentElement.scrollLeft
            } else if (document.body) {
                yScroll = document.body.scrollTop;
                a = document.body.scrollLeft
            }
            arrayPageScroll = new Array(a, yScroll);
            return arrayPageScroll
        };

        function ___pause(a) {
            var b = new Date();
            c = null;
            do {
                var c = new Date()
            } while (c - b < a)
        };
        return this.unbind('click').click(_initialize)
    }
})(jQuery);
$(window).load(function() {
    var b = 1;
    changeSlider = function() {
        b = (b == 6 ? 1 : b + 1);
        $('#p-' + b).fadeIn(900).siblings('.slider:visible').fadeOut(900)
    };
    window.setInterval('changeSlider()', 60000);
    $('.box .scrollable').scrollable().navigator();
    $('.gallery-list .scrollable').scrollable().navigator({indexed:true});
    $('#newsletter').sendForm({
        buttonClass: 'button',
        animAjaxLoader: 'images/ajax-loader.gif',
        position: 'top left',
        offset: [0, -140]
    });
    $('#join-form').sendForm({
        buttonClass: 'button',
        animAjaxLoader: 'images/ajax-loader.gif'
    });
    
    $('#login-form,#login-form-short,#comments-form,#register-form,#user_panel_form_password,#user_panel_form_about,#user_panel_form_club,#user_panel_console').sendForm({
        buttonClass: 'button',
        animAjaxLoader: 'images/ajax-loader.gif'
    });
    var c = true;
    $('.news-container').children().each(function(a, i) {
        if ($(this).children().length && c) {
            $(this).css('display', 'block');
            $('#month-click' + $(this).attr('id').replace('month', '')).addClass('active');
            c = false
        }
        if (!$(this).children().length) $('#month-click' + $(this).attr('id').replace('month', '')).addClass('disable')
    });
    $('.month-click').click(function(e) {
        e.preventDefault();
        var a = $(this).attr('id').replace('month-click', '');
        if ($('#month' + a).children().length) {
            $('.news-container').children().fadeOut();
            $('.month-click').removeClass('active');
            $('#month' + a).fadeIn();
            $(this).addClass('active');
        }
    });
    
    $('input').blur(function(){
				if($(this).val() == $(this).attr('title') || $(this).val() == '' )
					$(this).val($(this).attr('title'));
			});
			
			$('input').focus(function(){
				if($(this).val() == $(this).attr('title') || $(this).val() == '' )
					$(this).val('');
			});
    
    $('.light-box').lightBox()
});

