/***************************************************
this script is uncompressed in the purchased download
***************************************************/

jQuery(document).ready(function (a) {
    wind_height = a(window).height();
    a("section").css("height", wind_height + "px");
    a("#menu").find("a").each(function () {
        a(this).click(function (b) {
            b.preventDefault();
            a.scrollTo(a(this).attr("href"), 1500, {
                easing: "easeOutExpo"
            })
        })
    });
    a(" #logo , a.services , a.contact").click(function (b) {
        b.preventDefault();
        a.scrollTo(a(this).attr("href"), 1500, {
            easing: "easeOutExpo"
        })
    });
    a("#up").click(function (b) {
        b.preventDefault();
        a.scrollTo(a(this).attr("href"), 1500, {
            easing: "easeOutExpo"
        })
    });
    a(window).scroll(function () {
        if (a(document).scrollTop() > a("#home").height()) {
            a("#up").css("display", "block")
        } else {
            a("#up").css("display", "none")
        }
    })
});

jQuery(document).ready(function (a) {
    a("#tj_container").gridnav({
        type: {
            mode: "showhide",
            speed: 400,
            easing: "",
            factor: 50,
            reverse: true
        }
    })
});

(function (a) {
    a.fn.tipTip = function (b) {
        var c = {
            activation: "hover",
            keepAlive: false,
            maxWidth: "200px",
            edgeOffset: 3,
            defaultPosition: "bottom",
            delay: 400,
            fadeIn: 200,
            fadeOut: 200,
            attribute: "title",
            content: false,
            enter: function () {},
            exit: function () {}
        };
        var d = a.extend(c, b);
        if (a("#tiptip_holder").length <= 0) {
            var e = a('<div id="tiptip_holder" style="max-width:' + d.maxWidth + ';"></div>');
            var f = a('<div id="tiptip_content"></div>');
            var g = a('<div id="tiptip_arrow"></div>');
            a("body").append(e.html(f).prepend(g.html('<div id="tiptip_arrow_inner"></div>')))
        } else {
            var e = a("#tiptip_holder");
            var f = a("#tiptip_content");
            var g = a("#tiptip_arrow")
        }
        return this.each(function () {
            var b = a(this);
            if (d.content) {
                var c = d.content
            } else {
                var c = b.attr(d.attribute)
            }
            if (c != "") {
                if (!d.content) {
                    b.removeAttr(d.attribute)
                }
                var h = false;
                if (d.activation == "hover") {
                    b.hover(function () {
                        i()
                    }, function () {
                        if (!d.keepAlive) {
                            j()
                        }
                    });
                    if (d.keepAlive) {
                        e.hover(function () {}, function () {
                            j()
                        })
                    }
                } else if (d.activation == "focus") {
                    b.focus(function () {
                        i()
                    }).blur(function () {
                        j()
                    })
                } else if (d.activation == "click") {
                    b.click(function () {
                        i();
                        return false
                    }).hover(function () {}, function () {
                        if (!d.keepAlive) {
                            j()
                        }
                    });
                    if (d.keepAlive) {
                        e.hover(function () {}, function () {
                            j()
                        })
                    }
                }

                function i() {
                    d.enter.call(this);
                    f.html(c);
                    e.hide().removeAttr("class").css("margin", "0");
                    g.removeAttr("style");
                    var i = parseInt(b.offset()["top"]);
                    var j = parseInt(b.offset()["left"]);
                    var k = parseInt(b.outerWidth());
                    var l = parseInt(b.outerHeight());
                    var m = e.outerWidth();
                    var n = e.outerHeight();
                    var o = Math.round((k - m) / 2);
                    var p = Math.round((l - n) / 2);
                    var q = Math.round(j + o);
                    var r = Math.round(i + l + d.edgeOffset);
                    var s = "";
                    var t = "";
                    var u = Math.round(m - 12) / 2;
                    if (d.defaultPosition == "bottom") {
                        s = "_bottom"
                    } else if (d.defaultPosition == "top") {
                        s = "_top"
                    } else if (d.defaultPosition == "left") {
                        s = "_left"
                    } else if (d.defaultPosition == "right") {
                        s = "_right"
                    }
                    var v = o + j < parseInt(a(window).scrollLeft());
                    var w = m + j > parseInt(a(window).width());
                    if (v && o < 0 || s == "_right" && !w || s == "_left" && j < m + d.edgeOffset + 5) {
                        s = "_right";
                        t = Math.round(n - 13) / 2;
                        u = -12;
                        q = Math.round(j + k + d.edgeOffset);
                        r = Math.round(i + p)
                    } else if (w && o < 0 || s == "_left" && !v) {
                        s = "_left";
                        t = Math.round(n - 13) / 2;
                        u = Math.round(m);
                        q = Math.round(j - (m + d.edgeOffset + 5));
                        r = Math.round(i + p)
                    }
                    var x = i + l + d.edgeOffset + n + 8 > parseInt(a(window).height() + a(window).scrollTop());
                    var y = i + l - (d.edgeOffset + n + 8) < 0;
                    if (x || s == "_bottom" && x || s == "_top" && !y) {
                        if (s == "_top" || s == "_bottom") {
                            s = "_top"
                        } else {
                            s = s + "_top"
                        }
                        t = n;
                        r = Math.round(i - (n + 5 + d.edgeOffset))
                    } else if (y | (s == "_top" && y) || s == "_bottom" && !x) {
                        if (s == "_top" || s == "_bottom") {
                            s = "_bottom"
                        } else {
                            s = s + "_bottom"
                        }
                        t = -12;
                        r = Math.round(i + l + d.edgeOffset)
                    }
                    if (s == "_right_top" || s == "_left_top") {
                        r = r + 5
                    } else if (s == "_right_bottom" || s == "_left_bottom") {
                        r = r - 5
                    }
                    if (s == "_left_top" || s == "_left_bottom") {
                        q = q + 5
                    }
                    g.css({
                        "margin-left": u + "px",
                        "margin-top": t + "px"
                    });
                    e.css({
                        "margin-left": q + "px",
                        "margin-top": r + "px"
                    }).attr("class", "tip" + s);
                    if (h) {
                        clearTimeout(h)
                    }
                    h = setTimeout(function () {
                        e.stop(true, true).fadeIn(d.fadeIn)
                    }, d.delay)
                }

                function j() {
                    d.exit.call(this);
                    if (h) {
                        clearTimeout(h)
                    }
                    e.fadeOut(d.fadeOut)
                }
            }
        })
    }
})(jQuery);

$(function () {
    $(".tooltip, .contact").tipTip({
        maxWidth: "auto",
        edgeOffset: 5,
        defaultPosition: "top"
    })
});

