/*	SWFObject v2.2 <http://code.google.com/p/swfobject/>
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject = function ()
    {
        var D = "undefined",
            r = "object",
            S = "Shockwave Flash",
            W = "ShockwaveFlash.ShockwaveFlash",
            q = "application/x-shockwave-flash",
            R = "SWFObjectExprInst",
            x = "onreadystatechange",
            O = window,
            j = document,
            t = navigator,
            T = false,
            U = [h],
            o = [],
            N = [],
            I = [],
            l, Q, E, B, J = false,
            a = false,
            n, G, m = true,
            M = function ()
            {
                var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D,
                    ah = t.userAgent.toLowerCase(),
                    Y = t.platform.toLowerCase(),
                    ae = Y ? /win/.test(Y) : /win/.test(ah),
                    ac = Y ? /mac/.test(Y) : /mac/.test(ah),
                    af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
                    X = !+"\v1",
                    ag = [0, 0, 0],
                    ab = null;
                if (typeof t.plugins != D && typeof t.plugins[S] == r)
                {
                    ab = t.plugins[S].description;
                    if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin))
                    {
                        T = true;
                        X = false;
                        ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                        ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10);
                        ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                        ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0
                    }
                }
                else
                {
                    if (typeof O.ActiveXObject != D)
                    {
                        try
                        {
                            var ad = new ActiveXObject(W);
                            if (ad)
                            {
                                ab = ad.GetVariable("$version");
                                if (ab)
                                {
                                    X = true;
                                    ab = ab.split(" ")[1].split(",");
                                    ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                                }
                            }
                        }
                        catch (Z)
                        {}
                    }
                }
                return {
                    w3: aa,
                    pv: ag,
                    wk: af,
                    ie: X,
                    win: ae,
                    mac: ac
                }
            }(),
            k = function ()
            {
                if (!M.w3)
                {
                    return
                }
                if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body)))
                {
                    f()
                }
                if (!J)
                {
                    if (typeof j.addEventListener != D)
                    {
                        j.addEventListener("DOMContentLoaded", f, false)
                    }
                    if (M.ie && M.win)
                    {
                        j.attachEvent(x, function ()
                        {
                            if (j.readyState == "complete")
                            {
                                j.detachEvent(x, arguments.callee);
                                f()
                            }
                        });
                        if (O == top)
                        {
                            (function ()
                            {
                                if (J)
                                {
                                    return
                                }
                                try
                                {
                                    j.documentElement.doScroll("left")
                                }
                                catch (X)
                                {
                                    setTimeout(arguments.callee, 0);
                                    return
                                }
                                f()
                            })()
                        }
                    }
                    if (M.wk)
                    {
                        (function ()
                        {
                            if (J)
                            {
                                return
                            }
                            if (!/loaded|complete/.test(j.readyState))
                            {
                                setTimeout(arguments.callee, 0);
                                return
                            }
                            f()
                        })()
                    }
                    s(f)
                }
            }();

        function f()
        {
            if (J)
            {
                return
            }
            try
            {
                var Z = j.getElementsByTagName("body")[0].appendChild(C("span"));
                Z.parentNode.removeChild(Z)
            }
            catch (aa)
            {
                return
            }
            J = true;
            var X = U.length;
            for (var Y = 0; Y < X; Y++)
            {
                U[Y]()
            }
        }
        function K(X)
        {
            if (J)
            {
                X()
            }
            else
            {
                U[U.length] = X
            }
        }
        function s(Y)
        {
            if (typeof O.addEventListener != D)
            {
                O.addEventListener("load", Y, false)
            }
            else
            {
                if (typeof j.addEventListener != D)
                {
                    j.addEventListener("load", Y, false)
                }
                else
                {
                    if (typeof O.attachEvent != D)
                    {
                        i(O, "onload", Y)
                    }
                    else
                    {
                        if (typeof O.onload == "function")
                        {
                            var X = O.onload;
                            O.onload = function ()
                            {
                                X();
                                Y()
                            }
                        }
                        else
                        {
                            O.onload = Y
                        }
                    }
                }
            }
        }
        function h()
        {
            if (T)
            {
                V()
            }
            else
            {
                H()
            }
        }
        function V()
        {
            var X = j.getElementsByTagName("body")[0];
            var aa = C(r);
            aa.setAttribute("type", q);
            var Z = X.appendChild(aa);
            if (Z)
            {
                var Y = 0;
                (function ()
                {
                    if (typeof Z.GetVariable != D)
                    {
                        var ab = Z.GetVariable("$version");
                        if (ab)
                        {
                            ab = ab.split(" ")[1].split(",");
                            M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)]
                        }
                    }
                    else
                    {
                        if (Y < 10)
                        {
                            Y++;
                            setTimeout(arguments.callee, 10);
                            return
                        }
                    }
                    X.removeChild(aa);
                    Z = null;
                    H()
                })()
            }
            else
            {
                H()
            }
        }
        function H()
        {
            var ag = o.length;
            if (ag > 0)
            {
                for (var af = 0; af < ag; af++)
                {
                    var Y = o[af].id;
                    var ab = o[af].callbackFn;
                    var aa = {
                        success: false,
                        id: Y
                    };
                    if (M.pv[0] > 0)
                    {
                        var ae = c(Y);
                        if (ae)
                        {
                            if (F(o[af].swfVersion) && !(M.wk && M.wk < 312))
                            {
                                w(Y, true);
                                if (ab)
                                {
                                    aa.success = true;
                                    aa.ref = z(Y);
                                    ab(aa)
                                }
                            }
                            else
                            {
                                if (o[af].expressInstall && A())
                                {
                                    var ai = {};
                                    ai.data = o[af].expressInstall;
                                    ai.width = ae.getAttribute("width") || "0";
                                    ai.height = ae.getAttribute("height") || "0";
                                    if (ae.getAttribute("class"))
                                    {
                                        ai.styleclass = ae.getAttribute("class")
                                    }
                                    if (ae.getAttribute("align"))
                                    {
                                        ai.align = ae.getAttribute("align")
                                    }
                                    var ah = {};
                                    var X = ae.getElementsByTagName("param");
                                    var ac = X.length;
                                    for (var ad = 0; ad < ac; ad++)
                                    {
                                        if (X[ad].getAttribute("name").toLowerCase() != "movie")
                                        {
                                            ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value")
                                        }
                                    }
                                    P(ai, ah, Y, ab)
                                }
                                else
                                {
                                    p(ae);
                                    if (ab)
                                    {
                                        ab(aa)
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        w(Y, true);
                        if (ab)
                        {
                            var Z = z(Y);
                            if (Z && typeof Z.SetVariable != D)
                            {
                                aa.success = true;
                                aa.ref = Z
                            }
                            ab(aa)
                        }
                    }
                }
            }
        }
        function z(aa)
        {
            var X = null;
            var Y = c(aa);
            if (Y && Y.nodeName == "OBJECT")
            {
                if (typeof Y.SetVariable != D)
                {
                    X = Y
                }
                else
                {
                    var Z = Y.getElementsByTagName(r)[0];
                    if (Z)
                    {
                        X = Z
                    }
                }
            }
            return X
        }
        function A()
        {
            return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312)
        }
        function P(aa, ab, X, Z)
        {
            a = true;
            E = Z || null;
            B = {
                success: false,
                id: X
            };
            var ae = c(X);
            if (ae)
            {
                if (ae.nodeName == "OBJECT")
                {
                    l = g(ae);
                    Q = null
                }
                else
                {
                    l = ae;
                    Q = X
                }
                aa.id = R;
                if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310))
                {
                    aa.width = "310"
                }
                if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137))
                {
                    aa.height = "137"
                }
                j.title = j.title.slice(0, 47) + " - Flash Player Installation";
                var ad = M.ie && M.win ? "ActiveX" : "PlugIn",
                    ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title;
                if (typeof ab.flashvars != D)
                {
                    ab.flashvars += "&" + ac
                }
                else
                {
                    ab.flashvars = ac
                }
                if (M.ie && M.win && ae.readyState != 4)
                {
                    var Y = C("div");
                    X += "SWFObjectNew";
                    Y.setAttribute("id", X);
                    ae.parentNode.insertBefore(Y, ae);
                    ae.style.display = "none";
                    (function ()
                    {
                        if (ae.readyState == 4)
                        {
                            ae.parentNode.removeChild(ae)
                        }
                        else
                        {
                            setTimeout(arguments.callee, 10)
                        }
                    })()
                }
                u(aa, ab, X)
            }
        }
        function p(Y)
        {
            if (M.ie && M.win && Y.readyState != 4)
            {
                var X = C("div");
                Y.parentNode.insertBefore(X, Y);
                X.parentNode.replaceChild(g(Y), X);
                Y.style.display = "none";
                (function ()
                {
                    if (Y.readyState == 4)
                    {
                        Y.parentNode.removeChild(Y)
                    }
                    else
                    {
                        setTimeout(arguments.callee, 10)
                    }
                })()
            }
            else
            {
                Y.parentNode.replaceChild(g(Y), Y)
            }
        }
        function g(ab)
        {
            var aa = C("div");
            if (M.win && M.ie)
            {
                aa.innerHTML = ab.innerHTML
            }
            else
            {
                var Y = ab.getElementsByTagName(r)[0];
                if (Y)
                {
                    var ad = Y.childNodes;
                    if (ad)
                    {
                        var X = ad.length;
                        for (var Z = 0; Z < X; Z++)
                        {
                            if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8))
                            {
                                aa.appendChild(ad[Z].cloneNode(true))
                            }
                        }
                    }
                }
            }
            return aa
        }
        function u(ai, ag, Y)
        {
            var X, aa = c(Y);
            if (M.wk && M.wk < 312)
            {
                return X
            }
            if (aa)
            {
                if (typeof ai.id == D)
                {
                    ai.id = Y
                }
                if (M.ie && M.win)
                {
                    var ah = "";
                    for (var ae in ai)
                    {
                        if (ai[ae] != Object.prototype[ae])
                        {
                            if (ae.toLowerCase() == "data")
                            {
                                ag.movie = ai[ae]
                            }
                            else
                            {
                                if (ae.toLowerCase() == "styleclass")
                                {
                                    ah += ' class="' + ai[ae] + '"'
                                }
                                else
                                {
                                    if (ae.toLowerCase() != "classid")
                                    {
                                        ah += " " + ae + '="' + ai[ae] + '"'
                                    }
                                }
                            }
                        }
                    }
                    var af = "";
                    for (var ad in ag)
                    {
                        if (ag[ad] != Object.prototype[ad])
                        {
                            af += '<param name="' + ad + '" value="' + ag[ad] + '" />'
                        }
                    }
                    aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>";
                    N[N.length] = ai.id;
                    X = c(ai.id)
                }
                else
                {
                    var Z = C(r);
                    Z.setAttribute("type", q);
                    for (var ac in ai)
                    {
                        if (ai[ac] != Object.prototype[ac])
                        {
                            if (ac.toLowerCase() == "styleclass")
                            {
                                Z.setAttribute("class", ai[ac])
                            }
                            else
                            {
                                if (ac.toLowerCase() != "classid")
                                {
                                    Z.setAttribute(ac, ai[ac])
                                }
                            }
                        }
                    }
                    for (var ab in ag)
                    {
                        if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie")
                        {
                            e(Z, ab, ag[ab])
                        }
                    }
                    aa.parentNode.replaceChild(Z, aa);
                    X = Z
                }
            }
            return X
        }
        function e(Z, X, Y)
        {
            var aa = C("param");
            aa.setAttribute("name", X);
            aa.setAttribute("value", Y);
            Z.appendChild(aa)
        }
        function y(Y)
        {
            var X = c(Y);
            if (X && X.nodeName == "OBJECT")
            {
                if (M.ie && M.win)
                {
                    X.style.display = "none";
                    (function ()
                    {
                        if (X.readyState == 4)
                        {
                            b(Y)
                        }
                        else
                        {
                            setTimeout(arguments.callee, 10)
                        }
                    })()
                }
                else
                {
                    X.parentNode.removeChild(X)
                }
            }
        }
        function b(Z)
        {
            var Y = c(Z);
            if (Y)
            {
                for (var X in Y)
                {
                    if (typeof Y[X] == "function")
                    {
                        Y[X] = null
                    }
                }
                Y.parentNode.removeChild(Y)
            }
        }
        function c(Z)
        {
            var X = null;
            try
            {
                X = j.getElementById(Z)
            }
            catch (Y)
            {}
            return X
        }
        function C(X)
        {
            return j.createElement(X)
        }
        function i(Z, X, Y)
        {
            Z.attachEvent(X, Y);
            I[I.length] = [Z, X, Y]
        }
        function F(Z)
        {
            var Y = M.pv,
                X = Z.split(".");
            X[0] = parseInt(X[0], 10);
            X[1] = parseInt(X[1], 10) || 0;
            X[2] = parseInt(X[2], 10) || 0;
            return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false
        }
        function v(ac, Y, ad, ab)
        {
            if (M.ie && M.mac)
            {
                return
            }
            var aa = j.getElementsByTagName("head")[0];
            if (!aa)
            {
                return
            }
            var X = (ad && typeof ad == "string") ? ad : "screen";
            if (ab)
            {
                n = null;
                G = null
            }
            if (!n || G != X)
            {
                var Z = C("style");
                Z.setAttribute("type", "text/css");
                Z.setAttribute("media", X);
                n = aa.appendChild(Z);
                if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0)
                {
                    n = j.styleSheets[j.styleSheets.length - 1]
                }
                G = X
            }
            if (M.ie && M.win)
            {
                if (n && typeof n.addRule == r)
                {
                    n.addRule(ac, Y)
                }
            }
            else
            {
                if (n && typeof j.createTextNode != D)
                {
                    n.appendChild(j.createTextNode(ac + " {" + Y + "}"))
                }
            }
        }
        function w(Z, X)
        {
            if (!m)
            {
                return
            }
            var Y = X ? "visible" : "hidden";
            if (J && c(Z))
            {
                c(Z).style.visibility = Y
            }
            else
            {
                v("#" + Z, "visibility:" + Y)
            }
        }
        function L(Y)
        {
            var Z = /[\\\"<>\.;]/;
            var X = Z.exec(Y) != null;
            return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y
        }
        var d = function ()
            {
                if (M.ie && M.win)
                {
                    window.attachEvent("onunload", function ()
                    {
                        var ac = I.length;
                        for (var ab = 0; ab < ac; ab++)
                        {
                            I[ab][0].detachEvent(I[ab][1], I[ab][2])
                        }
                        var Z = N.length;
                        for (var aa = 0; aa < Z; aa++)
                        {
                            y(N[aa])
                        }
                        for (var Y in M)
                        {
                            M[Y] = null
                        }
                        M = null;
                        for (var X in swfobject)
                        {
                            swfobject[X] = null
                        }
                        swfobject = null
                    })
                }
            }();
        return {
            registerObject: function (ab, X, aa, Z)
            {
                if (M.w3 && ab && X)
                {
                    var Y = {};
                    Y.id = ab;
                    Y.swfVersion = X;
                    Y.expressInstall = aa;
                    Y.callbackFn = Z;
                    o[o.length] = Y;
                    w(ab, false)
                }
                else
                {
                    if (Z)
                    {
                        Z(
                        {
                            success: false,
                            id: ab
                        })
                    }
                }
            },
            getObjectById: function (X)
            {
                if (M.w3)
                {
                    return z(X)
                }
            },
            embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac)
            {
                var X = {
                    success: false,
                    id: ah
                };
                if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y)
                {
                    w(ah, false);
                    K(function ()
                    {
                        ae += "";
                        ag += "";
                        var aj = {};
                        if (af && typeof af === r)
                        {
                            for (var al in af)
                            {
                                aj[al] = af[al]
                            }
                        }
                        aj.data = ab;
                        aj.width = ae;
                        aj.height = ag;
                        var am = {};
                        if (ad && typeof ad === r)
                        {
                            for (var ak in ad)
                            {
                                am[ak] = ad[ak]
                            }
                        }
                        if (Z && typeof Z === r)
                        {
                            for (var ai in Z)
                            {
                                if (typeof am.flashvars != D)
                                {
                                    am.flashvars += "&" + ai + "=" + Z[ai]
                                }
                                else
                                {
                                    am.flashvars = ai + "=" + Z[ai]
                                }
                            }
                        }
                        if (F(Y))
                        {
                            var an = u(aj, am, ah);
                            if (aj.id == ah)
                            {
                                w(ah, true)
                            }
                            X.success = true;
                            X.ref = an
                        }
                        else
                        {
                            if (aa && A())
                            {
                                aj.data = aa;
                                P(aj, am, ah, ac);
                                return
                            }
                            else
                            {
                                w(ah, true)
                            }
                        }
                        if (ac)
                        {
                            ac(X)
                        }
                    })
                }
                else
                {
                    if (ac)
                    {
                        ac(X)
                    }
                }
            },
            switchOffAutoHideShow: function ()
            {
                m = false
            },
            ua: M,
            getFlashPlayerVersion: function ()
            {
                return {
                    major: M.pv[0],
                    minor: M.pv[1],
                    release: M.pv[2]
                }
            },
            hasFlashPlayerVersion: F,
            createSWF: function (Z, Y, X)
            {
                if (M.w3)
                {
                    return u(Z, Y, X)
                }
                else
                {
                    return undefined
                }
            },
            showExpressInstall: function (Z, aa, X, Y)
            {
                if (M.w3 && A())
                {
                    P(Z, aa, X, Y)
                }
            },
            removeSWF: function (X)
            {
                if (M.w3)
                {
                    y(X)
                }
            },
            createCSS: function (aa, Z, Y, X)
            {
                if (M.w3)
                {
                    v(aa, Z, Y, X)
                }
            },
            addDomLoadEvent: K,
            addLoadEvent: s,
            getQueryParamValue: function (aa)
            {
                var Z = j.location.search || j.location.hash;
                if (Z)
                {
                    if (/\?/.test(Z))
                    {
                        Z = Z.split("?")[1]
                    }
                    if (aa == null)
                    {
                        return L(Z)
                    }
                    var Y = Z.split("&");
                    for (var X = 0; X < Y.length; X++)
                    {
                        if (Y[X].substring(0, Y[X].indexOf("=")) == aa)
                        {
                            return L(Y[X].substring((Y[X].indexOf("=") + 1)))
                        }
                    }
                }
                return ""
            },
            expressInstallCallback: function ()
            {
                if (a)
                {
                    var X = c(R);
                    if (X && l)
                    {
                        X.parentNode.replaceChild(l, X);
                        if (Q)
                        {
                            w(Q, true);
                            if (M.ie && M.win)
                            {
                                l.style.display = "block"
                            }
                        }
                        if (E)
                        {
                            E(B)
                        }
                    }
                    a = false
                }
            }
        }
    }();
/**
 * jQuery Templates
 *
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Written by: Stan Lemon <stanlemon@mac.com>
 */
