﻿/**
 * Progression is (C) taka:nium and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 */
var progression, Progression, SWFObject, SWFForceSize;
(function() {
    var n = document, i = swfobject, j = function(a) {
        return n.getElementById(a)
    }, s = function(a) {
        return n.getElementsByTagName(a)
    }, H = function(a, c) {
        switch (a) {
        case null:
        case undefined: {
            return c
        }
        }
        return a
    }, k = "flashcontent", t = {}, I = {
        url : "preloader.swf",
        replaceElementId : "attention",
        width : 640,
        height : 480,
        adjustHorizontal : false,
        adjustVertical : false,
        centering : true,
        version : "9.0.45",
        useExpressInstall : true,
        flashvars : {},
        params : {
            bgcolor : "#FFFFFF",
            wmode : "window",
            allowfullscreen : true,
            allowscriptaccess : "samedomain"
        },
        attributes : {}
    };
    var J = function(b) {
        t = b;
        (function(a, c) {
            for ( var g in c) {
                var h = a[g];
                var u = c[g];
                switch (typeof (h)) {
                case "object": {
                    arguments.callee(h, u);
                    break
                }
                default: {
                    a[g] = H(h, u)
                }
                }
            }
        })(b, I);
        b.attributes.id = b.attributes.name = "external_" + k;
        var v = (b.centering && !b.adjustHorizontal);
        var w = (b.centering && !b.adjustVertical);
        var x = b.adjustHorizontal ? "100%" : b.width + "px";
        var y = b.adjustVertical ? "100%" : b.height + "px";
        var z = v ? "50%" : "0";
        var A = w ? "50%" : "0";
        var B = v ? "-" + Math.ceil(b.width / 2) + "px" : "0";
        var C = w ? "-" + Math.ceil(b.height / 2) + "px" : "0";
        var K = b.useExpressInstall ? "contents/scripts/swfobject/expressinstall.swf"
                : undefined;
        var o = [ "html", "body" ];
//        for ( var l = 0, L = o.length; l < L; l++) {
//            var d = s(o[l])[0];
//            if (d) {
//                d.style.height = "100%";
//                d.style.overflow = "auto";
//                d.style.margin = "0";
//                d.style.padding = "0";
//                d.style.background = b.params.bgcolor
//            } else {
//                i.createCSS(o[l],
//                        "height:100%;overflow:auto;margin:0;padding:0;background:"
//                                + b.params.bgcolor + ";")
//            }
//        }
        var D = j(k);
        if (D) {
            var e = D.style;
            e.width = x;
            e.height = y;
            e.left = z;
            e.top = A;
            e.marginLeft = B;
            e.marginTop = C
        } else {
            i.createCSS("#" + k, "width:" + x + "; height:" + y + "; left:" + z
                    + "; top:" + A + "; margin-left:" + B + "; margin-top:" + C
                    + ";")
        }
        i.embedSWF(b.url, b.replaceElementId, "100%", "100%", b.version, K,
                b.flashvars, b.params, b.attributes);
        i.addLoadEvent(M)
    };
    var M = function() {
        ((j("disabled_javascript") || {}).style || {}).display = "none";
        var a = t;
        if (SWFForceSize && a.adjustHorizontal && a.adjustVertical) {
            var c = new SWFForceSize(j(k), a.width, a.height);
            c.onLoadDiv()
        }
    };
    progression = function() {
    };
    progression.embedSWF = J;
    var E, F, p, q, G, m, f, r;
    Progression = function(a) {
        ((j("enableJavaScript") || {}).style || {}).display = "none";
        F = a;
        n
                .write('<link rel="stylesheet" type="text/css" href="contents/styles/progression.css" />')
    };
    Progression.prototype = {
        onLoad : function() {
        },
        init : function() {
            G = (this.onLoad.toString().indexOf(
                    "var forceSize = new SWFForceSize") > 0);
            this.onLoad()
        }
    };
    SWFObject = function(a, c, g, h) {
        E = a;
        p = g;
        q = h;
        m = {};
        f = {};
        r = {}
    };
    SWFObject.prototype = {
        useExpressInstall : function(a) {
        },
        setAttribute : function(a, c) {
            r[a] = c
        },
        getAttribute : function(a) {
            return r[a]
        },
        addParam : function(a, c) {
            f[a] = c
        },
        getParams : function() {
            return f[name]
        },
        addVariable : function(a, c) {
            m[a] = c
        },
        getVariable : function(a) {
            return m
        },
        getVariables : function() {
            return m
        },
        getVariablePairs : function() {
        },
        getSWFHTML : function() {
        },
        write : function(a) {
            var c = s("head")[0].innerHTML;
            c = c.split(" ").join("").split("\t").join("");
            if (!G) {
                SWFForceSize = null
            }
            progression.embedSWF( {
                url : E,
                version : F,
                width : parseInt(p),
                height : parseInt(q),
                adjustHorizontal : (p == "100%"),
                adjustVertical : (q == "100%"),
                centering : (c.indexOf("left:50%;") > 0 && c
                        .indexOf("top:50%;") > 0),
                flashvars : {},
                params : {
                    bgcolor : f["bgcolor"],
                    wmode : f["wmode"],
                    allowscriptaccess : f["allowScriptAccess"]
                },
                attributes : {}
            });
            return false
        }
    }
})();