(function (a) {
    function c(a) {
        return typeof a == "object" ? a : {
            top: a,
            left: a
        }
    }
    var b = a.scrollTo = function (b, c, e) {
            a(window).scrollTo(b, c, e)
        };
    b.defaults = {
        axis: "xy",
        duration: parseFloat(a.fn.jquery) >= 1.3 ? 0 : 1
    };
    b.window = function (b) {
        return a(window)._scrollable()
    };
    a.fn._scrollable = function () {
        return this.map(function () {
            var b = this,
                c = !b.nodeName || a.inArray(b.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) != -1;
            if (!c) return b;
            var e = (b.contentWindow || b).document || b.ownerDocument || b;
            return a.browser.safari || e.compatMode == "BackCompat" ? e.body : e.documentElement
        })
    };
    a.fn.scrollTo = function (e, f, g) {
        if (typeof f == "object") {
            g = f;
            f = 0
        }
        if (typeof g == "function") g = {
            onAfter: g
        };
        if (e == "max") e = 9e9;
        g = a.extend({}, b.defaults, g);
        f = f || g.speed || g.duration;
        g.queue = g.queue && g.axis.length > 1;
        if (g.queue) f /= 2;
        g.offset = c(g.offset);
        g.over = c(g.over);
        return this._scrollable().each(function () {
            function r(a) {
                i.animate(o, f, g.easing, a &&
                function () {
                    a.call(this, e, g)
                })
            }
            var h = this,
                i = a(h),
                l = e,
                m, o = {},
                q = i.is("html,body");
            switch (typeof l) {
            case "number":
            case "string":
                if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)) {
                    l = c(l);
                    break
                }
                l = a(l, this);
            case "object":
                if (l.is || l.style) m = (l = a(l)).offset()
            }
            a.each(g.axis.split(""), function (a, c) {
                var d = c == "x" ? "Left" : "Top",
                    e = d.toLowerCase(),
                    f = "scroll" + d,
                    j = h[f],
                    n = b.max(h, c);
                if (m) {
                    o[f] = m[e] + (q ? 0 : j - i.offset()[e]);
                    if (g.margin) {
                        o[f] -= parseInt(l.css("margin" + d)) || 0;
                        o[f] -= parseInt(l.css("border" + d + "Width")) || 0
                    }
                    o[f] += g.offset[e] || 0;
                    if (g.over[e]) o[f] += l[c == "x" ? "width" : "height"]() * g.over[e]
                } else {
                    var p = l[e];
                    o[f] = p.slice && p.slice(-1) == "%" ? parseFloat(p) / 100 * n : p
                }
                if (/^\d+$/.test(o[f])) o[f] = o[f] <= 0 ? 0 : Math.min(o[f], n);
                if (!a && g.queue) {
                    if (j != o[f]) r(g.onAfterFirst);
                    delete o[f]
                }
            });
            r(g.onAfter)
        }).end()
    };
    b.max = function (b, c) {
        var e = c == "x" ? "Width" : "Height",
            f = "scroll" + e;
        if (!a(b).is("html,body")) return b[f] - a(b)[e.toLowerCase()]();
        var g = "client" + e,
            h = b.ownerDocument.documentElement,
            i = b.ownerDocument.body;
        return Math.max(h[f], i[f]) - Math.min(h[g], i[g])
    }
})(jQuery);
(function (a) {
    var b = a.serialScroll = function (b) {
            return a(window).serialScroll(b)
        };
    b.defaults = {
        duration: 1e3,
        axis: "x",
        event: "click",
        start: 0,
        step: 1,
        lock: !0,
        cycle: !0,
        constant: !0
    };
    a.fn.serialScroll = function (c) {
        return this.each(function () {
            function u(a) {
                if (!isNaN(a)) {
                    return a
                }
                var b = t(),
                    c;
                while ((c = b.index(a)) == -1 && a != j) {
                    a = a.parentNode
                }
                return c
            }

            function t() {
                return a(k, j)
            }

            function s() {
                clearTimeout(o)
            }

            function r() {
                i.trigger("next.serialScroll")
            }

            function q(a, b) {
                if (!isNaN(b)) {
                    a.data = b;
                    b = j
                }
                var c = a.data,
                    e, g = a.type,
                    h = d.exclude ? t().slice(0, -d.exclude) : t(),
                    k = h.length,
                    n = h[c],
                    p = d.duration;
                if (g) {
                    a.preventDefault()
                }
                if (m) {
                    s();
                    o = setTimeout(r, d.interval)
                }
                if (!n) {
                    e = c < 0 ? 0 : k - 1;
                    if (l != e) {
                        c = e
                    } else {
                        if (!d.cycle) {
                            return
                        } else {
                            c = k - e - 1
                        }
                    }
                    n = h[c]
                }
                if (!n || d.lock && i.is(":animated") || g && d.onBefore && d.onBefore(a, n, i, t(), c) === !1) {
                    return
                }
                if (d.stop) {
                    i.queue("fx", []).stop()
                }
                if (d.constant) {
                    p = Math.abs(p / f * (l - c))
                }
                i.scrollTo(n, p, d).trigger("notify.serialScroll", [c])
            }

            function p(a) {
                a.data += l;
                q(a, this)
            }
            var d = a.extend({}, b.defaults, c),
                e = d.event,
                f = d.step,
                g = d.lazy,
                h = d.target ? this : document,
                i = a(d.target || this, h),
                j = i[0],
                k = d.items,
                l = d.start,
                m = d.interval,
                n = d.navigation,
                o;
            if (!g) {
                k = t()
            }
            if (d.force) {
                q({}, l)
            }
            a(d.prev || [], h).bind(e, -f, p);
            a(d.next || [], h).bind(e, f, p);
            if (!j.ssbound) {
                i.bind("prev.serialScroll", -f, p).bind("next.serialScroll", f, p).bind("goto.serialScroll", q)
            }
            if (m) {
                i.bind("start.serialScroll", function (a) {
                    if (!m) {
                        s();
                        m = !0;
                        r()
                    }
                }).bind("stop.serialScroll", function () {
                    s();
                    m = !1
                })
            }
            i.bind("notify.serialScroll", function (a, b) {
                var c = u(b);
                if (c > -1) {
                    l = c
                }
            });
            j.ssbound = !0;
            if (d.jump) {
                (g ? i : t()).bind(e, function (a) {
                    q(a, u(a.target))
                })
            }
            if (n) {
                n = a(n, h).bind(e, function (a) {
                    a.data = Math.round(t().length / n.length) * n.index(this);
                    q(a, this)
                })
            }
        })
    }
})(jQuery);
(function (a) {
    a.fn.featureCarousel = function (b) {
        b = a.extend({}, a.fn.featureCarousel.defaults, b || {});
        return a(this).each(function () {
            function s(a, b) {
                var c = 1,
                    d = 1,
                    e;
                e = a;
                while ((e = g(e)) != b) {
                    c++
                }
                e = a;
                while ((e = h(e)) != b) {
                    d++
                }
                return c < d ? c * -1 : d
            }

            function r(a, b) {
                if (c.currentlyMoving == false) {
                    var d = b * c.itemsToAnimate;
                    c.rotationsRemaining = d;
                    q(a)
                }
            }

            function q(a) {
                c.currentlyMoving = true;
                var b, d, f, i;
                if (a == true) {
                    b = e(h(c.currentCenterNum));
                    d = e(c.currentCenterNum);
                    f = e(h(h(c.currentCenterNum)));
                    i = e(g(c.currentCenterNum));
                    c.currentCenterNum = h(c.currentCenterNum)
                } else {
                    b = e(g(c.currentCenterNum));
                    d = e(g(g(c.currentCenterNum)));
                    f = e(c.currentCenterNum);
                    i = e(h(c.currentCenterNum));
                    c.currentCenterNum = g(c.currentCenterNum)
                }
                if (a) {
                    d.css("z-index", 3)
                } else {
                    f.css("z-index", 3)
                }
                b.css("z-index", 4);
                p(d, a);
                p(b, a);
                p(f, a);
                if (c.totalFeatureCount > 3) {
                    p(i, a)
                }
            }

            function p(a, d) {
                var e, f, i, j, k, l, p;
                var r = a.data("position");
                var s;
                if (d == true) s = g(r);
                else s = h(r);
                if (r == 1) {
                    b.leavingCenter(a)
                }
                if (s == 1) {
                    e = c.largeFeatureWidth;
                    f = c.largeFeatureHeight;
                    i = b.topPadding;
                    k = a.css("z-index");
                    j = c.containerWidth / 2 - c.largeFeatureWidth / 2 - c.borderWidth / 2;
                    p = 1
                } else {
                    e = c.smallFeatureWidth;
                    f = c.smallFeatureHeight;
                    i = b.smallFeatureOffset + b.topPadding;
                    k = 1;
                    p = .4;
                    if (s == c.totalFeatureCount) {
                        j = b.sidePadding
                    } else if (s == 2) {
                        j = c.containerWidth - c.smallFeatureWidth - b.sidePadding - c.borderWidth
                    } else {
                        j = c.containerWidth / 2 - c.smallFeatureWidth / 2 - c.borderWidth / 2;
                        p = 0
                    }
                }
                if (r == 1) {
                    a.find(".carousel-caption").hide()
                }
                a.animate({
                    width: e,
                    height: f,
                    top: i,
                    left: j,
                    opacity: p
                }, b.carouselSpeed, b.animationEasing, function () {
                    if (s == 1) {
                        if (b.captionBelow) a.css("height", "auto");
                        a.find(".carousel-caption").fadeTo("fast", .85);
                        b.movedToCenter(a)
                    }
                    c.rotationsRemaining = c.rotationsRemaining - 1;
                    a.css("z-index", k);
                    if (b.trackerIndividual || b.trackerSummation) {
                        if (s == 1) {
                            var e = c.featuresContainer.find(".carousel-feature").index(a) + 1;
                            var f;
                            if (d == false) f = h(e);
                            else f = g(e);
                            m(f, e)
                        }
                    }
                    var i = c.rotationsRemaining / c.itemsToAnimate;
                    if (i % 1 == 0) {
                        c.currentlyMoving = false;
                        o(d);
                        if (c.rotationsRemaining > 0) q(d)
                    }
                    n(false)
                }).find(".carousel-image").animate({
                    width: e,
                    height: f
                }, b.carouselSpeed, b.animationEasing).end()
            }

            function o(b) {
                a.each(c.featuresArray, function () {
                    var c;
                    if (b == false) {
                        c = h(a(this).data().position)
                    } else {
                        c = g(a(this).data().position)
                    }
                    a(this).data("position", c)
                })
            }

            function n(a) {
                clearTimeout(c.timeoutVar);
                if (!a && b.autoPlay != 0) {
                    var d = Math.abs(b.autoPlay) < b.carouselSpeed ? b.carouselSpeed : Math.abs(b.autoPlay);
                    c.timeoutVar = setTimeout(function () {
                        b.autoPlay > 0 ? r(true, 1) : r(false, 1)
                    }, d)
                }
            }

            function m(a, d) {
                if (b.trackerIndividual) {
                    var e = c.featuresContainer.find(".tracker-individual-container");
                    var f = e.find("#tracker-" + a);
                    var g = e.find("#tracker-" + d);
                    f.removeClass("tracker-individual-blip-selected");
                    g.addClass("tracker-individual-blip-selected")
                }
                if (b.trackerSummation) {
                    var e = c.featuresContainer.find(".tracker-summation-container");
                    e.find(".tracker-summation-current").text(d)
                }
            }

            function l() {
                if (b.trackerIndividual) {
                    var d = a("<ul></ul>");
                    d.addClass("tracker-individual-container");
                    for (var e = 0; e < c.totalFeatureCount; e++) {
                        var f = e + 1;
                        var g = a("<div>" + f + "</div>");
                        g.addClass("tracker-individual-blip");
                        g.css("cursor", "pointer");
                        g.attr("id", "tracker-" + (e + 1));
                        var h = a("<li></li>");
                        h.append(g);
                        h.css("float", "left");
                        h.css("list-style-type", "none");
                        d.append(h)
                    }
                    a(c.containerIDTag).append(d);
                    d.hide().show()
                }
                if (b.trackerSummation) {
                    var i = a("<div></div>");
                    i.addClass("tracker-summation-container");
                    var j = a("<span></span>").addClass("tracker-summation-current").text(b.startingFeature);
                    var k = a("<span></span>").addClass("tracker-summation-total").text(c.totalFeatureCount);
                    var l = a("<span></span>").addClass("tracker-summation-middle").text(" of ");
                    i.append(j).append(l).append(k);
                    a(c.containerIDTag).append(i)
                }
            }

            function k() {
                a.each(c.featuresArray, function (b) {
                    a(this).data("setPosition", b + 1)
                });
                var d = g(b.startingFeature);
                c.currentCenterNum = d;
                var f = e(d);
                f.data("position", 1);
                var h = f.prevAll();
                h.each(function (b) {
                    a(this).data("position", c.totalFeatureCount - b)
                });
                var i = f.nextAll();
                i.each(function (b) {
                    if (a(this).data("setPosition") != undefined) {
                        a(this).data("position", b + 2)
                    }
                });
                if (b.counterStyle == "caption") {
                    a.each(c.featuresArray, function () {
                        var b = g(a(this).data("position"));
                        var d = a("<span></span>");
                        d.addClass("numberTag");
                        d.html("(" + b + " of " + c.totalFeatureCount + ") ");
                        a(this).find(".carousel-caption p").prepend(d)
                    })
                }
            }

            function j() {
                if (b.displayCutoff > 0 && b.displayCutoff < c.totalFeatureCount) {
                    c.totalFeatureCount = b.displayCutoff
                }
                c.featuresContainer.find(".carousel-feature").each(function (b) {
                    if (b < c.totalFeatureCount) {
                        c.featuresArray[b] = a(this)
                    }
                });
                if (c.featuresContainer.find(".carousel-feature").first().css("borderLeftWidth") != "medium") {
                    c.borderWidth = parseInt(c.featuresContainer.find(".carousel-feature").first().css("borderLeftWidth")) * 2
                }
                c.featuresContainer.find(".carousel-feature").each(function () {
                    a(this).css({
                        left: c.containerWidth / 2 - c.smallFeatureWidth / 2 - c.borderWidth / 2,
                        width: c.smallFeatureWidth,
                        height: c.smallFeatureHeight,
                        top: b.smallFeatureOffset + b.topPadding,
                        opacity: 0
                    })
                }).find(".carousel-image").css({
                    width: c.smallFeatureWidth
                });
                if (b.captionBelow) {
                    c.featuresContainer.find(".carousel-caption").css("position", "relative")
                }
                if (c.totalFeatureCount < 4) {
                    c.itemsToAnimate = c.totalFeatureCount
                } else {
                    c.itemsToAnimate = 4
                }
                c.featuresContainer.find(".carousel-caption").hide()
            }

            function i() {
                c.containerWidth = c.featuresContainer.width();
                c.containerHeight = c.featuresContainer.height();
                var d = a(c.containerIDTag).find(".carousel-image:first");
                if (b.largeFeatureWidth > 1) c.largeFeatureWidth = b.largeFeatureWidth;
                else if (b.largeFeatureWidth > 0 && b.largeFeatureWidth < 1) c.largeFeatureWidth = d.width() * b.largeFeatureWidth;
                else c.largeFeatureWidth = d.outerWidth();
                if (b.largeFeatureHeight > 1) c.largeFeatureHeight = b.largeFeatureHeight;
                else if (b.largeFeatureHeight > 0 && b.largeFeatureHeight < 1) c.largeFeatureHeight = d.height() * b.largeFeatureHeight;
                else c.largeFeatureHeight = d.outerHeight();
                if (b.smallFeatureWidth > 1) c.smallFeatureWidth = b.smallFeatureWidth;
                else if (b.smallFeatureWidth > 0 && b.smallFeatureWidth < 1) c.smallFeatureWidth = d.width() * b.smallFeatureWidth;
                else c.smallFeatureWidth = d.outerWidth() / 2;
                if (b.smallFeatureHeight > 1) c.smallFeatureHeight = b.smallFeatureHeight;
                else if (b.smallFeatureHeight > 0 && b.smallFeatureHeight < 1) c.smallFeatureHeight = d.height() * b.smallFeatureHeight;
                else c.smallFeatureHeight = d.outerHeight() / 2
            }

            function h(a) {
                if (a + 1 > c.totalFeatureCount) {
                    return 1
                } else {
                    return a + 1
                }
            }

            function g(a) {
                if (a - 1 == 0) {
                    return c.totalFeatureCount
                } else {
                    return a - 1
                }
            }

            function f(b) {
                a.each(c.featuresArray, function () {
                    if (a(this).data().setPosition == b) return a(this)
                })
            }

            function e(a) {
                return c.featuresArray[a - 1]
            }

            function d(d) {
                if (b.preload == true) {
                    var e = c.featuresContainer.find("img");
                    var f = 0;
                    var g = e.length;
                    e.each(function () {
                        a(this).load(function () {
                            f++;
                            if (f == g) {
                                d()
                            }
                        });
                        if (this.complete || a.browser.msie) {
                            a(this).trigger("load")
                        }
                    })
                } else {
                    d()
                }
            }
            var c = {
                currentCenterNum: b.startingFeature,
                containerWidth: 0,
                containerHeight: 0,
                largeFeatureWidth: 0,
                largeFeatureHeight: 0,
                smallFeatureWidth: 0,
                smallFeatureHeight: 0,
                totalFeatureCount: a(this).children("div").length,
                currentlyMoving: false,
                featuresContainer: a(this),
                featuresArray: [],
                containerIDTag: "#" + a(this).attr("id"),
                timeoutVar: null,
                rotationsRemaining: 0,
                itemsToAnimate: 0,
                borderWidth: 0
            };
            d(function () {
                i();
                j();
                k();
                l();
                r(true, 1)
            });
            a(b.leftButtonTag).live("click", function () {
                r(false, 1)
            });
            a(b.rightButtonTag).live("click", function () {
                r(true, 1)
            });
            c.featuresContainer.find(".carousel-feature").click(function () {
                var b = a(this).data("position");
                if (b == 2) {
                    r(true, 1)
                } else if (b == c.totalFeatureCount) {
                    r(false, 1)
                }
            }).mouseover(function () {
                if (c.currentlyMoving == false) {
                    var d = a(this).data("position");
                    if (d == 2 || d == c.totalFeatureCount) {
                        a(this).css("opacity", .8)
                    }
                }
                if (b.pauseOnHover) n(true);
                if (b.stopOnHover) b.autoPlay = 0
            }).mouseout(function () {
                if (c.currentlyMoving == false) {
                    var d = a(this).data("position");
                    if (d == 2 || d == c.totalFeatureCount) {
                        a(this).css("opacity", .4)
                    }
                }
                if (b.pauseOnHover) {
                    n(false)
                }
            });
            a("a", c.containerIDTag).live("click", function (d) {
                var e = a(this).parentsUntil(c.containerIDTag);
                e.each(function () {
                    var e = a(this).data("position");
                    if (e != undefined) {
                        if (e != 1) {
                            if (e == c.totalFeatureCount) {
                                r(false, 1)
                            } else if (e == 2) {
                                r(true, 1)
                            }
                            d.preventDefault();
                            return false
                        } else {
                            b.clickedCenter(a(this))
                        }
                    }
                })
            });
            a(".tracker-individual-blip").live("click", function () {
                var b = a(this).attr("id").substring(8);
                var d = c.featuresContainer.find(".carousel-feature").eq(b - 1).data("position");
                var e = c.currentCenterNum;
                if (b != e) {
                    var f = s(1, d);
                    if (f < 0) {
                        r(false, f * -1)
                    } else {
                        r(true, f)
                    }
                }
            })
        })
    };
    a.fn.featureCarousel.defaults = {
        largeFeatureWidth: 0,
        largeFeatureHeight: 0,
        smallFeatureWidth: .5,
        smallFeatureHeight: .5,
        topPadding: 20,
        sidePadding: 50,
        smallFeatureOffset: 50,
        startingFeature: 1,
        carouselSpeed: 1e3,
        autoPlay: 4e3,
        pauseOnHover: true,
        stopOnHover: false,
        trackerIndividual: true,
        trackerSummation: true,
        preload: true,
        displayCutoff: 0,
        animationEasing: "swing",
        leftButtonTag: "#carousel-left",
        rightButtonTag: "#carousel-right",
        captionBelow: false,
        movedToCenter: a.noop,
        leavingCenter: a.noop,
        clickedCenter: a.noop
    }
})(jQuery);
jQuery.easing["jswing"] = jQuery.easing["swing"];
jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (a, b, c, d, e) {
        return jQuery.easing[jQuery.easing.def](a, b, c, d, e)
    },
    easeInQuad: function (a, b, c, d, e) {
        return d * (b /= e) * b + c
    },
    easeOutQuad: function (a, b, c, d, e) {
        return -d * (b /= e) * (b - 2) + c
    },
    easeInOutQuad: function (a, b, c, d, e) {
        if ((b /= e / 2) < 1) return d / 2 * b * b + c;
        return -d / 2 * (--b * (b - 2) - 1) + c
    },
    easeInCubic: function (a, b, c, d, e) {
        return d * (b /= e) * b * b + c
    },
    easeOutCubic: function (a, b, c, d, e) {
        return d * ((b = b / e - 1) * b * b + 1) + c
    },
    easeInOutCubic: function (a, b, c, d, e) {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b + c;
        return d / 2 * ((b -= 2) * b * b + 2) + c
    },
    easeInQuart: function (a, b, c, d, e) {
        return d * (b /= e) * b * b * b + c
    },
    easeOutQuart: function (a, b, c, d, e) {
        return -d * ((b = b / e - 1) * b * b * b - 1) + c
    },
    easeInOutQuart: function (a, b, c, d, e) {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b * b + c;
        return -d / 2 * ((b -= 2) * b * b * b - 2) + c
    },
    easeInQuint: function (a, b, c, d, e) {
        return d * (b /= e) * b * b * b * b + c
    },
    easeOutQuint: function (a, b, c, d, e) {
        return d * ((b = b / e - 1) * b * b * b * b + 1) + c
    },
    easeInOutQuint: function (a, b, c, d, e) {
        if ((b /= e / 2) < 1) return d / 2 * b * b * b * b * b + c;
        return d / 2 * ((b -= 2) * b * b * b * b + 2) + c
    },
    easeInSine: function (a, b, c, d, e) {
        return -d * Math.cos(b / e * (Math.PI / 2)) + d + c
    },
    easeOutSine: function (a, b, c, d, e) {
        return d * Math.sin(b / e * (Math.PI / 2)) + c
    },
    easeInOutSine: function (a, b, c, d, e) {
        return -d / 2 * (Math.cos(Math.PI * b / e) - 1) + c
    },
    easeInExpo: function (a, b, c, d, e) {
        return b == 0 ? c : d * Math.pow(2, 10 * (b / e - 1)) + c
    },
    easeOutExpo: function (a, b, c, d, e) {
        return b == e ? c + d : d * (-Math.pow(2, -10 * b / e) + 1) + c
    },
    easeInOutExpo: function (a, b, c, d, e) {
        if (b == 0) return c;
        if (b == e) return c + d;
        if ((b /= e / 2) < 1) return d / 2 * Math.pow(2, 10 * (b - 1)) + c;
        return d / 2 * (-Math.pow(2, -10 * --b) + 2) + c
    },
    easeInCirc: function (a, b, c, d, e) {
        return -d * (Math.sqrt(1 - (b /= e) * b) - 1) + c
    },
    easeOutCirc: function (a, b, c, d, e) {
        return d * Math.sqrt(1 - (b = b / e - 1) * b) + c
    },
    easeInOutCirc: function (a, b, c, d, e) {
        if ((b /= e / 2) < 1) return -d / 2 * (Math.sqrt(1 - b * b) - 1) + c;
        return d / 2 * (Math.sqrt(1 - (b -= 2) * b) + 1) + c
    },
    easeInElastic: function (a, b, c, d, e) {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e) == 1) return c + d;
        if (!g) g = e * .3;
        if (h < Math.abs(d)) {
            h = d;
            var f = g / 4
        } else var f = g / (2 * Math.PI) * Math.asin(d / h);
        return -(h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g)) + c
    },
    easeOutElastic: function (a, b, c, d, e) {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e) == 1) return c + d;
        if (!g) g = e * .3;
        if (h < Math.abs(d)) {
            h = d;
            var f = g / 4
        } else var f = g / (2 * Math.PI) * Math.asin(d / h);
        return h * Math.pow(2, -10 * b) * Math.sin((b * e - f) * 2 * Math.PI / g) + d + c
    },
    easeInOutElastic: function (a, b, c, d, e) {
        var f = 1.70158;
        var g = 0;
        var h = d;
        if (b == 0) return c;
        if ((b /= e / 2) == 2) return c + d;
        if (!g) g = e * .3 * 1.5;
        if (h < Math.abs(d)) {
            h = d;
            var f = g / 4
        } else var f = g / (2 * Math.PI) * Math.asin(d / h);
        if (b < 1) return -.5 * h * Math.pow(2, 10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) + c;
        return h * Math.pow(2, -10 * (b -= 1)) * Math.sin((b * e - f) * 2 * Math.PI / g) * .5 + d + c
    },
    easeInBack: function (a, b, c, d, e, f) {
        if (f == undefined) f = 1.70158;
        return d * (b /= e) * b * ((f + 1) * b - f) + c
    },
    easeOutBack: function (a, b, c, d, e, f) {
        if (f == undefined) f = 1.70158;
        return d * ((b = b / e - 1) * b * ((f + 1) * b + f) + 1) + c
    },
    easeInOutBack: function (a, b, c, d, e, f) {
        if (f == undefined) f = 1.70158;
        if ((b /= e / 2) < 1) return d / 2 * b * b * (((f *= 1.525) + 1) * b - f) + c;
        return d / 2 * ((b -= 2) * b * (((f *= 1.525) + 1) * b + f) + 2) + c
    },
    easeInBounce: function (a, b, c, d, e) {
        return d - jQuery.easing.easeOutBounce(a, e - b, 0, d, e) + c
    },
    easeOutBounce: function (a, b, c, d, e) {
        if ((b /= e) < 1 / 2.75) {
            return d * 7.5625 * b * b + c
        } else if (b < 2 / 2.75) {
            return d * (7.5625 * (b -= 1.5 / 2.75) * b + .75) + c
        } else if (b < 2.5 / 2.75) {
            return d * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c
        } else {
            return d * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c
        }
    },
    easeInOutBounce: function (a, b, c, d, e) {
        if (b < e / 2) return jQuery.easing.easeInBounce(a, b * 2, 0, d, e) * .5 + c;
        return jQuery.easing.easeOutBounce(a, b * 2 - e, 0, d, e) * .5 + d * .5 + c
    }
});
(function (a) {
    function b(b) {
        var c = b || window.event,
            e = [].slice.call(arguments, 1),
            f = 0,
            g = 0,
            h = 0;
        b = a.event.fix(c);
        b.type = "mousewheel";
        if (b.wheelDelta) f = b.wheelDelta / 120;
        if (b.detail) f = -b.detail / 3;
        h = f;
        if (c.axis !== undefined && c.axis === c.HORIZONTAL_AXIS) {
            h = 0;
            g = -1 * f
        }
        if (c.wheelDeltaY !== undefined) h = c.wheelDeltaY / 120;
        if (c.wheelDeltaX !== undefined) g = -1 * c.wheelDeltaX / 120;
        e.unshift(b, f, g, h);
        return a.event.handle.apply(this, e)
    }
    var c = ["DOMMouseScroll", "mousewheel"];
    a.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener) for (var a = c.length; a;) this.addEventListener(c[--a], b, false);
            else this.onmousewheel = b
        },
        teardown: function () {
            if (this.removeEventListener) for (var a = c.length; a;) this.removeEventListener(c[--a], b, false);
            else this.onmousewheel = null
        }
    };
    a.fn.extend({
        mousewheel: function (a) {
            return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
        },
        unmousewheel: function (a) {
            return this.unbind("mousewheel", a)
        }
    })
})(jQuery);
$(document).ready(function () {
    function f(a) {
        var b = $("#slider .navigation").find('a[href$="' + a.id + '"]').get(0);
        e.call(b)
    }

    function e() {
        $(this).parents("ul:first").find("a").removeClass("selected").end().end().addClass("selected")
    }
    var a = $("#services_slider .scrollContainer > div");
    var b = $("#services_sliderslider .scrollContainer");
    var c = true;
    if (c) {
        a.css({
            "float": "left",
            position: "relative"
        });
        b.css("width", a[0].offsetWidth * a.length)
    }
    var d = $("#services_slider .scroll").css("overflow", "hidden");
    d.before('<img class="scrollButtons left" src="style/images/blank.gif" width="22" height="40" />').after('<img class="scrollButtons right" src="style/images/blank.gif"width="22" height="40" />');
    $("#services_slider .navigation").find("a").click(e);
    if (window.location.hash) {
        f({
            id: window.location.hash.substr(1)
        })
    } else {
        $("ul.navigation a:first").click()
    }
    var g = parseInt((c ? b.css("paddingTop") : b.css("paddingLeft")) || 0) * -1;
    var h = {
        target: d,
        items: a,
        navigation: ".navigation a",
        prev: "img.left",
        next: "img.right",
        axis: "xy",
        onAfter: f,
        offset: g,
        duration: 500,
        easing: "swing"
    };
    $("#services_slider").serialScroll(h)
});
(function (a) {
    function d(a, b) {
        a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var c = "[\\?&]" + a + "=([^&#]*)";
        var d = new RegExp(c);
        var e = d.exec(b);
        return e == null ? "" : e[1]
    }

    function c() {
        if (typeof theRel == "undefined") return;
        location.hash = "!" + theRel + "/" + rel_index + "/"
    }

    function b() {
        url = location.href;
        hashtag = url.indexOf("#!") != -1 ? decodeURI(url.substring(url.indexOf("#!") + 2, url.length)) : false;
        return hashtag
    }
    a.prettyPhoto = {
        version: "3.1.2"
    };
    a.fn.prettyPhoto = function (e) {
        function A(b) {
            settings.markup = settings.markup.replace("{pp_social}", settings.social_tools ? settings.social_tools : "");
            a("body").append(settings.markup);
            $pp_pic_holder = a(".pp_pic_holder"), $ppt = a(".ppt"), $pp_overlay = a("div.pp_overlay");
            if (isSet && settings.overlay_gallery) {
                currentGalleryPage = 0;
                toInject = "";
                for (var c = 0; c < pp_images.length; c++) {
                    if (!pp_images[c].match(/\b(jpg|jpeg|png|gif)\b/gi)) {
                        classname = "default";
                        img_src = ""
                    } else {
                        classname = "";
                        img_src = pp_images[c]
                    }
                    toInject += "<li class='" + classname + "'><a href='#'><img src='" + img_src + "' width='50' alt='' /></a></li>"
                }
                toInject = settings.gallery_markup.replace(/{gallery}/g, toInject);
                $pp_pic_holder.find("#pp_full_res").after(toInject);
                $pp_gallery = a(".pp_pic_holder .pp_gallery"), $pp_gallery_li = $pp_gallery.find("li");
                $pp_gallery.find(".pp_arrow_next").click(function () {
                    a.prettyPhoto.changeGalleryPage("next");
                    a.prettyPhoto.stopSlideshow();
                    return false
                });
                $pp_gallery.find(".pp_arrow_previous").click(function () {
                    a.prettyPhoto.changeGalleryPage("previous");
                    a.prettyPhoto.stopSlideshow();
                    return false
                });
                $pp_pic_holder.find(".pp_content").hover(function () {
                    $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()
                }, function () {
                    $pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()
                });
                itemWidth = 52 + 5;
                $pp_gallery_li.each(function (b) {
                    a(this).find("a").click(function () {
                        a.prettyPhoto.changePage(b);
                        a.prettyPhoto.stopSlideshow();
                        return false
                    })
                })
            }
            if (settings.slideshow) {
                $pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');
                $pp_pic_holder.find(".pp_nav .pp_play").click(function () {
                    a.prettyPhoto.startSlideshow();
                    return false
                })
            }
            $pp_pic_holder.attr("class", "pp_pic_holder " + settings.theme);
            $pp_overlay.css({
                opacity: 0,
                height: a(document).height(),
                width: a(window).width()
            }).bind("click", function () {
                if (!settings.modal) a.prettyPhoto.close()
            });
            a("a.pp_close").bind("click", function () {
                a.prettyPhoto.close();
                return false
            });
            a("a.pp_expand").bind("click", function (b) {
                if (a(this).hasClass("pp_expand")) {
                    a(this).removeClass("pp_expand").addClass("pp_contract");
                    doresize = false
                } else {
                    a(this).removeClass("pp_contract").addClass("pp_expand");
                    doresize = true
                }
                r(function () {
                    a.prettyPhoto.open()
                });
                return false
            });
            $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function () {
                a.prettyPhoto.changePage("previous");
                a.prettyPhoto.stopSlideshow();
                return false
            });
            $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function () {
                a.prettyPhoto.changePage("next");
                a.prettyPhoto.stopSlideshow();
                return false
            });
            w()
        }

        function z() {
            if (isSet && settings.overlay_gallery && v(pp_images[set_position]) == "image" && settings.ie6_fallback && !(a.browser.msie && parseInt(a.browser.version) == 6)) {
                itemWidth = 52 + 5;
                navWidth = settings.theme == "facebook" || settings.theme == "pp_default" ? 50 : 30;
                itemsPerPage = Math.floor((h["containerWidth"] - 100 - navWidth) / itemWidth);
                itemsPerPage = itemsPerPage < pp_images.length ? itemsPerPage : pp_images.length;
                totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;
                if (totalPage == 0) {
                    navWidth = 0;
                    $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()
                } else {
                    $pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()
                }
                galleryWidth = itemsPerPage * itemWidth;
                fullGalleryWidth = pp_images.length * itemWidth;
                $pp_gallery.css("margin-left", -(galleryWidth / 2 + navWidth / 2)).find("div:first").width(galleryWidth + 5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");
                goToPage = Math.floor(set_position / itemsPerPage) < totalPage ? Math.floor(set_position / itemsPerPage) : totalPage;
                a.prettyPhoto.changeGalleryPage(goToPage);
                $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected")
            } else {
                $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")
            }
        }

        function y() {
            n = a(window).height(), o = a(window).width();
            if (typeof $pp_overlay != "undefined") $pp_overlay.height(a(document).height()).width(o)
        }

        function x() {
            if (self.pageYOffset) {
                return {
                    scrollTop: self.pageYOffset,
                    scrollLeft: self.pageXOffset
                }
            } else if (document.documentElement && document.documentElement.scrollTop) {
                return {
                    scrollTop: document.documentElement.scrollTop,
                    scrollLeft: document.documentElement.scrollLeft
                }
            } else if (document.body) {
                return {
                    scrollTop: document.body.scrollTop,
                    scrollLeft: document.body.scrollLeft
                }
            }
        }

        function w() {
            if (doresize && typeof $pp_pic_holder != "undefined") {
                scroll_pos = x();
                contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
                projectedTop = n / 2 + scroll_pos["scrollTop"] - contentHeight / 2;
                if (projectedTop < 0) projectedTop = 0;
                if (contentHeight > n) return;
                $pp_pic_holder.css({
                    top: projectedTop,
                    left: o / 2 + scroll_pos["scrollLeft"] - contentwidth / 2
                })
            }
        }

        function v(a) {
            if (a.match(/youtube\.com\/watch/i)) {
                return "youtube"
            } else if (a.match(/vimeo\.com/i)) {
                return "vimeo"
            } else if (a.match(/\b.mp4\b/i)) {
                return "jw"
            } else if (a.match(/\b.wmv\b/i)) {
                return "wmp"
            } else if (a.match(/\b.avi\b/i)) {
                return "wmp"
            } else if (a.match(/\b.mpg\b/i)) {
                return "wmp"
            } else if (a.match(/\b.m4v\b/i)) {
                return "quicktime"
            } else if (a.match(/\b.mov\b/i)) {
                return "nonver"
            } else if (a.match(/\b.flv\b/i)) {
                return "jw"
            } else if (a.match(/\b.swf\b/i)) {
                return "jw"
            } else if (a.match(/\biframe=true\b/i)) {
                return "iframe"
            } else if (a.match(/\bajax=true\b/i)) {
                return "ajax"
            } else if (a.match(/\bcustom=true\b/i)) {
                return "custom"
            } else if (a.substr(0, 1) == "#") {
                return "inline"
            } else {
                return "image"
            }
        }

        function u(b, c) {
            b = parseFloat(b);
            c = parseFloat(c);
            $pp_details = $pp_pic_holder.find(".pp_details");
            $pp_details.width(b);
            detailsHeight = parseFloat($pp_details.css("marginTop")) + parseFloat($pp_details.css("marginBottom"));
            $pp_details = $pp_details.clone().addClass(settings.theme).width(b).appendTo(a("body")).css({
                position: "absolute",
                top: -1e4
            });
            detailsHeight += $pp_details.height();
            detailsHeight = detailsHeight <= 34 ? 36 : detailsHeight;
            if (a.browser.msie && a.browser.version == 7) detailsHeight += 8;
            $pp_details.remove();
            $pp_title = $pp_pic_holder.find(".ppt");
            $pp_title.width(b);
            titleHeight = parseFloat($pp_title.css("marginTop")) + parseFloat($pp_title.css("marginBottom"));
            $pp_title = $pp_title.clone().appendTo(a("body")).css({
                position: "absolute",
                top: -1e4
            });
            titleHeight += $pp_title.height();
            $pp_title.remove();
            j = c + detailsHeight;
            k = b;
            l = j + titleHeight + $pp_pic_holder.find(".pp_top").height() + $pp_pic_holder.find(".pp_bottom").height();
            m = b
        }

        function t(a, b) {
            resized = false;
            u(a, b);
            imageWidth = a, imageHeight = b;
            if ((m > o || l > n) && doresize && settings.allow_resize && !g) {
                resized = true, fitting = false;
                while (!fitting) {
                    if (m > o) {
                        imageWidth = o - 200;
                        imageHeight = b / a * imageWidth
                    } else if (l > n) {
                        imageHeight = n - 200;
                        imageWidth = a / b * imageHeight
                    } else {
                        fitting = true
                    }
                    l = imageHeight, m = imageWidth
                }
                u(imageWidth, imageHeight);
                if (m > o || l > n) {
                    t(m, l)
                }
            }
            return {
                width: Math.floor(imageWidth),
                height: Math.floor(imageHeight),
                containerHeight: Math.floor(l),
                containerWidth: Math.floor(m) + settings.horizontal_padding * 2,
                contentHeight: Math.floor(j),
                contentWidth: Math.floor(k),
                resized: resized
            }
        }

        function s(b) {
            b > 1 ? a(".pp_nav").show() : a(".pp_nav").hide()
        }

        function r(b) {
            $pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility", "hidden");
            $pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed, function () {
                a(".pp_loaderIcon").show();
                b()
            })
        }

        function q() {
            a(".pp_loaderIcon").hide();
            projectedTop = scroll_pos["scrollTop"] + (n / 2 - h["containerHeight"] / 2);
            if (projectedTop < 0) projectedTop = 0;
            $ppt.fadeTo(settings.animation_speed, 1);
            $pp_pic_holder.find(".pp_content").animate({
                height: h["contentHeight"],
                width: h["contentWidth"]
            }, settings.animation_speed);
            $pp_pic_holder.animate({
                top: projectedTop,
                left: o / 2 - h["containerWidth"] / 2,
                width: h["containerWidth"]
            }, settings.animation_speed, function () {
                $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(h["height"]).width(h["width"]);
                $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);
                if (isSet && v(pp_images[set_position]) == "image") {
                    $pp_pic_holder.find(".pp_hoverContainer").show()
                } else {
                    $pp_pic_holder.find(".pp_hoverContainer").hide()
                }
                if (h["resized"]) {
                    a("a.pp_expand,a.pp_contract").show()
                } else {
                    a("a.pp_expand").hide()
                }
                if (settings.autoplay_slideshow && !p && !i) a.prettyPhoto.startSlideshow();
                if (settings.deeplinking) c();
                settings.changepicturecallback();
                i = true
            });
            z()
        }
        e = jQuery.extend({
            animation_speed: "fast",
            player: "/jwplayer5_1/player.swf",
            player1: "/js/NonverBlaster.swf",
            slideshow: 5e3,
            autoplay_slideshow: false,
            opacity: .8,
            show_title: true,
            allow_resize: true,
            default_width: 600,
            default_height: 385,
            counter_separator_label: "/",
            theme: "pp_default",
            horizontal_padding: 20,
            hideflash: false,
            wmode: "opaque",
            autoplay: true,
            modal: false,
            deeplinking: true,
            overlay_gallery: true,
            keyboard_shortcuts: true,
            changepicturecallback: function () {},
            callback: function () {},
            ie6_fallback: true,
            markup: '<div class="pp_pic_holder"><div class="ppt"> </div><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content_container"><div class="pp_left"><div class="pp_right"><div class="pp_content"><div class="pp_loaderIcon"></div><div class="pp_fade"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details"><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0/0</p><a href="#" class="pp_arrow_next">Next</a></div><p class="pp_description"></p>{pp_social}<a class="pp_close" href="#">Close</a></div></div></div></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div><div class="pp_overlay"></div>',
            gallery_markup: '<div class="pp_gallery"><a href="#" class="pp_arrow_previous">Previous</a><div><ul>{gallery}</ul></div><a href="#" class="pp_arrow_next">Next</a></div>',
            image_markup: '<img id="fullResImage" src="{path}" />',
            flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
            nonver_markup: '<embed type="application/x-shockwave-flash" src="{player1}" wmode="transparent" flashvars="mediaURL={path}" width="{width}" height="{height}" allowfullscreen="true" allowscriptaccess="always" ></embed>',
            jw_markup: '<embed src="{player}" flashvars="file={path}" width="{width}" height="{height}" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" /></embed>',
            wmp_markup: '<object CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoStart" value="{autoStart}"><param name="type" value="application/x-mplayer2"><embed src="{path}" height="{height}" width="{width}" autoStart="{autoStart}" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed></object>',
            quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
            iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
            inline_markup: '<div class="pp_inline">{content}</div>',
            custom_markup: ""
        }, e);
        var f = this,
            g = false,
            h, i, j, k, l, m, n = a(window).height(),
            o = a(window).width(),
            p;
        doresize = true, scroll_pos = x();
        a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function () {
            w();
            y()
        });
        if (e.keyboard_shortcuts) {
            a(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function (b) {
                if (typeof $pp_pic_holder != "undefined") {
                    if ($pp_pic_holder.is(":visible")) {
                        switch (b.keyCode) {
                        case 37:
                            a.prettyPhoto.changePage("previous");
                            b.preventDefault();
                            break;
                        case 39:
                            a.prettyPhoto.changePage("next");
                            b.preventDefault();
                            break;
                        case 27:
                            if (!settings.modal) a.prettyPhoto.close();
                            b.preventDefault();
                            break
                        }
                    }
                }
            })
        }
        a.prettyPhoto.initialize = function () {
            settings = e;
            if (settings.theme == "pp_default") settings.horizontal_padding = 16;
            if (settings.ie6_fallback && a.browser.msie && parseInt(a.browser.version) == 6) settings.theme = "light_square";
            theRel = a(this).attr("rel");
            galleryRegExp = /\[(?:.*)\]/;
            isSet = galleryRegExp.exec(theRel) ? true : false;
            pp_images = isSet ? jQuery.map(f, function (b, c) {
                if (a(b).attr("rel").indexOf(theRel) != -1) return a(b).attr("href")
            }) : a.makeArray(a(this).attr("href"));
            pp_titles = isSet ? jQuery.map(f, function (b, c) {
                if (a(b).attr("rel").indexOf(theRel) != -1) return a(b).find("img").attr("alt") ? a(b).find("img").attr("alt") : ""
            }) : a.makeArray(a(this).find("img").attr("alt"));
            pp_descriptions = isSet ? jQuery.map(f, function (b, c) {
                if (a(b).attr("rel").indexOf(theRel) != -1) return a(b).attr("title") ? a(b).attr("title") : ""
            }) : a.makeArray(a(this).attr("title"));
            set_position = jQuery.inArray(a(this).attr("href"), pp_images);
            rel_index = isSet ? set_position : a("a[rel^='" + theRel + "']").index(a(this));
            A(this);
            if (settings.allow_resize) a(window).bind("scroll.prettyphoto", function () {
                w()
            });
            a.prettyPhoto.open();
            return false
        };
        a.prettyPhoto.open = function (b) {
            if (typeof settings == "undefined") {
                settings = e;
                if (a.browser.msie && a.browser.version == 6) settings.theme = "light_square";
                pp_images = a.makeArray(arguments[0]);
                pp_titles = arguments[1] ? a.makeArray(arguments[1]) : a.makeArray("");
                pp_descriptions = arguments[2] ? a.makeArray(arguments[2]) : a.makeArray("");
                isSet = pp_images.length > 1 ? true : false;
                set_position = 0;
                A(b.target)
            }
            if (a.browser.msie && a.browser.version == 6) a("select").css("visibility", "hidden");
            if (settings.hideflash) a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden");
            s(a(pp_images).size());
            a(".pp_loaderIcon").show();
            if ($ppt.is(":hidden")) $ppt.css("opacity", 0).show();
            $pp_overlay.show().fadeTo(settings.animation_speed, settings.opacity);
            $pp_pic_holder.find(".currentTextHolder").text(set_position + 1 + settings.counter_separator_label + a(pp_images).size());
            if (pp_descriptions[set_position] != "") {
                $pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))
            } else {
                $pp_pic_holder.find(".pp_description").hide()
            }
            movie_width = parseFloat(d("width", pp_images[set_position])) ? d("width", pp_images[set_position]) : settings.default_width.toString();
            movie_height = parseFloat(d("height", pp_images[set_position])) ? d("height", pp_images[set_position]) : settings.default_height.toString();
            g = false;
            if (movie_height.indexOf("%") != -1) {
                movie_height = parseFloat(a(window).height() * parseFloat(movie_height) / 100 - 150);
                g = true
            }
            if (movie_width.indexOf("%") != -1) {
                movie_width = parseFloat(a(window).width() * parseFloat(movie_width) / 100 - 150);
                g = true
            }
            $pp_pic_holder.fadeIn(function () {
                settings.show_title && pp_titles[set_position] != "" && typeof pp_titles[set_position] != "undefined" ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html(" ");
                imgPreloader = "";
                skipInjection = false;
                switch (v(pp_images[set_position])) {
                case "image":
                    imgPreloader = new Image;
                    nextImage = new Image;
                    if (isSet && set_position < a(pp_images).size() - 1) nextImage.src = pp_images[set_position + 1];
                    prevImage = new Image;
                    if (isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];
                    $pp_pic_holder.find("#pp_full_res")[0].innerHTML = settings.image_markup.replace(/{path}/g, pp_images[set_position]);
                    imgPreloader.onload = function () {
                        h = t(imgPreloader.width, imgPreloader.height);
                        q()
                    };
                    imgPreloader.onerror = function () {
                        alert("Image cannot be loaded. Make sure the path is correct and image exist.");
                        a.prettyPhoto.close()
                    };
                    imgPreloader.src = pp_images[set_position];
                    break;
                case "youtube":
                    h = t(movie_width, movie_height);
                    movie = "http://www.youtube.com/embed/" + d("v", pp_images[set_position]);
                    d("rel", pp_images[set_position]) ? movie += "?rel=" + d("rel", pp_images[set_position]) : movie += "?rel=1";
                    if (settings.autoplay) movie += "&autoplay=1";
                    toInject = settings.iframe_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie);
                    break;
                case "vimeo":
                    h = t(movie_width, movie_height);
                    movie_id = pp_images[set_position];
                    var b = /http:\/\/(www\.)?vimeo.com\/(\d+)/;
                    var c = movie_id.match(b);
                    movie = "http://player.vimeo.com/video/" + c[2] + "?title=0&byline=0&portrait=0";
                    if (settings.autoplay) movie += "&autoplay=1;";
                    vimeo_width = h["width"] + "/embed/?moog_width=" + h["width"];
                    toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, h["height"]).replace(/{path}/g, movie);
                    break;
                case "quicktime":
                    h = t(movie_width, movie_height);
                    h["height"] += 15;
                    h["contentHeight"] += 15;
                    h["containerHeight"] += 15;
                    toInject = settings.quicktime_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay);
                    break;
                case "flash":
                    h = t(movie_width, movie_height);
                    flash_vars = pp_images[set_position];
                    flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length);
                    filename = pp_images[set_position];
                    filename = filename.substring(0, filename.indexOf("?"));
                    toInject = settings.flash_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars);
                    break;
                case "wmp":
                    h = t(movie_width, movie_height);
                    h["height"] += 15;
                    h["contentHeight"] += 15;
                    h["containerHeight"] += 15;
                    toInject = settings.wmp_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay);
                    break;
                case "jw":
                    h = t(movie_width, movie_height);
                    flash_vars = pp_images[set_position];
                    flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length);
                    filename = pp_images[set_position];
                    filename = filename.substring(0, filename.indexOf("?"));
                    toInject = settings.jw_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{player}/g, settings.player).replace(/{path}/g, filename + "?" + flash_vars);
                    break;
                case "nonver":
                    h = t(movie_width, movie_height);
                    flash_vars = pp_images[set_position];
                    flash_vars = flash_vars.substring(pp_images[set_position].indexOf("flashvars") + 10, pp_images[set_position].length);
                    filename = pp_images[set_position];
                    filename = filename.substring(0, filename.indexOf("?"));
                    toInject = settings.nonver_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{wmode}/g, settings.wmode).replace(/{player1}/g, settings.player1).replace(/{path}/g, filename + "?" + flash_vars);
                    break;
                case "iframe":
                    h = t(movie_width, movie_height);
                    frame_url = pp_images[set_position];
                    frame_url = frame_url.substr(0, frame_url.indexOf("iframe") - 1);
                    toInject = settings.iframe_markup.replace(/{width}/g, h["width"]).replace(/{height}/g, h["height"]).replace(/{path}/g, frame_url);
                    break;
                case "ajax":
                    doresize = false;
                    h = t(movie_width, movie_height);
                    doresize = true;
                    skipInjection = true;
                    a.get(pp_images[set_position], function (a) {
                        toInject = settings.inline_markup.replace(/{content}/g, a);
                        $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject;
                        q()
                    });
                    break;
                case "custom":
                    h = t(movie_width, movie_height);
                    toInject = settings.custom_markup;
                    break;
                case "inline":
                    myClone = a(pp_images[set_position]).clone().append('<br clear="all" />').css({
                        width: settings.default_width
                    }).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(a("body")).show();
                    doresize = false;
                    h = t(a(myClone).width(), a(myClone).height());
                    doresize = true;
                    a(myClone).remove();
                    toInject = settings.inline_markup.replace(/{content}/g, a(pp_images[set_position]).html());
                    break
                }
                if (!imgPreloader && !skipInjection) {
                    $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject;
                    q()
                }
            });
            return false
        };
        a.prettyPhoto.changePage = function (b) {
            currentGalleryPage = 0;
            if (b == "previous") {
                set_position--;
                if (set_position < 0) set_position = a(pp_images).size() - 1
            } else if (b == "next") {
                set_position++;
                if (set_position > a(pp_images).size() - 1) set_position = 0
            } else {
                set_position = b
            }
            rel_index = set_position;
            if (!doresize) doresize = true;
            a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");
            r(function () {
                a.prettyPhoto.open()
            })
        };
        a.prettyPhoto.changeGalleryPage = function (a) {
            if (a == "next") {
                currentGalleryPage++;
                if (currentGalleryPage > totalPage) currentGalleryPage = 0
            } else if (a == "previous") {
                currentGalleryPage--;
                if (currentGalleryPage < 0) currentGalleryPage = totalPage
            } else {
                currentGalleryPage = a
            }
            slide_speed = a == "next" || a == "previous" ? settings.animation_speed : 0;
            slide_to = currentGalleryPage * itemsPerPage * itemWidth;
            $pp_gallery.find("ul").animate({
                left: -slide_to
            }, slide_speed)
        };
        a.prettyPhoto.startSlideshow = function () {
            if (typeof p == "undefined") {
                $pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function () {
                    a.prettyPhoto.stopSlideshow();
                    return false
                });
                p = setInterval(a.prettyPhoto.startSlideshow, settings.slideshow)
            } else {
                a.prettyPhoto.changePage("next")
            }
        };
        a.prettyPhoto.stopSlideshow = function () {
            $pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function () {
                a.prettyPhoto.startSlideshow();
                return false
            });
            clearInterval(p);
            p = undefined
        };
        a.prettyPhoto.close = function () {
            if ($pp_overlay.is(":animated")) return;
            a.prettyPhoto.stopSlideshow();
            $pp_pic_holder.stop().find("object,embed").css("visibility", "hidden");
            a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed, function () {
                a(this).remove()
            });
            $pp_overlay.fadeOut(settings.animation_speed, function () {
                if (a.browser.msie && a.browser.version == 6) a("select").css("visibility", "visible");
                if (settings.hideflash) a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible");
                a(this).remove();
                a(window).unbind("scroll.prettyphoto");
                settings.callback();
                doresize = true;
                i = false;
                delete settings
            })
        };
        if (!pp_alreadyInitialized && b()) {
            pp_alreadyInitialized = true;
            hashIndex = b();
            hashRel = hashIndex;
            hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1);
            hashRel = hashRel.substring(0, hashRel.indexOf("/"));
            setTimeout(function () {
                a("a[rel^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click")
            }, 50)
        }
        return this.unbind("click.prettyphoto").bind("click.prettyphoto", a.prettyPhoto.initialize)
    };
})(jQuery);
var pp_alreadyInitialized = false;
$(document).ready(function () {
    $("a[rel^='prettyPhoto']").prettyPhoto({
        theme: "facebook",
        slideshow: false,
        deeplinking: false,
        overlay_gallery: false
    })
});
(function (a) {
    a.fn.quovolver = function (b, c) {
        if (!b) b = 500;
        if (!c) c = 9e3;
        var d = b * 4;
        if (d > c) c = d;
        var e = a(this),
            f = a(this).filter(":first"),
            g = a(this).filter(":last"),
            h = '<div id="quote_wrap"></div>';
        a(this).wrapAll(h);
        a(this).hide();
        a(f).show();
        a(this).parent().css({
            height: a(f).height()
        });
        setInterval(function () {
            if (a(g).is(":visible")) {
                var c = a(f);
                var d = a(c).height()
            } else {
                var c = a(e).filter(":visible").next();
                var d = a(c).height()
            }
            a(e).filter(":visible").fadeOut(b);
            setTimeout(function () {
                a(e).parent().animate({
                    height: d
                }, b)
            }, b);
            if (a(g).is(":visible")) {
                setTimeout(function () {
                    a(f).fadeIn(b * 2)
                }, b * 2)
            } else {
                setTimeout(function () {
                    a(c).fadeIn(b)
                }, b * 2)
            }
        }, c)
    }
})(jQuery);
$(document).ready(function () {
    $("blockquote").quovolver()
});
(function (a) {
    var b = {
        vertical: !1,
        rtl: !1,
        start: 1,
        offset: 1,
        size: null,
        scroll: 3,
        visible: null,
        animation: "normal",
        easing: "swing",
        auto: 0,
        wrap: null,
        initCallback: null,
        setupCallback: null,
        reloadCallback: null,
        itemLoadCallback: null,
        itemFirstInCallback: null,
        itemFirstOutCallback: null,
        itemLastInCallback: null,
        itemLastOutCallback: null,
        itemVisibleInCallback: null,
        itemVisibleOutCallback: null,
        animationStepCallback: null,
        buttonNextHTML: "<div></div>",
        buttonPrevHTML: "<div></div>",
        buttonNextEvent: "click",
        buttonPrevEvent: "click",
        buttonNextCallback: null,
        buttonPrevCallback: null,
        itemFallbackDimension: null
    },
        c = !1;
    a(window).bind("load.jcarousel", function () {
        c = !0
    });
    a.jcarousel = function (d, e) {
        this.options = a.extend({}, b, e || {});
        this.autoStopped = this.locked = !1;
        this.buttonPrevState = this.buttonNextState = this.buttonPrev = this.buttonNext = this.list = this.clip = this.container = null;
        if (!e || e.rtl === void 0) this.options.rtl = (a(d).attr("dir") || a("html").attr("dir") || "").toLowerCase() == "rtl";
        this.wh = !this.options.vertical ? "width" : "height";
        this.lt = !this.options.vertical ? this.options.rtl ? "right" : "left" : "top";
        for (var f = "", h = d.className.split(" "), i = 0; i < h.length; i++) if (h[i].indexOf("jcarousel-skin") != -1) {
            a(d).removeClass(h[i]);
            f = h[i];
            break
        }
        d.nodeName.toUpperCase() == "UL" || d.nodeName.toUpperCase() == "OL" ? (this.list = a(d), this.clip = this.list.parents(".jcarousel-clip"), this.container = this.list.parents(".jcarousel-container")) : (this.container = a(d), this.list = this.container.find("ul,ol").eq(0), this.clip = this.container.find(".jcarousel-clip"));
        if (this.clip.size() === 0) this.clip = this.list.wrap("<div></div>").parent();
        if (this.container.size() === 0) this.container = this.clip.wrap("<div></div>").parent();
        f !== "" && this.container.parent()[0].className.indexOf("jcarousel-skin") == -1 && this.container.wrap('<div class=" ' + f + '"></div>');
        this.buttonPrev = a(".jcarousel-prev", this.container);
        if (this.buttonPrev.size() === 0 && this.options.buttonPrevHTML !== null) this.buttonPrev = a(this.options.buttonPrevHTML).appendTo(this.container);
        this.buttonPrev.addClass(this.className("jcarousel-prev"));
        this.buttonNext = a(".jcarousel-next", this.container);
        if (this.buttonNext.size() === 0 && this.options.buttonNextHTML !== null) this.buttonNext = a(this.options.buttonNextHTML).appendTo(this.container);
        this.buttonNext.addClass(this.className("jcarousel-next"));
        this.clip.addClass(this.className("jcarousel-clip")).css({
            position: "relative"
        });
        this.list.addClass(this.className("jcarousel-list")).css({
            overflow: "hidden",
            position: "relative",
            top: 0,
            margin: 0,
            padding: 0
        }).css(this.options.rtl ? "right" : "left", 0);
        this.container.addClass(this.className("jcarousel-container")).css({
            position: "relative"
        });
        !this.options.vertical && this.options.rtl && this.container.addClass("jcarousel-direction-rtl").attr("dir", "rtl");
        var j = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null,
            f = this.list.children("li"),
            k = this;
        if (f.size() > 0) {
            var l = 0,
                n = this.options.offset;
            f.each(function () {
                k.format(this, n++);
                l += k.dimension(this, j)
            });
            this.list.css(this.wh, l + 100 + "px");
            if (!e || e.size === void 0) this.options.size = f.size()
        }
        this.container.css("display", "block");
        this.buttonNext.css("display", "block");
        this.buttonPrev.css("display", "block");
        this.funcNext = function () {
            k.next()
        };
        this.funcPrev = function () {
            k.prev()
        };
        this.funcResize = function () {
            k.resizeTimer && clearTimeout(k.resizeTimer);
            k.resizeTimer = setTimeout(function () {
                k.reload()
            }, 100)
        };
        this.options.initCallback !== null && this.options.initCallback(this, "init");
        !c && a.browser.safari ? (this.buttons(!1, !1), a(window).bind("load.jcarousel", function () {
            k.setup()
        })) : this.setup()
    };
    var d = a.jcarousel;
    d.fn = d.prototype = {
        jcarousel: "0.2.8"
    };
    d.fn.extend = d.extend = a.extend;
    d.fn.extend({
        setup: function () {
            this.prevLast = this.prevFirst = this.last = this.first = null;
            this.animating = !1;
            this.tail = this.resizeTimer = this.timer = null;
            this.inTail = !1;
            if (!this.locked) {
                this.list.css(this.lt, this.pos(this.options.offset) + "px");
                var b = this.pos(this.options.start, !0);
                this.prevFirst = this.prevLast = null;
                this.animate(b, !1);
                a(window).unbind("resize.jcarousel", this.funcResize).bind("resize.jcarousel", this.funcResize);
                this.options.setupCallback !== null && this.options.setupCallback(this)
            }
        },
        reset: function () {
            this.list.empty();
            this.list.css(this.lt, "0px");
            this.list.css(this.wh, "10px");
            this.options.initCallback !== null && this.options.initCallback(this, "reset");
            this.setup()
        },
        reload: function () {
            this.tail !== null && this.inTail && this.list.css(this.lt, d.intval(this.list.css(this.lt)) + this.tail);
            this.tail = null;
            this.inTail = !1;
            this.options.reloadCallback !== null && this.options.reloadCallback(this);
            if (this.options.visible !== null) {
                var a = this,
                    b = Math.ceil(this.clipping() / this.options.visible),
                    c = 0,
                    e = 0;
                this.list.children("li").each(function (d) {
                    c += a.dimension(this, b);
                    d + 1 < a.first && (e = c)
                });
                this.list.css(this.wh, c + "px");
                this.list.css(this.lt, -e + "px")
            }
            this.scroll(this.first, !1)
        },
        lock: function () {
            this.locked = !0;
            this.buttons()
        },
        unlock: function () {
            this.locked = !1;
            this.buttons()
        },
        size: function (a) {
            if (a !== void 0) this.options.size = a, this.locked || this.buttons();
            return this.options.size
        },
        has: function (a, b) {
            if (b === void 0 || !b) b = a;
            if (this.options.size !== null && b > this.options.size) b = this.options.size;
            for (var c = a; c <= b; c++) {
                var d = this.get(c);
                if (!d.length || d.hasClass("jcarousel-item-placeholder")) return !1
            }
            return !0
        },
        get: function (b) {
            return a(">.jcarousel-item-" + b, this.list)
        },
        add: function (b, c) {
            var e = this.get(b),
                h = 0,
                i = a(c);
            if (e.length === 0) for (var j, k = d.intval(b), e = this.create(b);;) {
                if (j = this.get(--k), k <= 0 || j.length) {
                    k <= 0 ? this.list.prepend(e) : j.after(e);
                    break
                }
            } else h = this.dimension(e);
            i.get(0).nodeName.toUpperCase() == "LI" ? (e.replaceWith(i), e = i) : e.empty().append(c);
            this.format(e.removeClass(this.className("jcarousel-item-placeholder")), b);
            i = this.options.visible !== null ? Math.ceil(this.clipping() / this.options.visible) : null;
            h = this.dimension(e, i) - h;
            b > 0 && b < this.first && this.list.css(this.lt, d.intval(this.list.css(this.lt)) - h + "px");
            this.list.css(this.wh, d.intval(this.list.css(this.wh)) + h + "px");
            return e
        },
        remove: function (a) {
            var b = this.get(a);
            if (b.length && !(a >= this.first && a <= this.last)) {
                var c = this.dimension(b);
                a < this.first && this.list.css(this.lt, d.intval(this.list.css(this.lt)) + c + "px");
                b.remove();
                this.list.css(this.wh, d.intval(this.list.css(this.wh)) - c + "px")
            }
        },
        next: function () {
            this.tail !== null && !this.inTail ? this.scrollTail(!1) : this.scroll((this.options.wrap == "both" || this.options.wrap == "last") && this.options.size !== null && this.last == this.options.size ? 1 : this.first + this.options.scroll)
        },
        prev: function () {
            this.tail !== null && this.inTail ? this.scrollTail(!0) : this.scroll((this.options.wrap == "both" || this.options.wrap == "first") && this.options.size !== null && this.first == 1 ? this.options.size : this.first - this.options.scroll)
        },
        scrollTail: function (a) {
            if (!this.locked && !this.animating && this.tail) {
                this.pauseAuto();
                var b = d.intval(this.list.css(this.lt)),
                    b = !a ? b - this.tail : b + this.tail;
                this.inTail = !a;
                this.prevFirst = this.first;
                this.prevLast = this.last;
                this.animate(b)
            }
        },
        scroll: function (a, b) {
            !this.locked && !this.animating && (this.pauseAuto(), this.animate(this.pos(a), b))
        },
        pos: function (a, b) {
            var c = d.intval(this.list.css(this.lt));
            if (this.locked || this.animating) return c;
            this.options.wrap != "circular" && (a = a < 1 ? 1 : this.options.size && a > this.options.size ? this.options.size : a);
            for (var e = this.first > a, g = this.options.wrap != "circular" && this.first <= 1 ? 1 : this.first, h = e ? this.get(g) : this.get(this.last), i = e ? g : g - 1, j = null, k = 0, l = !1, m = 0; e ? --i >= a : ++i < a;) {
                j = this.get(i);
                l = !j.length;
                if (j.length === 0 && (j = this.create(i).addClass(this.className("jcarousel-item-placeholder")), h[e ? "before" : "after"](j), this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (i <= 0 || i > this.options.size))) h = this.get(this.index(i)), h.length && (j = this.add(i, h.clone(!0)));
                h = j;
                m = this.dimension(j);
                l && (k += m);
                if (this.first !== null && (this.options.wrap == "circular" || i >= 1 && (this.options.size === null || i <= this.options.size))) c = e ? c + m : c - m
            }
            for (var g = this.clipping(), n = [], o = 0, p = 0, h = this.get(a - 1), i = a; ++o;) {
                j = this.get(i);
                l = !j.length;
                if (j.length === 0) {
                    j = this.create(i).addClass(this.className("jcarousel-item-placeholder"));
                    if (h.length === 0) this.list.prepend(j);
                    else h[e ? "before" : "after"](j);
                    if (this.first !== null && this.options.wrap == "circular" && this.options.size !== null && (i <= 0 || i > this.options.size)) h = this.get(this.index(i)), h.length && (j = this.add(i, h.clone(!0)))
                }
                h = j;
                m = this.dimension(j);
                if (m === 0) throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");
                this.options.wrap != "circular" && this.options.size !== null && i > this.options.size ? n.push(j) : l && (k += m);
                p += m;
                if (p >= g) break;
                i++
            }
            for (j = 0; j < n.length; j++) n[j].remove();
            k > 0 && (this.list.css(this.wh, this.dimension(this.list) + k + "px"), e && (c -= k, this.list.css(this.lt, d.intval(this.list.css(this.lt)) - k + "px")));
            k = a + o - 1;
            if (this.options.wrap != "circular" && this.options.size && k > this.options.size) k = this.options.size;
            if (i > k) {
                o = 0;
                i = k;
                for (p = 0; ++o;) {
                    j = this.get(i--);
                    if (!j.length) break;
                    p += this.dimension(j);
                    if (p >= g) break
                }
            }
            i = k - o + 1;
            this.options.wrap != "circular" && i < 1 && (i = 1);
            if (this.inTail && e) c += this.tail, this.inTail = !1;
            this.tail = null;
            if (this.options.wrap != "circular" && k == this.options.size && k - o + 1 >= 1 && (e = d.intval(this.get(k).css(!this.options.vertical ? "marginRight" : "marginBottom")), p - e > g)) this.tail = p - g - e;
            if (b && a === this.options.size && this.tail) c -= this.tail, this.inTail = !0;
            for (; ai;) c += this.dimension(this.get(a));
            this.prevFirst = this.first;
            this.prevLast = this.last;
            this.first = i;
            this.last = k;
            return c
        },
        animate: function (b, c) {
            if (!this.locked && !this.animating) {
                this.animating = !0;
                var d = this,
                    e = function () {
                        d.animating = !1;
                        b === 0 && d.list.css(d.lt, 0);
                        !d.autoStopped && (d.options.wrap == "circular" || d.options.wrap == "both" || d.options.wrap == "last" || d.options.size === null || d.last < d.options.size || d.last == d.options.size && d.tail !== null && !d.inTail) && d.startAuto();
                        d.buttons();
                        d.notify("onAfterAnimation");
                        if (d.options.wrap == "circular" && d.options.size !== null) for (var a = d.prevFirst; a <= d.prevLast; a++) a !== null && !(a >= d.first && a <= d.last) && (a < 1 || a > d.options.size) && d.remove(a)
                    };
                this.notify("onBeforeAnimation");
                if (!this.options.animation || c === !1) this.list.css(this.lt, b + "px"), e();
                else {
                    var f = !this.options.vertical ? this.options.rtl ? {
                        right: b
                    } : {
                        left: b
                    } : {
                        top: b
                    },
                        e = {
                            duration: this.options.animation,
                            easing: this.options.easing,
                            complete: e
                        };
                    if (a.isFunction(this.options.animationStepCallback)) e.step = this.options.animationStepCallback;
                    this.list.animate(f, e)
                }
            }
        },
        startAuto: function (a) {
            if (a !== void 0) this.options.auto = a;
            if (this.options.auto === 0) return this.stopAuto();
            if (this.timer === null) {
                this.autoStopped = !1;
                var b = this;
                this.timer = window.setTimeout(function () {
                    b.next()
                }, this.options.auto * 1e3)
            }
        },
        stopAuto: function () {
            this.pauseAuto();
            this.autoStopped = !0
        },
        pauseAuto: function () {
            if (this.timer !== null) window.clearTimeout(this.timer), this.timer = null
        },
        buttons: function (a, b) {
            if (a == null && (a = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "first" || this.options.size === null || this.last < this.options.size), !this.locked && (!this.options.wrap || this.options.wrap == "first") && this.options.size !== null && this.last >= this.options.size)) a = this.tail !== null && !this.inTail;
            if (b == null && (b = !this.locked && this.options.size !== 0 && (this.options.wrap && this.options.wrap != "last" || this.first > 1), !this.locked && (!this.options.wrap || this.options.wrap == "last") && this.options.size !== null && this.first == 1)) b = this.tail !== null && this.inTail;
            var c = this;
            this.buttonNext.size() > 0 ? (this.buttonNext.unbind(this.options.buttonNextEvent + ".jcarousel", this.funcNext), a && this.buttonNext.bind(this.options.buttonNextEvent + ".jcarousel", this.funcNext), this.buttonNext[a ? "removeClass" : "addClass"](this.className("jcarousel-next-disabled")).attr("disabled", a ? !1 : !0), this.options.buttonNextCallback !== null && this.buttonNext.data("jcarouselstate") != a && this.buttonNext.each(function () {
                c.options.buttonNextCallback(c, this, a)
            }).data("jcarouselstate", a)) : this.options.buttonNextCallback !== null && this.buttonNextState != a && this.options.buttonNextCallback(c, null, a);
            this.buttonPrev.size() > 0 ? (this.buttonPrev.unbind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev), b && this.buttonPrev.bind(this.options.buttonPrevEvent + ".jcarousel", this.funcPrev), this.buttonPrev[b ? "removeClass" : "addClass"](this.className("jcarousel-prev-disabled")).attr("disabled", b ? !1 : !0), this.options.buttonPrevCallback !== null && this.buttonPrev.data("jcarouselstate") != b && this.buttonPrev.each(function () {
                c.options.buttonPrevCallback(c, this, b)
            }).data("jcarouselstate", b)) : this.options.buttonPrevCallback !== null && this.buttonPrevState != b && this.options.buttonPrevCallback(c, null, b);
            this.buttonNextState = a;
            this.buttonPrevState = b
        },
        notify: function (a) {
            var b = this.prevFirst === null ? "init" : this.prevFirst < this.first ? "next" : "prev";
            this.callback("itemLoadCallback", a, b);
            this.prevFirst !== this.first && (this.callback("itemFirstInCallback", a, b, this.first), this.callback("itemFirstOutCallback", a, b, this.prevFirst));
            this.prevLast !== this.last && (this.callback("itemLastInCallback", a, b, this.last), this.callback("itemLastOutCallback", a, b, this.prevLast));
            this.callback("itemVisibleInCallback", a, b, this.first, this.last, this.prevFirst, this.prevLast);
            this.callback("itemVisibleOutCallback", a, b, this.prevFirst, this.prevLast, this.first, this.last)
        },
        callback: function (b, c, d, e, f, h, i) {
            if (!(this.options[b] == null || typeof this.options[b] != "object" && c != "onAfterAnimation")) {
                var j = typeof this.options[b] == "object" ? this.options[b][c] : this.options[b];
                if (a.isFunction(j)) {
                    var k = this;
                    if (e === void 0) j(k, d, c);
                    else if (f === void 0) this.get(e).each(function () {
                        j(k, this, e, d, c)
                    });
                    else for (var b = function (a) {
                            k.get(a).each(function () {
                                j(k, this, a, d, c)
                            })
                        }, l = e; l <= f; l++) l !== null && !(l >= h && l <= i) && b(l)
                }
            }
        },
        create: function (a) {
            return this.format("<li></li>", a)
        },
        format: function (b, c) {
            for (var b = a(b), d = b.get(0).className.split(" "), e = 0; e < d.length; e++) d[e].indexOf("jcarousel-") != -1 && b.removeClass(d[e]);
            b.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-" + c)).css({
                "float": this.options.rtl ? "right" : "left",
                "list-style": "none"
            }).attr("jcarouselindex", c);
            return b
        },
        className: function (a) {
            return a + " " + a + (!this.options.vertical ? "-horizontal" : "-vertical")
        },
        dimension: function (b, c) {
            var e = a(b);
            if (c == null) return !this.options.vertical ? e.outerWidth(!0) || d.intval(this.options.itemFallbackDimension) : e.outerHeight(!0) || d.intval(this.options.itemFallbackDimension);
            else {
                var h = !this.options.vertical ? c - d.intval(e.css("marginLeft")) - d.intval(e.css("marginRight")) : c - d.intval(e.css("marginTop")) - d.intval(e.css("marginBottom"));
                a(e).css(this.wh, h + "px");
                return this.dimension(e)
            }
        },
        clipping: function () {
            return !this.options.vertical ? this.clip[0].offsetWidth - d.intval(this.clip.css("borderLeftWidth")) - d.intval(this.clip.css("borderRightWidth")) : this.clip[0].offsetHeight - d.intval(this.clip.css("borderTopWidth")) - d.intval(this.clip.css("borderBottomWidth"))
        },
        index: function (a, b) {
            if (b == null) b = this.options.size;
            return Math.round(((a - 1) / b - Math.floor((a - 1) / b)) * b) + 1
        }
    });
    d.extend({
        defaults: function (c) {
            return a.extend(b, c || {})
        },
        intval: function (a) {
            a = parseInt(a, 10);
            return isNaN(a) ? 0 : a
        },
        windowLoaded: function () {
            c = !0
        }
    });
    a.fn.jcarousel = function (b) {
        if (typeof b == "string") {
            var c = a(this).data("jcarousel"),
                e = Array.prototype.slice.call(arguments, 1);
            return c[b].apply(c, e)
        } else return this.each(function () {
            var c = a(this).data("jcarousel");
            c ? (b && a.extend(c.options, b), c.reload()) : a(this).data("jcarousel", new d(this, b))
        })
    }
})(jQuery);
jQuery(document).ready(function () {
    jQuery("#mycarousel ").jcarousel({
        wrap: "circular"
    })
});
(function (a) {
    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 () {})
    }

    function c(b, c) {
        var d = a(c);
        return d.length < 2 ? d : b.parent().find(c)
    }

    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)
    }
    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
        }
    };
    var d;
    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) {
    function d(c, d, e) {
        var f = this,
            g = c.add(this),
            h = c.find(e.tabs),
            i = d.jquery ? d : c.children(d),
            j;
        h.length || (h = c.children()), i.length || (i = c.parent().find(d)), i.length || (i = a(d)), a.extend(this, {
            click: function (c, d) {
                var i = h.eq(c);
                typeof c == "string" && c.replace("#", "") && (i = h.filter("[href*=" + c.replace("#", "") + "]"), c = Math.max(h.index(i), 0));
                if (e.rotate) {
                    var k = h.length - 1;
                    if (c < 0) return f.click(k, d);
                    if (c > k) return f.click(0, d)
                }
                if (!i.length) {
                    if (j >= 0) return f;
                    c = e.initialIndex, i = h.eq(c)
                }
                if (c === j) return f;
                d = d || a.Event(), d.type = "onBeforeClick", g.trigger(d, [c]);
                if (!d.isDefaultPrevented()) {
                    b[e.effect].call(f, c, function () {
                        d.type = "onClick", g.trigger(d, [c])
                    }), j = c, h.removeClass(e.current), i.addClass(e.current);
                    return f
                }
            },
            getConf: function () {
                return e
            },
            getTabs: function () {
                return h
            },
            getPanes: function () {
                return i
            },
            getCurrentPane: function () {
                return i.eq(j)
            },
            getCurrentTab: function () {
                return h.eq(j)
            },
            getIndex: function () {
                return j
            },
            next: function () {
                return f.click(j + 1)
            },
            prev: function () {
                return f.click(j - 1)
            },
            destroy: function () {
                h.unbind(e.event).removeClass(e.current), i.find("a[href^=#]").unbind("click.T");
                return f
            }
        }), a.each("onBeforeClick,onClick".split(","), 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
            }
        }), e.history && a.fn.history && (a.tools.history.init(h), e.event = "history"), h.each(function (b) {
            a(this).bind(e.event, function (a) {
                f.click(b, a);
                return a.preventDefault()
            })
        }), i.find("a[href^=#]").bind("click.T", function (b) {
            f.click(a(this).attr("href"), b)
        }), location.hash && e.tabs == "a" && c.find("[href=" + location.hash + "]").length ? f.click(location.hash) : (e.initialIndex === 0 || e.initialIndex > 0) && f.click(e.initialIndex)
    }
    a.tools = a.tools || {
        version: "v1.2.5"
    }, a.tools.tabs = {
        conf: {
            tabs: "a",
            current: "current",
            onBeforeClick: null,
            onClick: null,
            effect: "default",
            initialIndex: 0,
            event: "click",
            rotate: !1,
            history: !1
        },
        addEffect: function (a, c) {
            b[a] = c
        }
    };
    var b = {
        "default": function (a, b) {
            this.getPanes().hide().eq(a).show(), b.call()
        },
        fade: function (a, b) {
            var c = this.getConf(),
                d = c.fadeOutSpeed,
                e = this.getPanes();
            d ? e.fadeOut(d) : e.hide(), e.eq(a).fadeIn(c.fadeInSpeed, b)
        },
        slide: function (a, b) {
            this.getPanes().slideUp(200), this.getPanes().eq(a).slideDown(400, b)
        },
        ajax: function (a, b) {
            this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"), b)
        }
    },
        c;
    a.tools.tabs.addEffect("horizontal", function (b, d) {
        c || (c = this.getPanes().eq(0).width()), this.getCurrentPane().animate({
            width: 0
        }, function () {
            a(this).hide()
        }), this.getPanes().eq(b).animate({
            width: c
        }, function () {
            a(this).show(), d.call()
        })
    });
    a.fn.tabs = function (b, c) {
        var e = this.data("tabs");
        e && (e.destroy(), this.removeData("tabs")), a.isFunction(c) && (c = {
            onBeforeClick: c
        }), c = a.extend({}, a.tools.tabs.conf, c), this.each(function () {
            e = new d(a(this), b, c), a(this).data("tabs", e)
        });
        return c.api ? e : this
    }
})(jQuery);
$(document).ready(function () {
    $("form#contact_form").submit(function () {
        $("form#contact_form .error").remove();
        var a = false;
        $(".requiredField").each(function () {
            if (jQuery.trim($(this).val()) == "") {
                var b = $(this).prev("label").text();
                $(this).parent().append('<span class="error">Unesite ' + b + "</span>");
                $(this).addClass("inputError");
                a = true
            } else if ($(this).hasClass("email")) {
                var c = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
                if (!c.test(jQuery.trim($(this).val()))) {
                    var b = $(this).prev("label").text();
                    $(this).parent().append('<span class="error">Nije valjana ' + b + "</span>");
                    $(this).addClass("inputError");
                    a = true
                }
            }
        });
        if (!a) {
            $("form#contact_form input.submit").fadeOut("normal", function () {
                $(this).parent().append("")
            });
            var b = $(this).serialize();
            $.post($(this).attr("action"), b, function (a) {
                $("form#contact_form").slideUp("fast", function () {
                    $(this).before('<p class="success">Hvala!<br/>Vaša poruka je uspješno poslana.<br/>Uskoro ćemo Vam se javiti...</p>')
                })
            })
        }
        return false
    })
});
typeof getTwitters != "function" &&
function () {
    var a = {},
        b = 0;
    !
    function (a, b) {
        function c(a) {
            m = 1;
            while (a = d.shift()) a()
        }
        var d = [],
            e, f, g = !1,
            h = b.documentElement,
            i = h.doScroll,
            j = "DOMContentLoaded",
            k = "addEventListener",
            l = "onreadystatechange",
            m = /^loade|c/.test(b.readyState);
        b[k] && b[k](j, f = function () {
            b.removeEventListener(j, f, g), c()
        }, g), i && b.attachEvent(l, e = function () {
            /^c/.test(b.readyState) && (b.detachEvent(l, e), c())
        }), a.domReady = i ?
        function (b) {
            self != top ? m ? b() : d.push(b) : function () {
                try {
                    h.doScroll("left")
                } catch (c) {
                    return setTimeout(function () {
                        a.domReady(b)
                    }, 50)
                }
                b()
            }()
        } : function (a) {
            m ? a() : d.push(a)
        }
    }(a, document), window.getTwitters = function (c, d, e, f) {
        b++, typeof d == "object" && (f = d, d = f.id, e = f.count), e || (e = 1), f ? f.count = e : f = {}, !f.timeout && typeof f.onTimeout == "function" && (f.timeout = 10), typeof f.clearContents == "undefined" && (f.clearContents = !0), f.twitterTarget = c, typeof f.enableLinks == "undefined" && (f.enableLinks = !0), a.domReady(function (a, b) {
            return function () {
                function f(b) {
                    var c = a.enableLinks ? twitterlib.ify.clean(twitterlib.expandLinks(b)) : twitterlib.expandLinks(b),
                        d = "<li>";
                    a.prefix && (d += '<li><span className="twitterPrefix">', d += a.prefix.replace(/%(.*?)%/g, function (a, c) {
                        return b.user[c]
                    }), d += " </span></li>"), d += '<span className="twitterStatus">' + twitterlib.time.relative(b.created_at) + "</span> ", d += '<span className="twitterTime">' + b.text + "</span>", a.newwindow && (d = d.replace(/<a href/gi, '<a target="_blank" href'));
                    return d
                }

                function c() {
                    a.target = document.getElementById(a.twitterTarget);
                    if ( !! a.target) {
                        var c = {
                            limit: e
                        };
                        c.includeRT && (c.include_rts = !0), a.timeout && (window["twitterTimeout" + b] = setTimeout(function () {
                            twitterlib.cancel(), a.onTimeout.call(a.target)
                        }, a.timeout * 1e3));
                        var g = "timeline";
                        d.indexOf("#") === 0 && (g = "search"), d.indexOf("/") !== -1 && (g = "list"), a.ignoreReplies && (c.filter = {
                            not: new RegExp(/^@/)
                        }), twitterlib.cache(!0), twitterlib[g](d, c, function (c, d) {
                            clearTimeout(window["twitterTimeout" + b]);
                            var e = [],
                                g = c.length > a.count ? a.count : c.length;
                            e = ["<ul>"];
                            for (var h = 0; h < g; h++) {
                                c[h].time = twitterlib.time.relative(c[h].created_at);
                                for (var i in c[h].user) c[h]["user_" + i] = c[h].user[i];
                                a.template ? e.push("<li>" + a.template.replace(/%([a-z_\-\.]*)%/ig, function (b, d) {
                                    var e = c[h][d] + "" || "";
                                    d == "text" && (e = twitterlib.expandLinks(c[h])), d == "text" && a.enableLinks && (e = twitterlib.ify.clean(e));
                                    return e
                                }) + "</li>") : a.bigTemplate ? e.push(twitterlib.render(c[h])) : e.push(f(c[h]))
                            }
                            e.push("</ul>"), a.clearContents ? a.target.innerHTML = e.join("") : a.target.innerHTML += e.join(""), a.callback && a.callback(c)
                        })
                    }
                }
                typeof twitterlib == "undefined" ? setTimeout(function () {
                    var a = document.createElement("script");
                    a.onload = a.onreadystatechange = function () {
                        typeof window.twitterlib != "undefined" && c()
                    }, a.src = "http://remy.github.com/twitterlib/twitterlib.js";
                    var b = document.head || document.getElementsByTagName("head")[0];
                    b.insertBefore(a, b.firstChild)
                }, 0) : c()
            }
        }(f, b))
    }
}()