(function ($)
{
    $.template = function (html, options)
    {
        return new $.template.instance(html, options);
    };
    $.template.instance = function (html, options)
    {
        if (options && options.regx)
        {
            options.regx = this.regx[options.regx];
        }
        this.options = $.extend(
        {
            compile: false,
            regx: this.regx.standard
        }, options || {});
        this.html = html;
        if (this.options.compile)
        {
            this.compile();
        }
        this.isTemplate = true;
    };
    $.template.regx = $.template.instance.prototype.regx = {
        jsp: /\$\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
        ext: /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
        jtemplates: /\{\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}\}/g
    };
    $.template.regx.standard = $.template.regx.jsp;
    $.template.helpers = $.template.instance.prototype.helpers = {
        substr: function (value, start, length)
        {
            return String(value).substr(start, length);
        }
    };
    $.extend($.template.instance.prototype, {
        apply: function (values)
        {
            if (this.options.compile)
            {
                return this.compiled(values);
            }
            else
            {
                var tpl = this;
                var fm = this.helpers;
                var fn = function (m, name, format, args)
                    {
                        if (format)
                        {
                            if (format.substr(0, 5) == "this.")
                            {
                                return tpl.call(format.substr(5), values[name], values);
                            }
                            else
                            {
                                if (args)
                                {
                                    var re = /^\s*['"](.*)["']\s*$/;
                                    args = args.split(",");
                                    for (var i = 0, len = args.length; i < len; i++)
                                    {
                                        args[i] = args[i].replace(re, "$1");
                                    }
                                    args = [values[name]].concat(args);
                                }
                                else
                                {
                                    args = [values[name]];
                                }
                                return fm[format].apply(fm, args);
                            }
                        }
                        else
                        {
                            return values[name] !== undefined ? values[name] : "";
                        }
                    };
                return this.html.replace(this.options.regx, fn);
            }
        },
        compile: function ()
        {
            var sep = $.browser.mozilla ? "+" : ",";
            var fm = this.helpers;
            var fn = function (m, name, format, args)
                {
                    if (format)
                    {
                        args = args ? "," + args : "";
                        if (format.substr(0, 5) != "this.")
                        {
                            format = "fm." + format + "(";
                        }
                        else
                        {
                            format = 'this.call("' + format.substr(5) + '", ';
                            args = ", values";
                        }
                    }
                    else
                    {
                        args = "";
                        format = "(values['" + name + "'] == undefined ? '' : ";
                    }
                    return "'" + sep + format + "values['" + name + "']" + args + ")" + sep + "'";
                };
            var body;
            if ($.browser.mozilla)
            {
                body = "this.compiled = function(values){ return '" + this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g, "\\n").replace(/'/g, "\\'").replace(this.options.regx, fn) + "';};";
            }
            else
            {
                body = ["this.compiled = function(values){ return ['"];
                body.push(this.html.replace(/\\/g, "\\\\").replace(/(\r\n|\n)/g, "\\n").replace(/'/g, "\\'").replace(this.options.regx, fn));
                body.push("'].join('');};");
                body = body.join("");
            }
            eval(body);
            return this;
        }
    });
    var $_old = {
        domManip: $.fn.domManip,
        text: $.fn.text,
        html: $.fn.html
    };
    $.fn.domManip = function (args, table, reverse, callback)
    {
        if (args[0].isTemplate)
        {
            args[0] = args[0].apply(args[1]);
            delete args[1];
        }
        var r = $_old.domManip.apply(this, arguments);
        return r;
    };
    $.fn.html = function (value, o)
    {
        if (value && value.isTemplate)
        {
            var value = value.apply(o);
        }
        var r = $_old.html.apply(this, [value]);
        return r;
    };
    $.fn.text = function (value, o)
    {
        if (value && value.isTemplate)
        {
            var value = value.apply(o);
        }
        var r = $_old.text.apply(this, [value]);
        return r;
    };
})(jQuery);
/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 *
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 *
 * Version: 1.3.1 (05/03/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function (a)
{
    var j, s, q, k, D, W, i, n, Z, d = 0,
        h = {},
        H = [],
        E = 0,
        f = {},
        Y = [],
        F = null,
        M = new Image(),
        G = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,
        K = /[^\.]\.(swf)\s*$/i,
        Q, l = 1,
        A, C, o = false,
        c = 20,
        T = a.extend(a("<div/>")[0], {
            prop: 0
        }),
        J = 0,
        r = !a.support.opacity && !window.XMLHttpRequest,
        I = function ()
        {
            s.hide();
            M.onerror = M.onload = null;
            if (F)
            {
                F.abort();
            }
            j.empty();
        },
        P = function ()
        {
            a.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>', {
                scrolling: "no",
                padding: 20,
                transitionIn: "none",
                transitionOut: "none"
            });
        },
        e = function ()
        {
            return [a(window).width(), a(window).height(), a(document).scrollLeft(), a(document).scrollTop()];
        },
        B = function ()
        {
            var v = e(),
                AC = {},
                AA = f.margin,
                w = f.autoScale,
                AB = (c + AA) * 2,
                z = (c + AA) * 2,
                x = (f.padding * 2),
                y;
            if (f.width.toString().indexOf("%") > -1)
            {
                AC.width = ((v[0] * parseFloat(f.width)) / 100) - (c * 2);
                w = false;
            }
            else
            {
                AC.width = f.width + x;
            }
            if (f.height.toString().indexOf("%") > -1)
            {
                AC.height = ((v[1] * parseFloat(f.height)) / 100) - (c * 2);
                w = false;
            }
            else
            {
                AC.height = f.height + x;
            }
            if (w && (AC.width > (v[0] - AB) || AC.height > (v[1] - z)))
            {
                if (h.type == "image" || h.type == "swf")
                {
                    AB += x;
                    z += x;
                    y = Math.min(Math.min(v[0] - AB, f.width) / f.width, Math.min(v[1] - z, f.height) / f.height);
                    AC.width = Math.round(y * (AC.width - x)) + x;
                    AC.height = Math.round(y * (AC.height - x)) + x;
                }
                else
                {
                    AC.width = Math.min(AC.width, (v[0] - AB));
                    AC.height = Math.min(AC.height, (v[1] - z));
                }
            }
            AC.top = v[3] + ((v[1] - (AC.height + (c * 2))) * 0.5);
            AC.left = v[2] + ((v[0] - (AC.width + (c * 2))) * 0.5);
            if (f.autoScale === false)
            {
                AC.top = Math.max(v[3] + AA, AC.top);
                AC.left = Math.max(v[2] + AA, AC.left);
            }
            return AC;
        },
        m = function (v)
        {
            if (v && v.length)
            {
                switch (f.titlePosition)
                {
                case "inside":
                    return v;
                case "over":
                    return '<span id="fancybox-title-over">' + v + "</span>";
                default:
                    return '<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">' + v + '</span><span id="fancybox-title-right"></span></span>';
                }
            }
            return false;
        },
        S = function ()
        {
            var x = f.title,
                w = C.width - (f.padding * 2),
                v = "fancybox-title-" + f.titlePosition;
            a("#fancybox-title").remove();
            J = 0;
            if (f.titleShow === false)
            {
                return;
            }
            x = a.isFunction(f.titleFormat) ? f.titleFormat(x, Y, E, f) : m(x);
            if (!x || x === "")
            {
                return;
            }
            a('<div id="fancybox-title" class="' + v + '" />').css(
            {
                width: w,
                paddingLeft: f.padding,
                paddingRight: f.padding
            }).html(x).appendTo("body");
            switch (f.titlePosition)
            {
            case "inside":
                J = a("#fancybox-title").outerHeight(true) - f.padding;
                C.height += J;
                break;
            case "over":
                a("#fancybox-title").css("bottom", f.padding);
                break;
            default:
                a("#fancybox-title").css("bottom", a("#fancybox-title").outerHeight(true) * -1);
                break;
            }
            a("#fancybox-title").appendTo(D).hide();
        },
        O = function ()
        {
            a(document).unbind("keydown.fb").bind("keydown.fb", function (v)
            {
                if (v.keyCode == 27 && f.enableEscapeButton)
                {
                    v.preventDefault();
                    a.fancybox.close();
                }
                else
                {
                    if (v.keyCode == 37)
                    {
                        v.preventDefault();
                        a.fancybox.prev();
                    }
                    else
                    {
                        if (v.keyCode == 39)
                        {
                            v.preventDefault();
                            a.fancybox.next();
                        }
                    }
                }
            });
            if (a.fn.mousewheel)
            {
                k.unbind("mousewheel.fb");
                if (Y.length > 1)
                {
                    k.bind("mousewheel.fb", function (v, w)
                    {
                        v.preventDefault();
                        if (o || w === 0)
                        {
                            return;
                        }
                        if (w > 0)
                        {
                            a.fancybox.prev();
                        }
                        else
                        {
                            a.fancybox.next();
                        }
                    });
                }
            }
            if (!f.showNavArrows)
            {
                return;
            }
            if ((f.cyclic && Y.length > 1) || E !== 0)
            {
                n.show();
            }
            if ((f.cyclic && Y.length > 1) || E != (Y.length - 1))
            {
                Z.show();
            }
        },
        t = function ()
        {
            var v, w;
            if ((Y.length - 1) > E)
            {
                v = Y[E + 1].href;
                if (typeof v !== "undefined" && v.match(G))
                {
                    w = new Image();
                    w.src = v;
                }
            }
            if (E > 0)
            {
                v = Y[E - 1].href;
                if (typeof v !== "undefined" && v.match(G))
                {
                    w = new Image();
                    w.src = v;
                }
            }
        },
        V = function ()
        {
            W.css("overflow", (f.scrolling == "auto" ? (f.type == "image" || f.type == "iframe" || f.type == "swf" ? "hidden" : "auto") : (f.scrolling == "yes" ? "auto" : "visible")));
            if (!a.support.opacity)
            {
                W.get(0).style.removeAttribute("filter");
                k.get(0).style.removeAttribute("filter");
            }
            a("#fancybox-title").show();
            if (f.hideOnContentClick)
            {
                W.one("click", a.fancybox.close);
            }
            if (f.hideOnOverlayClick)
            {
                q.one("click", a.fancybox.close);
            }
            if (f.showCloseButton)
            {
                i.show();
            }
            O();
            a(window).bind("resize.fb", a.fancybox.center);
            if (f.centerOnScroll)
            {
                a(window).bind("scroll.fb", a.fancybox.center);
            }
            else
            {
                a(window).unbind("scroll.fb");
            }
            if (a.isFunction(f.onComplete))
            {
                f.onComplete(Y, E, f);
            }
            o = false;
            t();
        },
        g = function (z)
        {
            var w = Math.round(A.width + (C.width - A.width) * z),
                v = Math.round(A.height + (C.height - A.height) * z),
                y = Math.round(A.top + (C.top - A.top) * z),
                x = Math.round(A.left + (C.left - A.left) * z);
            k.css(
            {
                width: w + "px",
                height: v + "px",
                top: y + "px",
                left: x + "px"
            });
            w = Math.max(w - f.padding * 2, 0);
            v = Math.max(v - (f.padding * 2 + (J * z)), 0);
            W.css(
            {
                width: w + "px",
                height: v + "px"
            });
            if (typeof C.opacity !== "undefined")
            {
                k.css("opacity", (z < 0.5 ? 0.5 : z));
            }
        },
        X = function (v)
        {
            var w = v.offset();
            w.top += parseFloat(v.css("paddingTop")) || 0;
            w.left += parseFloat(v.css("paddingLeft")) || 0;
            w.top += parseFloat(v.css("border-top-width")) || 0;
            w.left += parseFloat(v.css("border-left-width")) || 0;
            w.width = v.width();
            w.height = v.height();
            return w;
        },
        u = function ()
        {
            var y = h.orig ? a(h.orig) : false,
                x = {},
                w, v;
            if (y && y.length)
            {
                w = X(y);
                x = {
                    width: (w.width + (f.padding * 2)),
                    height: (w.height + (f.padding * 2)),
                    top: (w.top - f.padding - c),
                    left: (w.left - f.padding - c)
                };
            }
            else
            {
                v = e();
                x = {
                    width: 1,
                    height: 1,
                    top: v[3] + v[1] * 0.5,
                    left: v[2] + v[0] * 0.5
                };
            }
            return x;
        },
        U = function ()
        {
            s.hide();
            if (k.is(":visible") && a.isFunction(f.onCleanup))
            {
                if (f.onCleanup(Y, E, f) === false)
                {
                    a.event.trigger("fancybox-cancel");
                    o = false;
                    return;
                }
            }
            Y = H;
            E = d;
            f = h;
            W.get(0).scrollTop = 0;
            W.get(0).scrollLeft = 0;
            if (f.overlayShow)
            {
                if (r)
                {
                    a("select:not(#fancybox-tmp select)").filter(function ()
                    {
                        return this.style.visibility !== "hidden";
                    }).css(
                    {
                        visibility: "hidden"
                    }).one("fancybox-cleanup", function ()
                    {
                        this.style.visibility = "inherit";
                    });
                }
                q.css(
                {
                    "background-color": f.overlayColor,
                    opacity: f.overlayOpacity
                }).unbind().show();
            }
            C = B();
            S();
            if (k.is(":visible"))
            {
                a(i.add(n).add(Z)).hide();
                var w = k.position(),
                    v;
                A = {
                    top: w.top,
                    left: w.left,
                    width: k.width(),
                    height: k.height()
                };
                v = (A.width == C.width && A.height == C.height);
                W.fadeOut(f.changeFade, function ()
                {
                    var x = function ()
                        {
                            W.html(j.contents()).fadeIn(f.changeFade, V);
                        };
                    a.event.trigger("fancybox-change");
                    W.empty().css("overflow", "hidden");
                    if (v)
                    {
                        W.css(
                        {
                            top: f.padding,
                            left: f.padding,
                            width: Math.max(C.width - (f.padding * 2), 1),
                            height: Math.max(C.height - (f.padding * 2) - J, 1)
                        });
                        x();
                    }
                    else
                    {
                        W.css(
                        {
                            top: f.padding,
                            left: f.padding,
                            width: Math.max(A.width - (f.padding * 2), 1),
                            height: Math.max(A.height - (f.padding * 2), 1)
                        });
                        T.prop = 0;
                        a(T).animate(
                        {
                            prop: 1
                        }, {
                            duration: f.changeSpeed,
                            easing: f.easingChange,
                            step: g,
                            complete: x
                        });
                    }
                });
                return;
            }
            k.css("opacity", 1);
            if (f.transitionIn == "elastic")
            {
                A = u();
                W.css(
                {
                    top: f.padding,
                    left: f.padding,
                    width: Math.max(A.width - (f.padding * 2), 1),
                    height: Math.max(A.height - (f.padding * 2), 1)
                }).html(j.contents());
                k.css(A).show();
                if (f.opacity)
                {
                    C.opacity = 0;
                }
                T.prop = 0;
                a(T).animate(
                {
                    prop: 1
                }, {
                    duration: f.speedIn,
                    easing: f.easingIn,
                    step: g,
                    complete: V
                });
            }
            else
            {
                W.css(
                {
                    top: f.padding,
                    left: f.padding,
                    width: Math.max(C.width - (f.padding * 2), 1),
                    height: Math.max(C.height - (f.padding * 2) - J, 1)
                }).html(j.contents());
                k.css(C).fadeIn(f.transitionIn == "none" ? 0 : f.speedIn, V);
            }
        },
        R = function ()
        {
            j.width(h.width);
            j.height(h.height);
            if (h.width == "auto")
            {
                h.width = j.width();
            }
            if (h.height == "auto")
            {
                h.height = j.height();
            }
            U();
        },
        p = function ()
        {
            o = true;
            h.width = M.width;
            h.height = M.height;
            a("<img />").attr(
            {
                id: "fancybox-img",
                src: M.src,
                alt: h.title
            }).appendTo(j);
            U();
        },
        L = function ()
        {
            I();
            var AA = H[d],
                x, y, AC, AB, w, v, z;
            h = a.extend(
            {}, a.fn.fancybox.defaults, (typeof a(AA).data("fancybox") == "undefined" ? h : a(AA).data("fancybox")));
            AC = AA.title || a(AA).title || h.title || "";
            if (AA.nodeName && !h.orig)
            {
                h.orig = a(AA).children("img:first").length ? a(AA).children("img:first") : a(AA);
            }
            if (AC === "" && h.orig)
            {
                AC = h.orig.attr("alt");
            }
            if (AA.nodeName && (/^(?:javascript|#)/i).test(AA.href))
            {
                x = h.href || null;
            }
            else
            {
                x = h.href || AA.href || null;
            }
            if (h.type)
            {
                y = h.type;
                if (!x)
                {
                    x = h.content;
                }
            }
            else
            {
                if (h.content)
                {
                    y = "html";
                }
                else
                {
                    if (x)
                    {
                        if (x.match(G))
                        {
                            y = "image";
                        }
                        else
                        {
                            if (x.match(K))
                            {
                                y = "swf";
                            }
                            else
                            {
                                if (a(AA).hasClass("iframe"))
                                {
                                    y = "iframe";
                                }
                                else
                                {
                                    if (x.match(/#/))
                                    {
                                        AA = x.substr(x.indexOf("#"));
                                        y = a(AA).length > 0 ? "inline" : "ajax";
                                    }
                                    else
                                    {
                                        y = "ajax";
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        y = "inline";
                    }
                }
            }
            h.type = y;
            h.href = x;
            h.title = AC;
            if (h.autoDimensions && h.type !== "iframe" && h.type !== "swf")
            {
                h.width = "auto";
                h.height = "auto";
            }
            if (h.modal)
            {
                h.overlayShow = true;
                h.hideOnOverlayClick = false;
                h.hideOnContentClick = false;
                h.enableEscapeButton = false;
                h.showCloseButton = false;
            }
            if (a.isFunction(h.onStart))
            {
                if (h.onStart(H, d, h) === false)
                {
                    o = false;
                    return;
                }
            }
            j.css("padding", (c + h.padding + h.margin));
            a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change", function ()
            {
                a(this).replaceWith(W.children());
            });
            switch (y)
            {
            case "html":
                j.html(h.content);
                R();
                break;
            case "inline":
                a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(AA)).bind("fancybox-cleanup", function ()
                {
                    a(this).replaceWith(W.children());
                }).bind("fancybox-cancel", function ()
                {
                    a(this).replaceWith(j.children());
                });
                a(AA).appendTo(j);
                R();
                break;
            case "image":
                o = false;
                a.fancybox.showActivity();
                M = new Image();
                M.onerror = function ()
                {
                    P();
                };
                M.onload = function ()
                {
                    M.onerror = null;
                    M.onload = null;
                    p();
                };
                M.src = x;
                break;
            case "swf":
                AB = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + h.width + '" height="' + h.height + '"><param name="movie" value="' + x + '"></param>';
                w = "";
                a.each(h.swf, function (AD, AE)
                {
                    AB += '<param name="' + AD + '" value="' + AE + '"></param>';
                    w += " " + AD + '="' + AE + '"';
                });
                AB += '<embed src="' + x + '" type="application/x-shockwave-flash" width="' + h.width + '" height="' + h.height + '"' + w + "></embed></object>";
                j.html(AB);
                R();
                break;
            case "ajax":
                v = x.split("#", 2);
                z = h.ajax.data || {};
                if (v.length > 1)
                {
                    x = v[0];
                    if (typeof z == "string")
                    {
                        z += "&selector=" + v[1];
                    }
                    else
                    {
                        z.selector = v[1];
                    }
                }
                o = false;
                a.fancybox.showActivity();
                F = a.ajax(a.extend(h.ajax, {
                    url: x,
                    data: z,
                    error: P,
                    success: function (AE, AF, AD)
                    {
                        if (F.status == 200)
                        {
                            j.html(AE);
                            R();
                        }
                    }
                }));
                break;
            case "iframe":
                a('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" scrolling="' + h.scrolling + '" src="' + h.href + '"></iframe>').appendTo(j);
                U();
                break;
            }
        },
        N = function ()
        {
            if (!s.is(":visible"))
            {
                clearInterval(Q);
                return;
            }
            a("div", s).css("top", (l * -40) + "px");
            l = (l + 1) % 12;
        },
        b = function ()
        {
            if (a("#fancybox-wrap").length)
            {
                return;
            }
            a("body").append(j = a('<div id="fancybox-tmp"></div>'), s = a('<div id="fancybox-loading"><div></div></div>'), q = a('<div id="fancybox-overlay"></div>'), k = a('<div id="fancybox-wrap"></div>'));
            if (!a.support.opacity)
            {
                k.addClass("fancybox-ie");
                s.addClass("fancybox-ie");
            }
            D = a('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(k);
            D.append(W = a('<div id="fancybox-inner"></div>'), i = a('<a id="fancybox-close"></a>'), n = a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), Z = a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));
            i.click(a.fancybox.close);
            s.click(a.fancybox.cancel);
            n.click(function (v)
            {
                v.preventDefault();
                a.fancybox.prev();
            });
            Z.click(function (v)
            {
                v.preventDefault();
                a.fancybox.next();
            });
            if (r)
            {
                q.get(0).style.setExpression("height", "document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");
                s.get(0).style.setExpression("top", "(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");
                D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>');
            }
        };
    a.fn.fancybox = function (v)
    {
        a(this).data("fancybox", a.extend(
        {}, v, (a.metadata ? a(this).metadata() : {}))).unbind("click.fb").bind("click.fb", function (x)
        {
            x.preventDefault();
            if (o)
            {
                return;
            }
            o = true;
            a(this).blur();
            H = [];
            d = 0;
            var w = a(this).attr("rel") || "";
            if (!w || w == "" || w === "nofollow")
            {
                H.push(this);
            }
            else
            {
                H = a("a[rel=" + w + "], area[rel=" + w + "]");
                d = H.index(this);
            }
            L();
            return false;
        });
        return this;
    };
    a.fancybox = function (y)
    {
        if (o)
        {
            return;
        }
        o = true;
        var x = typeof arguments[1] !== "undefined" ? arguments[1] : {};
        H = [];
        d = x.index || 0;
        if (a.isArray(y))
        {
            for (var w = 0, v = y.length; w < v; w++)
            {
                if (typeof y[w] == "object")
                {
                    a(y[w]).data("fancybox", a.extend(
                    {}, x, y[w]));
                }
                else
                {
                    y[w] = a(
                    {}).data("fancybox", a.extend(
                    {
                        content: y[w]
                    }, x));
                }
            }
            H = jQuery.merge(H, y);
        }
        else
        {
            if (typeof y == "object")
            {
                a(y).data("fancybox", a.extend(
                {}, x, y));
            }
            else
            {
                y = a(
                {}).data("fancybox", a.extend(
                {
                    content: y
                }, x));
            }
            H.push(y);
        }
        if (d > H.length || d < 0)
        {
            d = 0;
        }
        L();
    };
    a.fancybox.showActivity = function ()
    {
        clearInterval(Q);
        s.show();
        Q = setInterval(N, 66);
    };
    a.fancybox.hideActivity = function ()
    {
        s.hide();
    };
    a.fancybox.next = function ()
    {
        return a.fancybox.pos(E + 1);
    };
    a.fancybox.prev = function ()
    {
        return a.fancybox.pos(E - 1);
    };
    a.fancybox.pos = function (v)
    {
        if (o)
        {
            return;
        }
        v = parseInt(v, 10);
        if (v > -1 && Y.length > v)
        {
            d = v;
            L();
        }
        if (f.cyclic && Y.length > 1 && v < 0)
        {
            d = Y.length - 1;
            L();
        }
        if (f.cyclic && Y.length > 1 && v >= Y.length)
        {
            d = 0;
            L();
        }
        return;
    };
    a.fancybox.cancel = function ()
    {
        if (o)
        {
            return;
        }
        o = true;
        a.event.trigger("fancybox-cancel");
        I();
        if (h && a.isFunction(h.onCancel))
        {
            h.onCancel(H, d, h);
        }
        o = false;
    };
    a.fancybox.close = function ()
    {
        if (o || k.is(":hidden"))
        {
            return;
        }
        o = true;
        if (f && a.isFunction(f.onCleanup))
        {
            if (f.onCleanup(Y, E, f) === false)
            {
                o = false;
                return;
            }
        }
        I();
        a(i.add(n).add(Z)).hide();
        a("#fancybox-title").remove();
        k.add(W).add(q).unbind();
        a(window).unbind("resize.fb scroll.fb");
        a(document).unbind("keydown.fb");

        function v()
        {
            q.fadeOut("fast");
            k.hide();
            a.event.trigger("fancybox-cleanup");
            W.empty();
            if (a.isFunction(f.onClosed))
            {
                f.onClosed(Y, E, f);
            }
            Y = h = [];
            E = d = 0;
            f = h = {};
            o = false;
        }
        W.css("overflow", "hidden");
        if (f.transitionOut == "elastic")
        {
            A = u();
            var w = k.position();
            C = {
                top: w.top,
                left: w.left,
                width: k.width(),
                height: k.height()
            };
            if (f.opacity)
            {
                C.opacity = 1;
            }
            T.prop = 1;
            a(T).animate(
            {
                prop: 0
            }, {
                duration: f.speedOut,
                easing: f.easingOut,
                step: g,
                complete: v
            });
        }
        else
        {
            k.fadeOut(f.transitionOut == "none" ? 0 : f.speedOut, v);
        }
    };
    a.fancybox.resize = function ()
    {
        var w, v;
        if (o || k.is(":hidden"))
        {
            return;
        }
        o = true;
        w = W.wrapInner("<div style='overflow:auto'></div>").children();
        v = w.height();
        k.css(
        {
            height: v + (f.padding * 2) + J
        });
        W.css(
        {
            height: v
        });
        w.replaceWith(w.children());
        a.fancybox.center();
    };
    a.fancybox.center = function ()
    {
        o = true;
        var v = e(),
            w = f.margin,
            x = {};
        x.top = v[3] + ((v[1] - ((k.height() - J) + (c * 2))) * 0.5);
        x.left = v[2] + ((v[0] - (k.width() + (c * 2))) * 0.5);
        x.top = Math.max(v[3] + w, x.top);
        x.left = Math.max(v[2] + w, x.left);
        k.css(x);
        o = false;
    };
    a.fn.fancybox.defaults = {
        padding: 10,
        margin: 20,
        opacity: false,
        modal: false,
        cyclic: false,
        scrolling: "auto",
        width: 560,
        height: 340,
        autoScale: true,
        autoDimensions: true,
        centerOnScroll: false,
        ajax: {},
        swf: {
            wmode: "transparent"
        },
        hideOnOverlayClick: true,
        hideOnContentClick: false,
        overlayShow: true,
        overlayOpacity: 0.3,
        overlayColor: "#666",
        titleShow: true,
        titlePosition: "outside",
        titleFormat: null,
        transitionIn: "fade",
        transitionOut: "fade",
        speedIn: 300,
        speedOut: 300,
        changeSpeed: 300,
        changeFade: "fast",
        easingIn: "swing",
        easingOut: "swing",
        showCloseButton: true,
        showNavArrows: true,
        enableEscapeButton: true,
        onStart: null,
        onCancel: null,
        onComplete: null,
        onCleanup: null,
        onClosed: null
    };
    a(document).ready(function ()
    {
        b();
    });
})(jQuery);
var Page = {};

Page.isIE = false;
Page.isIE6 = false;
Page.isIE7 = false;
Page.isIE8 = false;

if (window.ActiveXObject)
{
    var rv = -1;
    var ua = navigator.userAgent;
    var re = new RegExp("Trident\/([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
    {
        rv = parseFloat(RegExp.$1);
    }
    Page.isIE8 = (rv == 4);
    Page.isIE7 = ((window.XMLHttpRequest && !Page.isIE8) ? true : false);
    Page.isIE6 = !(Page.isIE7 || Page.isIE8);
    Page.isIE = true;
}

if (window.opera)
{
    jQuery(document).ready(function ()
    {
        $('body').addClass('opera');
    });
}

var args = location.href.split('/');
while (args.length > 3)
{
    args.pop();
}
Page.location = args.join('/');

Page.isPrintMode = /mode\=print/.test(location.search);

jQuery.fn.doBlurAndHidefocus = function ()
{
    try
    {
        this.blur(); // most browsers
        this.hideFocus = true; // internet explorer
        this.style.outline = 'none'; // mozilla
    }
    catch (e)
    {}
};

jQuery.fn.doBlur = function ()
{
    try
    {
        this.blur(); // most browsers
        this.hideFocus = false; // internet explorer
        this.style.outline = null; // mozilla
    }
    catch (e)
    {}
};

function preventDefault(event)
{
    try
    {
        event.preventDefault();
    }
    catch (error)
    { /* die silently */
    }
}
Page.content = function (f)
{
    var e = {};
    e.fancyboxSimple = f.template('<img src="${src}" /><div class="controls"><a class="print" href="#print" onclick="Page.content.printImage(\'${src}\'); return false;">&nbsp;</a><a class="download" href="${download_url}">&nbsp;</a><p class="text"><span class="left" />${text}<span class="right"/></p><a class="close" href="#close">&nbsp;</a></div>');
    e.fancyboxGallery = f.template('<img src="${src}" /><div class="controls with-enumerator"><a class="print" href="#print" onclick="Page.content.printImage(\'${src}\'); return false;">&nbsp;</a><a class="download" href="${download_url}">&nbsp;</a><p class="enumerator"><span class="left" />${index}/${count}<span class="right" /></p><p class="text"><span class="left" />${text}<span class="right"/></p><a class="close" href="#close">&nbsp;</a></div>');
    var i = {
        title: "Popup",
        height: "height=800",
        width: "width=760",
        top: "top=100",
        toolbar: "toolbar=no",
        menubar: "menubar=no",
        location: "location=no",
        resizable: "resizable=yes",
        scrollbars: "scrollbars=yes",
        status: "status=no"
    };
    var t = [];
    f.each(i, function (A, z)
    {
        if (A != "title")
        {
            t.push(z);
        }
    });

    function p()
    {
        f("#main-content .downloads li a").hover(g, r);
        f("#main-content .downloads li a").mousedown(y);
        f("#main-content .downloads li a").mouseup(a);
    }
    function g(z)
    {
        f(".download-sprite").addClass("over");
    }
    function r(z)
    {
        f(".download-sprite").removeClass("over");
    }
    function y(z)
    {
        f(".download-sprite").removeClass("over");
        f(".download-sprite").addClass("active");
    }
    function a(z)
    {
        f(".download-sprite").removeClass("active");
        f(".download-sprite").addClass("over");
    }
    function q()
    {
        f(".gmini .search-ingress").insertBefore(".search-container");
    }
    function o()
    {
        f("#page-menu ul.menu li.collapsed").mouseout(function ()
        {
            setTimeout(function ()
            {
                Cufon.replace("#page-menu ul.menu li.collapsed a", {
                    hover: true,
                    fontFamily: "crank"
                }, true);
            }, 10);
        });
        f("#page-menu ul.menu li:not(.collapsed) > a").mouseout(function ()
        {
            setTimeout(function ()
            {
                Cufon.replace("#page-menu ul.menu li > a", {
                    hover: true,
                    fontFamily: "crank"
                }, true);
            }, 10);
        });
    }
    function d()
    {
        f("#header .site-dropdown ul.site-list li:last").addClass("last");
        try
        {
            var B = f(".site-dropdown .show-sites").attr("href");
            if (!B || B == "" || B.substr(0, 1) == "#")
            {
                f(".site-dropdown .show-sites").addClass("default");
            }
        }
        catch (A)
        {}
        var C, z;
        f("#header .site-dropdown ul.site-list").hide();
        f("#header .site-dropdown").hover(function ()
        {
            if (!z)
            {
                C = true;
                setTimeout(function ()
                {
                    f("#header .site-dropdown").addClass("active");
                }, 60);
                f("#header .site-dropdown ul.site-list").slideDown("fast", function ()
                {
                    C = false;
                });
            }
        }, function ()
        {
            if (!C)
            {
                z = true;
                setTimeout(function ()
                {
                    f("#header .site-dropdown ul.site-list").slideUp("fast", function ()
                    {
                        z = false;
                        f("#header .site-dropdown").removeClass("active");
                    });
                }, 180);
            }
        });
    }
    function v()
    {
        Gallery.setup("#image-gallery #panes", {
            autoScroll: true
        });
        if (f("#image-gallery #panes .view .pane").length <= 2)
        {
            f("#image-gallery #controls").addClass("pm-only");
        }
        else
        {
            f("#image-gallery #controls .next").click(function (J)
            {
                preventDefault(J);
                Gallery.next();
                return false;
            });
            f("#image-gallery #controls .prev").click(function (J)
            {
                preventDefault(J);
                Gallery.prev();
                return false;
            });
        }
        var A = f("#image-gallery #panes .pane a"),
            F = null,
            G = "",
            H, z, I, B, D;
        for (var E = 0, C = A.length; E < C; E++)
        {
            F = A[E];
            z = f(F).attr("href");
            B = z;
            I = f(F).attr("title");
            if (f(F).siblings(".text").get(0))
            {
                I = f.trim(f(F).siblings(".text").html());
            }
            G = e.fancyboxGallery.apply(
            {
                src: z,
                index: (E + 1),
                count: C,
                text: I,
                download_url: B
            });
            if (E == 0)
            {
                f(F).addClass("first");
            }
            else
            {
                if ((E + 1) == C)
                {
                    f(F).addClass("last");
                }
            }
            w(F, G);
        }
        f("#fancybox-left").click(k);
        f("#fancybox-right").click(l);
        f("#fancybox-close").click(j);
    }
    var x = null;
    var n = true;

    function w(A, z)
    {
        f(A).fancybox(
        {
            autoDimensions: false,
            titleShow: false,
            padding: 0,
            width: 710,
            height: 522,
            content: z,
            overlayOpacity: 0.75,
            overlayColor: "#000",
            onStart: function ()
            {
                h(A);
                x = A;
                Gallery.stop();
            },
            onCleanup: function ()
            {
                if (n)
                {
                    j();
                }
                n = true;
            },
            onComplete: c
        });
    }
    function h(z)
    {
        f("#fancybox-left").attr("style", "display: block;");
        f("#fancybox-right").attr("style", "display: block;");
        if (f(z).hasClass("first"))
        {
            f("#fancybox-left").attr("style", "display: none;");
        }
        else
        {
            if (f(z).hasClass("last"))
            {
                f("#fancybox-right").attr("style", "display: none;");
            }
        }
    }
    function l()
    {
        if (x)
        {
            if (!f(x).hasClass("last"))
            {
                x = f(x).parent().next(".pane").children("a").get(0);
                n = false;
                f(x).trigger("click");
                h(x);
            }
        }
    }
    function k()
    {
        if (x)
        {
            if (!f(x).hasClass("first"))
            {
                x = f(x).parent().prev(".pane").children("a").get(0);
                n = false;
                f(x).trigger("click");
                h(x);
            }
        }
    }
    function j()
    {
        x = null;
        Gallery.start();
    }
    function m()
    {
        var A = f(".section.picture .image-container a"),
            E = null,
            G = "",
            z, H, B, D;
        for (var F = 0, C = A.length; F < C; F++)
        {
            E = A[F];
            z = f(E).attr("href");
            B = z;
            H = f(E).attr("title");
            if (f(E).parent().siblings(".text").get(0))
            {
                H = f.trim(f(E).parent().siblings(".text").html());
            }
            if (f(E).parent().siblings(".expand").get(0))
            {
                f(E).parent().siblings(".expand").bind("click", {
                    element: E
                }, s);
            }
            D = "a[href=#" + f(E).parent().parent().attr("id") + "]";
            if (f(D).get(0))
            {
                f(D).bind("click", {
                    element: E
                }, s);
            }
            G = e.fancyboxSimple.apply(
            {
                src: z,
                text: H,
                download_url: B
            });
            f(E).fancybox(
            {
                autoDimensions: false,
                titleShow: false,
                padding: 0,
                width: 710,
                height: 522,
                content: G,
                overlayOpacity: 0.75,
                overlayColor: "#000",
                onStart: function ()
                {
                    if (f("#image-gallery").get(0))
                    {
                        Gallery.stop();
                    }
                },
                onComplete: c
            });
        }
    }
    function c()
    {
        var A = Number(f("#fancybox-inner").css("width").replace("px", ""));
        var z = Number(f("#fancybox-inner").css("height").replace("px", ""));
        if ((A < 710) || (z < 522))
        {
            f("#fancybox-inner, #fancybox-wrap").css("width", "710px");
            f("#fancybox-inner, #fancybox-wrap").css("height", "522px");
        }
    }
    function u()
    {
        f("#projects-and-plants .column .list-element").hover(function ()
        {
            f(this).addClass("list-element-hover");
        }, function ()
        {
            f(this).removeClass("list-element-hover");
        });
    }
    function s(A)
    {
        try
        {
            f(A.data.element).trigger("click");
        }
        catch (z)
        {}
        return false;
    }
    function b()
    {
        var D = f("#main-content .featured-element"),
            B, C;
        for (var A = 0, z = D.length; A < z;)
        {
            B = D[A];
            C = f(B).next().get(0);
            f(B).addClass("featured-element-first");
            if (f(C).hasClass("featured-element"))
            {
                f(C).addClass("featured-element-clear");
                A += 2;
            }
            else
            {
                f(B).addClass("featured-element-clear");
                A++;
            }
        }
    }
    return {
        init: function ()
        {
            if (f("#main-content .downloads").get(0))
            {
                p();
            }
            if (f("#main-content .gmini").get(0))
            {
                q();
            }
            if (f("#page-menu .menu .collapsed").get(0))
            {
                o();
            }
            if (f("#image-gallery #panes").get(0))
            {
                v();
            }
            if (f(".section.picture").get(0))
            {
                m();
            }
            if (f("#header .site-dropdown").get(0))
            {
                d();
            }
            if (f(".list-element.image h2").get(0))
            {
                f(".list-element.image .hr").addClass("hr-first");
            }
            if (f("#nav .menu li.selected").get(0))
            {
                f("#nav .menu li.selected").append('<span class="shadow"></span>');
            }
            if (f("#projects-and-plants .column .list-element").get(0) && Page.isIE6)
            {
                u();
            }
            if (f(".list-element.player").get(0))
            {
                f(".list-element.player").addClass("list-element-player");
            }
            if (f("#main-content .featured-element").get(0))
            {
                b();
            }
        },
        printImage: function (A)
        {
            var z = routes.print + "?image=" + A;
            lbPrintWindow = window.open(z, i.title, t.join(", "));
        }
    };
}(jQuery);
/**
 * @name InfoBox
 * @version 1.0.2 [June 26, 2010]
 * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)
 * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]
 * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.
 */

/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

function InfoBox(A)
{
    A = A || {};
    google.maps.OverlayView.apply(this, arguments);
    this.content_ = A.content || "";
    this.disableAutoPan_ = A.disableAutoPan || false;
    this.maxWidth_ = A.maxWidth || 0;
    this.pixelOffset_ = A.pixelOffset || new google.maps.Size(0, 0);
    this.position_ = A.position || new google.maps.LatLng(0, 0);
    this.zIndex_ = A.zIndex || null;
    this.boxStyle_ = A.boxStyle || {};
    this.closeBoxMargin_ = A.closeBoxMargin || "2px";
    this.closeBoxURL_ = A.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif";
    if (A.closeBoxURL === "")
    {
        this.closeBoxURL_ = "";
    }
    this.infoBoxClearance_ = A.infoBoxClearance || new google.maps.Size(1, 1);
    this.isHidden_ = A.isHidden || false;
    this.pane_ = A.pane || "floatPane";
    this.enableEventPropagation_ = A.enableEventPropagation || false;
    this.div_ = null;
    this.closeListener_ = null;
    this.eventListener1_ = null;
    this.eventListener2_ = null;
    this.eventListener3_ = null;
    this.contextListener_ = null;
    this.fixedWidthSet_ = null;
}
function loadInfoBox()
{
    InfoBox.prototype = new google.maps.OverlayView();
    InfoBox.prototype.createInfoBoxDiv_ = function ()
    {
        var D;
        var A = this;
        var B = function (E)
            {
                E.cancelBubble = true;
                if (E.stopPropagation)
                {
                    E.stopPropagation();
                }
            };
        var C = function (E)
            {
                E.returnValue = false;
                if (E.preventDefault)
                {
                    E.preventDefault();
                }
                if (!A.enableEventPropagation_)
                {
                    B(E);
                }
            };
        if (!this.div_)
        {
            this.div_ = document.createElement("div");
            this.setBoxStyle_();
            this.div_.style.position = "absolute";
            this.div_.style.visibility = "hidden";
            if (this.zIndex_ !== null)
            {
                this.div_.style.zIndex = this.zIndex_;
            }
            if (typeof this.content_.nodeType === "undefined")
            {
                this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;
            }
            else
            {
                this.div_.innerHTML = this.getCloseBoxImg_();
                this.div_.appendChild(this.content_);
            }
            this.getPanes()[this.pane_].appendChild(this.div_);
            this.addClickHandler_();
            if (this.div_.style.width)
            {
                this.fixedWidthSet_ = true;
            }
            else
            {
                if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_)
                {
                    this.div_.style.width = this.maxWidth_;
                    this.div_.style.overflow = "auto";
                    this.fixedWidthSet_ = true;
                }
                else
                {
                    D = this.getBoxWidths_();
                    this.div_.style.width = (this.div_.offsetWidth - D.left - D.right) + "px";
                    this.fixedWidthSet_ = false;
                }
            }
            this.panBox_(this.disableAutoPan_);
            if (!this.enableEventPropagation_)
            {
                this.eventListener1_ = google.maps.event.addDomListener(this.div_, "mousedown", B);
                this.eventListener2_ = google.maps.event.addDomListener(this.div_, "click", B);
                this.eventListener3_ = google.maps.event.addDomListener(this.div_, "dblclick", B);
            }
            this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", C);
            google.maps.event.trigger(this, "domready");
        }
    };
    InfoBox.prototype.getCloseBoxImg_ = function ()
    {
        var A = "";
        if (this.closeBoxURL_ !== "")
        {
            A = "<img";
            A += " src='" + this.closeBoxURL_ + "'";
            A += " align=right";
            A += " style='";
            A += " position: relative;";
            A += " cursor: pointer;";
            A += " margin: " + this.closeBoxMargin_ + ";";
            A += "'>";
        }
        return A;
    };
    InfoBox.prototype.addClickHandler_ = function ()
    {
        var A;
        if (this.closeBoxURL_ !== "")
        {
            A = this.div_.firstChild;
            this.closeListener_ = google.maps.event.addDomListener(A, "click", this.getCloseClickHandler_());
        }
        else
        {
            this.closeListener_ = null;
        }
    };
    InfoBox.prototype.getCloseClickHandler_ = function ()
    {
        var A = this;
        return function ()
        {
            A.close();
            google.maps.event.trigger(A, "closeclick");
        };
    };
    InfoBox.prototype.panBox_ = function (A)
    {
        if (!A)
        {
            var Y = this.getMap();
            var F = Y.getBounds();
            var S = Y.getDiv();
            var U = S.offsetWidth;
            var R = S.offsetHeight;
            var Z = F.toSpan();
            var T = Z.lng();
            var J = Z.lat();
            var M = T / U;
            var I = J / R;
            var H = F.getSouthWest().lng();
            var O = F.getNorthEast().lng();
            var X = F.getNorthEast().lat();
            var C = F.getSouthWest().lat();
            var a = this.position_;
            var G = this.pixelOffset_.width;
            var E = this.pixelOffset_.height;
            var N = this.infoBoxClearance_.width;
            var L = this.infoBoxClearance_.height;
            var B = a.lng() + (G - N) * M;
            var D = a.lng() + (G + this.div_.offsetWidth + N) * M;
            var Q = a.lat() - (E - L) * I;
            var K = a.lat() - (E + this.div_.offsetHeight + L) * I;
            var P = (B < H ? H - B : 0) + (D > O ? O - D : 0);
            var W = (Q > X ? X - Q : 0) + (K < C ? C - K : 0);
            if (!(W === 0 && P === 0))
            {
                var V = Y.getCenter();
                Y.setCenter(new google.maps.LatLng(V.lat() - W, V.lng() - P));
            }
        }
    };
    InfoBox.prototype.setBoxStyle_ = function ()
    {
        var A;
        var B = this.boxStyle_;
        for (A in B)
        {
            if (B.hasOwnProperty(A))
            {
                this.div_.style[A] = B[A];
            }
        }
        if (typeof this.div_.style.opacity !== "undefined")
        {
            this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
        }
    };
    InfoBox.prototype.getBoxWidths_ = function ()
    {
        var A;
        var C = {
            top: 0,
            bottom: 0,
            left: 0,
            right: 0
        };
        var B = this.div_;
        if (document.defaultView && document.defaultView.getComputedStyle)
        {
            A = B.ownerDocument.defaultView.getComputedStyle(B, "");
            if (A)
            {
                C.top = parseInt(A.borderTopWidth, 10) || 0;
                C.bottom = parseInt(A.borderBottomWidth, 10) || 0;
                C.left = parseInt(A.borderLeftWidth, 10) || 0;
                C.right = parseInt(A.borderRightWidth, 10) || 0;
            }
        }
        else
        {
            if (document.documentElement.currentStyle)
            {
                if (B.currentStyle)
                {
                    C.top = parseInt(B.currentStyle.borderTopWidth, 10) || 0;
                    C.bottom = parseInt(B.currentStyle.borderBottomWidth, 10) || 0;
                    C.left = parseInt(B.currentStyle.borderLeftWidth, 10) || 0;
                    C.right = parseInt(B.currentStyle.borderRightWidth, 10) || 0;
                }
            }
        }
        return C;
    };
    InfoBox.prototype.onRemove = function ()
    {
        if (this.div_)
        {
            this.div_.parentNode.removeChild(this.div_);
            this.div_ = null;
        }
    };
    InfoBox.prototype.draw = function ()
    {
        this.createInfoBoxDiv_();
        var A = this.getProjection().fromLatLngToDivPixel(this.position_);
        this.div_.style.left = (A.x + this.pixelOffset_.width) + "px";
        this.div_.style.top = (A.y + this.pixelOffset_.height) + "px";
        if (this.isHidden_)
        {
            this.div_.style.visibility = "hidden";
        }
        else
        {
            this.div_.style.visibility = "visible";
        }
    };
    InfoBox.prototype.setOptions = function (A)
    {
        if (typeof A.boxStyle !== "undefined")
        {
            this.boxStyle_ = A.boxStyle;
            this.setBoxStyle_();
        }
        if (typeof A.content !== "undefined")
        {
            this.setContent(A.content);
        }
        if (typeof A.disableAutoPan !== "undefined")
        {
            this.disableAutoPan_ = A.disableAutoPan;
        }
        if (typeof A.maxWidth !== "undefined")
        {
            this.maxWidth_ = A.maxWidth;
        }
        if (typeof A.pixelOffset !== "undefined")
        {
            this.pixelOffset_ = A.pixelOffset;
        }
        if (typeof A.position !== "undefined")
        {
            this.setPosition(A.position);
        }
        if (typeof A.zIndex !== "undefined")
        {
            this.setZIndex(A.zIndex);
        }
        if (typeof A.closeBoxMargin !== "undefined")
        {
            this.closeBoxMargin_ = A.closeBoxMargin;
        }
        if (typeof A.closeBoxURL !== "undefined")
        {
            this.closeBoxURL_ = A.closeBoxURL;
        }
        if (typeof A.infoBoxClearance !== "undefined")
        {
            this.infoBoxClearance_ = A.infoBoxClearance;
        }
        if (typeof A.isHidden !== "undefined")
        {
            this.isHidden_ = A.isHidden;
        }
        if (typeof A.enableEventPropagation !== "undefined")
        {
            this.enableEventPropagation_ = A.enableEventPropagation;
        }
        if (this.div_)
        {
            this.draw();
        }
    };
    InfoBox.prototype.setContent = function (A)
    {
        this.content_ = A;
        if (this.div_)
        {
            if (this.closeListener_)
            {
                google.maps.event.removeListener(this.closeListener_);
                this.closeListener_ = null;
            }
            if (!this.fixedWidthSet_)
            {
                this.div_.style.width = "";
            }
            if (typeof A.nodeType === "undefined")
            {
                this.div_.innerHTML = this.getCloseBoxImg_() + A;
            }
            else
            {
                this.div_.innerHTML = this.getCloseBoxImg_();
                this.div_.appendChild(A);
            }
            if (!this.fixedWidthSet_)
            {
                this.div_.style.width = this.div_.offsetWidth + "px";
                this.div_.innerHTML = this.getCloseBoxImg_() + A;
            }
            this.addClickHandler_();
        }
        google.maps.event.trigger(this, "content_changed");
    };
    InfoBox.prototype.setPosition = function (A)
    {
        this.position_ = A;
        if (this.div_)
        {
            this.draw();
        }
        google.maps.event.trigger(this, "position_changed");
    };
    InfoBox.prototype.setZIndex = function (A)
    {
        this.zIndex_ = A;
        if (this.div_)
        {
            this.div_.style.zIndex = A;
        }
        google.maps.event.trigger(this, "zindex_changed");
    };
    InfoBox.prototype.getContent = function ()
    {
        return this.content_;
    };
    InfoBox.prototype.getPosition = function ()
    {
        return this.position_;
    };
    InfoBox.prototype.getZIndex = function ()
    {
        return this.zIndex_;
    };
    InfoBox.prototype.show = function ()
    {
        this.isHidden_ = false;
        this.div_.style.visibility = "visible";
    };
    InfoBox.prototype.hide = function ()
    {
        this.isHidden_ = true;
        this.div_.style.visibility = "hidden";
    };
    InfoBox.prototype.open = function (B, A)
    {
        if (A)
        {
            this.position_ = A.getPosition();
        }
        this.setMap(B);
        if (this.div_)
        {
            this.panBox_();
        }
    };
    InfoBox.prototype.close = function ()
    {
        if (this.closeListener_)
        {
            google.maps.event.removeListener(this.closeListener_);
            this.closeListener_ = null;
        }
        if (this.eventListener1_)
        {
            google.maps.event.removeListener(this.eventListener1_);
            google.maps.event.removeListener(this.eventListener2_);
            google.maps.event.removeListener(this.eventListener3_);
            this.eventListener1_ = null;
            this.eventListener2_ = null;
            this.eventListener3_ = null;
        }
        if (this.contextListener_)
        {
            google.maps.event.removeListener(this.contextListener_);
            this.contextListener_ = null;
        }
        this.setMap(null);
    };
}
var Project = function (H)
    {
        var R;
        var A;
        var P = 125;
        var Y;
        var B;
        var S = [];
        var F;
        var C;
        var M = "/images/project/marker.png";
        var E = new Image();
        if (E)
        {
            E.src = M;
        }
        var J;
        var c;
        var Q;
        var V;
        var b = -1;
        var O = H.template('<div class="infoWindow"><div class="content"><h2><span>${name}</span></h2><a class="close" onclick="Project.closeInfoWindow();"><span>&nbsp;</span></a><div class="hr"><hr /></div><div class="wrap clearfix">${html}</div></div></div>');

        function X(d)
        {
            R = d;
        }
        function N(d)
        {
            return R;
        }
        function I()
        {
            if (Y)
            {
                var d = N();
                d.mapTypeId = google.maps.MapTypeId.SATELLITE;
                C = new google.maps.Map(H("#map-canvas").get(0), N());
                Z();
            }
            B = true;
        }
        function Z()
        {
            if (C && F)
            {
                loadInfoBox();
                var f;
                for (var e = 0, d = S.length; e < d; e++)
                {
                    f = S[e];
                    a(f, e + 1);
                }
                google.maps.event.addListener(C, "bounds_changed", function ()
                {
                    b--;
                    if (b == 0)
                    {
                        C.panBy(28, 102);
                        window.setTimeout(K, P * 2);
                    }
                });
            }
            else
            {
                window.setTimeout(Z, P);
            }
        }
        function a(k, i)
        {
            var e = new google.maps.LatLng(k.coord.lat, k.coord.lng);
            var g = new google.maps.Marker(
            {
                position: e,
                map: C,
                icon: M
            });
            var h = "";
            var d = "project-" + i;
            if (k.image)
            {
                h += '<div class="image-container"><img src="' + k.image + '" width="220" height="147" /></div>';
            }
            if (k.facts)
            {
                h += k.facts;
            }
            if (k.content)
            {
                h += k.content;
            }
            if (k.link)
            {
                h += '<a href="' + k.link + '">Read more</a>';
            }            
            var j = O.apply(
            {
                name: k.name,
                html: h
            });
            H(document.body).append('<div style="display: none;" id="' + d + '">' + j + "</div>");
            Cufon.replace("#" + d + " .infoWindow h2 span", {
                fontFamily: "crank"
            });
            var f = new InfoBox(
            {
                "class": "infoWindow",
                content: j,
                width: 210,
                height: 285,
                pane: "mapPane",
                disableAutoPan: true
            });
            var l = Number(k.coord.zoom);
            google.maps.event.addListener(g, "click", function ()
            {
                if (J && c)
                {
                    try
                    {
                        J.close();
                    }
                    catch (m)
                    {}
                }
                J = Q = V = null;
                J = f;
                Q = g;
                V = k;
                b = 2;
                C.setCenter(e);
                if (C.getZoom() == l)
                {
                    b = 1;
                }
                else
                {
                    C.setZoom(l);
                }
            });
        }
        function K()
        {
            J.open(C, Q);
            c = true;
            window.setTimeout(G, P);
        }
        function G()
        {
            if (H("#main-content .infoWindow").get(0))
            {
                H("#main-content .infoWindow").parent().parent().css("z-index", 1000);
                H("#main-content .infoWindow").prev("img").css("display", "none");
            }
            else
            {
                window.setTimeout(G, P);
            }
        }
        function U(h)
        {
            var f = "http://maps.google.com/maps/api/js?sensor=false&language=" + h;
            try
            {
                document.write('<script type="text/javascript" src="' + f + '"><\/script>');
            }
            catch (g)
            {
                var d = document.createElement("script");
                d.type = "text/javascript";
                d.src = f;
                document.getElementsByTagName("head")[0].appendChild(d);
            }
            A = window.setInterval(T, P);
        }
        function D(d)
        {
            H.ajax(
            {
                type: "GET",
                url: d,
                dataType: "xml",
                contentType: "text/xml",
                success: L,
                error: W
            });
        }
        function L(j)
        {
            var h = H(j).find("project"),
                f, k;
            var g = new RegExp("<p");
            for (var e = 0, d = h.length; e < d; e++)
            {
                f = h[e];
                k = {};
                k.coord = {};
                k.name = H(f).find("name").text();
                if (H(f).find("facts").get(0))
                {
                    k.facts = H(f).find("facts").text();
                }
                if (H(f).find("content").get(0))
                {
                    k.content = H(f).find("content").text();
                    if (!g.test(k.content))
                    {
                        k.content = "<p>" + k.content + "</p>";
                    }
                }
                if (H(f).find("img").get(0))
                {
                    k.image = H(f).find("img").attr("src");
                }
                if (H(f).find("coord").get(0))
                {
                    k.coord.lat = H(f).find("coord lat").text();
                    k.coord.lng = H(f).find("coord lng").text();
                    k.coord.zoom = H(f).find("coord zoom").text();
                }
                if (H(f).find("link").get(0))
                {
                    k.link = H(f).find("link").attr("href");
                }
                S[S.length] = k;
            }
            F = true;
        }
        function W(d, f, e)
        {}
        function T()
        {
            try
            {
                var e = N();
                e.center = new google.maps.LatLng(e.lat, e.lng);
                X(e);
                window.clearInterval(A);
                Y = true;
                if (B)
                {
                    I();
                }
            }
            catch (d)
            {}
        }
        return {
            setup: function (h, f, g, e, d)
            {
                d = d || {};
                d.zoom = g;
                d.lat = h;
                d.lng = f;
                d.language = d.language || "no";
                X(d);
                U(d.language);
                D(e);
                H(document).ready(I);
            },
            getMap: function ()
            {
                return C;
            },
            closeInfoWindow: function ()
            {
                try
                {
                    J.close();
                    c = false;
                }
                catch (d)
                {}
            }
        };
    }(jQuery);
var Gallery = function (H)
    {
        var S = {
            view: ".view",
            children: ".pane",
            interval: 3125,
            duration: 1250,
            fps: 50
        };
        var N = null;
        var I = null;
        var M = false;
        var P = false;
        var F = 0;
        var E = 0;
        var L = 0;
        var R = false;
        var T = false;
        var G = false;

        function A(Y)
        {
            for (var Z in Y)
            {
                S[Z] = Y[Z];
            }
            return S;
        }
        function W(Y)
        {
            S = Y;
        }
        function Q()
        {
            if (P)
            {
                O();
            }
            F = window.setInterval(V, S.interval);
            P = true;
            G = false;
        }
        function O()
        {
            if (!P || R)
            {
                if (R)
                {
                    G = true;
                }
                return;
            }
            window.clearInterval(F);
            P = false;
            G = false;
        }
        function K()
        {
            window.clearInterval(F);
        }
        function V()
        {
            if (R || T)
            {
                if (!T)
                {
                    T = true;
                }
                else
                {
                    return;
                }
            }
            if (P)
            {
                K();
            }
            var Y = (E + S.moveBy),
                c = -X(E),
                b = -X(Y),
                Z = S.duration;
            if (((Y + 1) == I.length) && (S.moveBy > 1))
            {
                b = -X(Y - 1);
            }
            else
            {
                if (Y > I.length)
                {
                    var a = Y - S.moveBy;
                    if ((a + 1 == I.length) && (S.moveBy > 1))
                    {
                        c = -X(a - 1);
                    }
                    b = 0;
                    Y = 0;
                    if ((S.moveBy * 2) < I.length)
                    {
                        Z /= 3;
                    }
                }
            }
            if (T)
            {
                c = Number(H(N).css("left").replace("px", ""));
                if (b == 0)
                {
                    return;
                }
                C();
            }
            D(c, b, Z);
            E = Y;
        }
        function U()
        {
            if (R || T)
            {
                if (!T)
                {
                    T = true;
                }
                else
                {
                    return;
                }
            }
            if (P)
            {
                K();
            }
            var Y = (E - S.moveBy),
                b = -X(E),
                a = -X(Y),
                Z = S.duration;
            if ((E + 1 == I.length) && (S.moveBy > 1))
            {
                b = -X(Y + 1);
            }
            else
            {
                if (Y < 0)
                {
                    Y = I.length - S.moveBy;
                    b = 0;
                    a = -X(Y);
                    if ((S.moveBy * 2) < I.length)
                    {
                        Z /= 3;
                    }
                    if ((S.moveBy > 1) && ((Y % S.moveBy) > 0))
                    {
                        Y += 1;
                    }
                }
            }
            if (T)
            {
                if (b == 0)
                {
                    return;
                }
                b = Number(H(N).css("left").replace("px", ""));
                C();
            }
            D(b, a, Z);
            E = Y;
        }
        function D(i, h, e)
        {
            R = true;
            var a = 0;
            var Y = i;
            var g = h - i;
            var f = e;
            var Z = Math.round(1000 / S.fps);
            L = window.setInterval(function ()
            {
                a += Z;
                J(a, Y, g, f);
            }, Z);
        }
        function C()
        {
            window.clearInterval(L);
            if (G)
            {
                O();
            }
            else
            {
                if (P && !G)
                {
                    Q();
                }
            }
            T = false;
            R = false;
        }
        function J(a, Y, f, e)
        {
            if (a > e)
            {
                a = e;
            }
            var Z = B(a, Y, f, e);
            H(N).css("left", Z + "px");
            if (a == e)
            {
                C();
            }
        }
        function X(Y)
        {
            return (Y * S.elementWidth) + (Y * S.elementOffset);
        }
        function B(Z, Y, e, a)
        {
            if ((Z /= a / 2) < 1)
            {
                return e / 2 * Z * Z + Y;
            }
            return -e / 2 * ((--Z) * (Z - 2) - 1) + Y;
        }
        return {
            setup: function (Z, Y)
            {
                Y = A(Y);
                if (!Y.width)
                {
                    Y.width = H(Z).width();
                }
                N = H(Z).find(Y.view).get(0);
                I = H(N).find(Y.children);
                var b = I.length,
                    Z = I[0];
                Y.elementWidth = H(Z).width();
                Y.elementVisible = Math.floor(Y.width / Y.elementWidth);
                Y.elementOffset = Y.width - (Y.elementVisible * Y.elementWidth);
                M = (I.length > Y.elementVisible);
                if (!Y.moveBy)
                {
                    Y.moveBy = Y.elementVisible;
                }
                var a = (Y.elementOffset * b) + (Y.elementWidth * b);
                H(N).width(a);
                W(Y);
                if (Y.autoScroll && M)
                {
                    Gallery.start();
                }
            },
            activeElement: function ()
            {
                var Y = E;
                if ((Y + S.moveBy) > I.length && (S.moveBy > 1))
                {
                    Y -= 1;
                }
                return Y;
            },
            next: function ()
            {
                if (!M)
                {
                    return;
                }
                V();
            },
            prev: function ()
            {
                if (!M)
                {
                    return;
                }
                U();
            },
            start: function ()
            {
                if (!M)
                {
                    return;
                }
                Q();
            },
            stop: function ()
            {
                if (!M)
                {
                    return;
                }
                O();
            }
        };
    }(jQuery);


if (!Page.isPrintMode)
{
    Cufon.replace('#featured h2', {
        fontFamily: 'crank'
    });
    Cufon.replace('#featured h3', {
        fontFamily: 'crank'
    });
    Cufon.replace('#featured p', {
		'hover': true,
        fontFamily: 'crank'
    });
    Cufon.replace('#featured .about li', {
        fontFamily: 'crank'
    });
    Cufon.replace('#featured a', {
        'hover': true,
        fontFamily: 'crank'
    });
    Cufon.replace('#featured dt', {
        fontFamily: 'crank'
    });

    Cufon.replace('#nav ul.menu li a', {
        'hover': true,
        fontFamily: 'crank'
    });
    Cufon.replace('#page-menu ul.menu li.collapsed a', {
        'hover': true,
        fontFamily: 'crank'
    });
    Cufon.replace('#page-menu ul.menu li a', {
        'hover': true,
        fontFamily: 'crank'
    });
    Cufon.replace('#main-content h1.title span', {
        fontFamily: 'crank'
    });
    Cufon.replace('#main-content .ingress span', {
        fontFamily: 'crank_light'
    });
    Cufon.replace('#main-content .column h2 span', {
        fontFamily: 'crank'
    });
    Cufon.replace('#secondary-content .facts h3 span', {
        fontFamily: 'crank'
    });
    Cufon.replace('#main-content .person h2.title span', {
        fontFamily: 'crank'
    });
    Cufon.replace('#content #image-gallery h2.title span', {
        fontFamily: 'crank'
    });
    Cufon.replace('#main-content #featured.crisis .content .head .date', {
        fontFamily: 'crank'
    });
    Cufon.replace('#main-content .featured-elements .element .title', {
        fontFamily: 'crank',
        'hover': true,
        hoverables: {
            a: true
        }
    });
    Cufon.replace('#main-content .featured-elements .element p.description', {
        fontFamily: 'crank',
        'hover': true,
        hoverables: {
            a: true
        }
    });
    Cufon.replace('#main-content #object-container .statement p span', {
        fontFamily: 'crank'
    });
} /* The routes object */
var routes = {};

/**
 * Lightbox routes
 *
 * 1. Print images from lightbox
 */
routes["print"] = "/LightboxPrint.php";
jQuery(document).ready(function ()
{
    Page.content.init();
});