/* Form Send */
function submitform(){
    document.forms['commentform'].submit();
	return false;
};



/* Contact Form */
function checkemail(emailaddress){
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailaddress);
}

jQuery(document).ready(function(){ 
	jQuery('#contactform a#formsend').click(function(){
		var $name 	= jQuery('#name').val();
		var $email 	= jQuery('#email').val();
		var $subject = jQuery('#subject').val();
		var $url = jQuery('#url').val();
		var $message = jQuery('#message').val();
		var $contactemail = jQuery('#contactemail').val();
		var $contacturl = jQuery('#contacturl').val();
		var $mywebsite = jQuery('#contactwebsite').val();
		
		if ($name != '' && $name.length < 3){ $nameshort = true; } else { $nameshort = false; }
		if ($name != '' && $name.length > 30){ $namelong = true; } else { $namelong = false; }
		if ($email != '' && checkemail($email)){ $emailerror = true; } else { $emailerror = false; }
		if ($subject != '' && $subject.length < 3){ $subjectshort = true; } else { $subjectshort = false; }
		if ($subject != '' && $subject.length > 100){ $subjectlong = true; } else { $subjectlong = false; }
		if ($url == ''){ $url = 'none'; }
		if ($message != '' && $message.length < 3){ $messageshort = true; } else { $messageshort = false; }
		
		jQuery('#contactform .loading').animate({opacity: 1}, 250);
		
		if ($name != '' && $nameshort != true && $namelong != true && $email != '' && $emailerror != false && $subject != '' && $subjectshort != true && $subjectlong != true && $message != '' && $messageshort != true && $contactemail != '' && $contacturl != '' && $mywebsite != ''){
			jQuery.post($contacturl, 
				{type:'form', contactemail:$contactemail, name:$name, email:$email, subject:$subject, website:$url, message:$message, mywebsite:$mywebsite}, 
				function(data){
					jQuery('#contactform .loading').animate({opacity: 0}, 250);
					jQuery('.entry div.contform').fadeOut('slow');
					jQuery('#name, #subject, #url, #email, #message').val('');
					jQuery('#contactform div.form_info div.form_error').hide();
					jQuery('.entry .box').hide();
					jQuery('.entry .info_box').fadeIn('fast');
					jQuery('html, body').animate({scrollTop:0}, 'slow');
					jQuery('.entry .info_box').delay(5000).fadeOut(1000, function(){ 
						jQuery('.entry div.contform').fadeIn('slow');
					});
				}
			);
			
			return false;
		} else {
			jQuery('#contactform .loading').animate({opacity: 0}, 250);
			jQuery('.entry .box').hide();
			jQuery('.entry .error_box').fadeIn('fast');
			jQuery('html, body').animate({scrollTop:0}, 'slow');
			jQuery('.entry .error_box').delay(5000).fadeOut('slow');
			
			if ($name == ''){ 
				jQuery('#name').parent().find('div.form_error').hide(); 
				jQuery('#name').parent().find('div.defaulterror').show(); 
			} else if ($nameshort == true){ 
				jQuery('#name').parent().find('div.form_error').hide(); 
				jQuery('#name').parent().find('div.shorterror').show(); 
			} else if ($namelong == true){ 
				jQuery('#name').parent().find('div.form_error').hide(); 
				jQuery('#name').parent().find('div.longerror').show(); 
			} else { 
				jQuery('#name').parent().find('div.form_error').hide();
			}
			
			if ($email == ''){ 
				jQuery('#email').parent().find('div.form_error').hide(); 
				jQuery('#email').parent().find('div.defaulterror').show();
			} else if ($emailerror == false){ 
				jQuery('#email').parent().find('div.form_error').hide(); 
				jQuery('#email').parent().find('div.invaliderror').show();
			} else { 
				jQuery('#email').parent().find('div.form_error').hide();
			}
			
			if ($subject == ''){ 
				jQuery('#subject').parent().find('div.form_error').hide(); 
				jQuery('#subject').parent().find('div.defaulterror').show(); 
			} else if ($subjectshort == true){ 
				jQuery('#subject').parent().find('div.form_error').hide(); 
				jQuery('#subject').parent().find('div.shorterror').show(); 
			} else if ($subjectlong == true){ 
				jQuery('#subject').parent().find('div.form_error').hide(); 
				jQuery('#subject').parent().find('div.longerror').show(); 
			} else { 
				jQuery('#subject').parent().find('div.form_error').hide(); 
			}
			
			if ($message == ''){ 
				jQuery('#message').parent().find('div.form_error').hide(); 
				jQuery('#message').parent().find('div.defaulterror').show(); 
			} else if ($messageshort == true){ 
				jQuery('#message').parent().find('div.form_error').hide();
				jQuery('#message').parent().find('div.shorterror').show(); 
			} else { 
				jQuery('#message').parent().find('div.form_error').hide();
			}
			
			return false;
		}
	});
});


