var Time = {};
y5.namespace("Time", "time.js");
y5.block("Time:");
y5.on("load", function ()
{
    y5.require("Time:PageLayout", function ()
    {
        Time.PageLayout.initOnce(pagetype)
    })
}, window);
if (window.clipboardData && window.clipboardData.setData) {
    document.documentElement.className += " copy-to-clipboard-available"
}
function copyToClipboard(a)
{
    if (clipboardData && clipboardData.setData) {
        clipboardData.setData("Text", a)
    }
}
function clean(b)
{
    var c = b.previousSibling;
    if (c) {
        b.onblur = function ()
        {
            if (!b.value) {
                c.style.top = "";
            }
        };
        c.style.top = "-9999px";
    }
}
function cleanIfNotEmpty(b)
{
    var d = [];
    for (var a = 0; a < b.length; a++) {
        d[a] = document.getElementById(b[a])
    }
    var c = function ()
    {
        for (var e = 0; e < d.length; e++) {
            if (d[e].value) {
                clean(d[e])
            }
        }
    };
    setInterval(c, 100)
}
function getCookie(g)
{
    var f = document.cookie;
    if (f.length < 1) {
        return false
    }
    var a = f.indexOf(g + "=");
    if (a ==- 1) {
        return false
    }
    a += (g.length + 1);
    var d = f.indexOf(";", a);
    return unescape((d ==- 1) ? f.substring(a) : f.substring(a, d))
}
function isSessionValid()
{
    var a = getCookie("Session_id");
    if (!a) {
        return false
    }
    var b = a.split(".");
    if (b[2] == "1") {
        return true
    }
    var c = parseFloat(((new Date().getTime()) - b[0] * 1000 - b[1]) / 1000);
    if (b[2] == "3") {
        return c < 1209600
    }
    return c < 7200
}
var g_login, g_loginkeydown;
function login(type, rp, kspace, msg)
{
    if (isSessionValid()) {
        return true
    }
    if (!rp) {
        rp = location.href
    }
    var f = document.forms.LOGIN;
    if (!f)
    {
        var T = "tabindex=1";
        var _p = "passport.yandex.ru/passport?mode=";
        var A = "https://" + _p;
        var P = "http://" + _p;
        var PA = "position:absolute;";
        var TD = "font-size:70%;padding:0;vertical-align:middle";
        var IN = "font:120% Arial,sans-serif;margin:0;vertical-align:middle";
        var F = '<iframe frameborder=0 style="position:absolute;background:#fff' + /*@cc_on';display:expression(navigator.appVersion.indexOf(\'MSIE5.0\')==-1?\'\':\'none\')'+@*/'"></iframe>';
        var STD = ' style="' + TD + '"';
        f = document.createElement("div");
        f.innerHTML += '<div style="font-size:100%;' + PA + 'z-index:99;top:33px;left:50%;display:none;width:21.1em;margin-left:-10.5em;">' + F + F + '<form name=LOGIN class=login action="' + A + 'auth"method=post onsubmit="this.timestamp.value=new Date().getTime()"style="' + PA + 'background:#333"><div style="position:relative;top:-3px;left:-3px;border:1px solid #000;border-top-color:#666;border-left-color:#666;background:#fff"><span style="font-family:Verdana,sans-serif;font-size:85%;' + PA + 'padding:0.05em 0.55em 0.25em;color:#f8d471;background:#900">&#1087;&#1072;&#1089;&#1087;&#1086;&#1088;&#1090;</span><table cellspacing=5 style="width:100%;margin-top:17px;border-spacing:5px;border-collapse:separate;border:15px solid #fff;color:#000"><tr><td><td style="' + TD + ';width:99%;padding-bottom:10px"><a ' + T + ' style="color:#666"href="' + P + "register&amp;msg=" + (msg ? msg : "mail") + "&amp;retpath=" + rp + '">&#1047;&#1072;&#1088;&#1077;&#1075;&#1080;&#1089;&#1090;&#1088;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100;&#1089;&#1103;</a><tr><td' + STD + ">&#1051;&#1086;&#1075;&#1080;&#1085;:<td" + STD + '><input name=login style="width:99%;' + IN + '"' + T + "><tr><td" + STD + ">&#1055;&#1072;&#1088;&#1086;&#1083;&#1100;:<td" + STD + '><input name=passwd type=password style="width:99%;' + IN + '"' + T + "><tr><td><td" + STD + "><input id=z name=twoweeks " + T + ' type=checkbox value=yes style="' + IN + '"> <label for=z>&#1079;&#1072;&#1087;&#1086;&#1084;&#1085;&#1080;&#1090;&#1100; &#1084;&#1077;&#1085;&#1103;</label> <a style="margin-left:4px"tabindex=3 href="http://help.yandex.ru/passport/?id=922493"target=help><img src="http://img.yandex.net/i/i-help2.gif"width=10 height=10 border=0 alt="[?]"></a><div style="padding-top:.9em"><input type=hidden name=retpath value="' + rp + '"><input type=hidden name=timestamp>' + (kspace ? "<input type=hidden name=kspace>" : "") + '<input style="' + IN + ';margin-right:9px"type=submit ' + T + ' value="&#1042;&#1086;&#1081;&#1090;&#1080;"><input type=button style="' + IN + '"' + T + ' onclick="loginHide()"value="&#1047;&#1072;&#1082;&#1088;&#1099;&#1090;&#1100;"><div style="margin-top:1.4em"><a tabindex=2 style="color:#666"href="' + P + 'remember">&#1047;&#1072;&#1073;&#1099;&#1083;&#1080; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;?</a></div></div></table></div></form>';
        document.body.appendChild(f);
        f = document.forms.LOGIN
    }
    g_loginkeydown = document.onkeydown;
    document.onkeydown = function (e)
    {
        e = e || window.event;
        if ((e.keyCode == 27) && (!e.ctrlKey) && (!e.altKey)) {
            loginHide()
        }
    };
    if (type == 2)
    {
        var login = getCookie("yandex_login");
        type = (login && login.length > 1);
        if (type) {
            if (f.login.value != login) {
                f.login.value = login;
                f.passwd.value = "";
                type =- 1
            }
        }
    }
    f.twoweeks.checked = (type == 3);
    if (kspace) {
        f.kspace.value = kspace
    }
    f.parentNode.style.display = "block";
    var f1 = f.previousSibling;
    var f2 = f1.previousSibling;
    f1.style.width = f2.style.width = f.scrollWidth + "px";
    f1.style.height = f2.style.height = f.scrollHeight + "px";
    f2.style.margin = "-3px 0 0 -3px";
    setTimeout("document.forms.LOGIN." + (type !=- 1 ? "login" : "passwd") + ".focus()", 1);
    g_login = f;
    return false
}
function loginHide()
{
    document.onkeydown = g_loginkeydown;
    var a = g_login.parentNode;
    a.style.display = "none";
    g_login = null
}
var Raphael = (function ()
{
    var N = /[, ]+/, j, d = document, G = window, c = function ()
    {
        return j.apply(c, arguments);
    };
    c.version = "0.7.2";
    c.type = (G.SVGAngle ? "SVG" : "VML");
    c.svg = !(c.vml = c.type == "VML");
    c.idGenerator = 0;
    var a = {};
    c.fn = {};
    var o = 
    {
        cx : 0, cy : 0, fill : "#fff", "fill-opacity" : 1, font : '10px "Arial"', "font-family" : '"Arial"', 
        "font-size" : "10", gradient : 0, height : 0, opacity : 1, path : "M0,0", r : 0, rotation : 0, 
        rx : 0, ry : 0, scale : "1 1", src : "", stroke : "#000", "stroke-dasharray" : "", "stroke-linecap" : "butt", 
        "stroke-linejoin" : "butt", "stroke-miterlimit" : 0, "stroke-opacity" : 1, "stroke-width" : 1, 
        translation : "0 0", width : 0, x : 0, y : 0
    },
    q = 
    {
        cx : "number", cy : "number", fill : "colour", "fill-opacity" : "number", "font-size" : "number", 
        height : "number", opacity : "number", path : "path", r : "number", rotation : "csv", rx : "number", 
        ry : "number", scale : "csv", stroke : "colour", "stroke-opacity" : "number", "stroke-width" : "number", 
        translation : "csv", width : "number", x : "number", y : "number"
    },
    r = ["click", "dblclick", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup"];
    c.toString = function ()
    {
        return "Your browser " + (this.vml ? "doesn't " : "") + "support" + (this.svg ? "s" : "") + " SVG.\nYou are running " + unescape("Rapha%EBl%20") + this.version;
    };
    c.setWindow = function (e)
    {
        G = e;
        d = G.document;
    };
    c.hsb2rgb = function (V, T, Z)
    {
        if (typeof V == "object" && "h" in V && "s" in V && "b" in V) {
            Z = V.b;
            T = V.s;
            V = V.h
        }
        var Q, R, aa;
        if (Z == 0) {
            return {
                r : 0, g : 0, b : 0, hex : "#000"
            }
        }
        if (V > 1 || T > 1 || Z > 1) {
            V /= 255;
            T /= 255;
            Z /= 255
        }
        var S = Math.floor(V * 6), W = (V * 6) - S, P = Z * (1 - T), O = Z * (1 - (T * W)), ab = Z * (1 - (T * (1 - W)));
        Q = [Z, O, P, P, ab, Z, Z][S];
        R = [ab, Z, Z, O, P, P, ab][S];
        aa = [P, P, ab, Z, Z, O, P][S];
        Q *= 255;
        R *= 255;
        aa *= 255;
        var X = {
            r : Q, g : R, b : aa
        };
        var e = Math.round(Q).toString(16);
        if (e.length == 1) {
            e = "0" + e
        }
        var U = Math.round(R).toString(16);
        if (U.length == 1) {
            U = "0" + U
        }
        var Y = Math.round(aa).toString(16);
        if (Y.length == 1) {
            Y = "0" + Y
        }
        X.hex = "#" + e + U + Y;
        return X;
    };
    c.rgb2hsb = function (e, i, T)
    {
        if (typeof e == "object" && "r" in e && "g" in e && "b" in e) {
            T = e.b;
            i = e.g;
            e = e.r
        }
        if (typeof e == "string") {
            var V = F(e);
            e = V.r;
            i = V.g;
            T = V.b
        }
        if (e > 1 || i > 1 || T > 1) {
            e /= 255;
            i /= 255;
            T /= 255
        }
        var S = Math.max(e, i, T), O = Math.min(e, i, T), Q, P, R = S;
        if (O == S) {
            return {
                h : 0, s : 0, b : S
            }
        }
        else
        {
            var U = (S - O);
            P = U / S;
            if (e == S) {
                Q = (i - T) / U
            }
            else {
                if (i == S) {
                    Q = 2 + ((T - e) / U)
                }
                else {
                    Q = 4 + ((e - i) / U);
                }
            }
            Q /= 6;
            if (Q < 0) {
                Q += 1
            }
            if (Q > 1) {
                Q -= 1
            }
        }
        return {
            h : Q, s : P, b : R
        }
    };
    var F = function (e)
    {
        var U = 
        {
            aliceblue : "#f0f8ff", amethyst : "#96c", antiquewhite : "#faebd7", aqua : "#0ff", aquamarine : "#7fffd4", 
            azure : "#f0ffff", beige : "#f5f5dc", bisque : "#ffe4c4", black : "#000", blanchedalmond : "#ffebcd", 
            blue : "#00f", blueviolet : "#8a2be2", brown : "#a52a2a", burlywood : "#deb887", cadetblue : "#5f9ea0", 
            chartreuse : "#7fff00", chocolate : "#d2691e", coral : "#ff7f50", cornflowerblue : "#6495ed", 
            cornsilk : "#fff8dc", crimson : "#dc143c", cyan : "#0ff", darkblue : "#00008b", darkcyan : "#008b8b", 
            darkgoldenrod : "#b8860b", darkgray : "#a9a9a9", darkgreen : "#006400", darkkhaki : "#bdb76b", 
            darkmagenta : "#8b008b", darkolivegreen : "#556b2f", darkorange : "#ff8c00", darkorchid : "#9932cc", 
            darkred : "#8b0000", darksalmon : "#e9967a", darkseagreen : "#8fbc8f", darkslateblue : "#483d8b", 
            darkslategray : "#2f4f4f", darkturquoise : "#00ced1", darkviolet : "#9400d3", deeppink : "#ff1493", 
            deepskyblue : "#00bfff", dimgray : "#696969", dodgerblue : "#1e90ff", firebrick : "#b22222", 
            floralwhite : "#fffaf0", forestgreen : "#228b22", fuchsia : "#f0f", gainsboro : "#dcdcdc", 
            ghostwhite : "#f8f8ff", gold : "#ffd700", goldenrod : "#daa520", gray : "#808080", green : "#008000", 
            greenyellow : "#adff2f", honeydew : "#f0fff0", hotpink : "#ff69b4", indianred : "#cd5c5c", 
            indigo : "#4b0082", ivory : "#fffff0", khaki : "#f0e68c", lavender : "#e6e6fa", lavenderblush : "#fff0f5", 
            lawngreen : "#7cfc00", lemonchiffon : "#fffacd", lightblue : "#add8e6", lightcoral : "#f08080", 
            lightcyan : "#e0ffff", lightgoldenrodyellow : "#fafad2", lightgreen : "#90ee90", lightgrey : "#d3d3d3", 
            lightpink : "#ffb6c1", lightsalmon : "#ffa07a", lightsalmon : "#ffa07a", lightseagreen : "#20b2aa", 
            lightskyblue : "#87cefa", lightslategray : "#789", lightsteelblue : "#b0c4de", lightyellow : "#ffffe0", 
            lime : "#0f0", limegreen : "#32cd32", linen : "#faf0e6", magenta : "#f0f", maroon : "#800000", 
            mediumaquamarine : "#66cdaa", mediumblue : "#0000cd", mediumorchid : "#ba55d3", mediumpurple : "#9370db", 
            mediumseagreen : "#3cb371", mediumslateblue : "#7b68ee", mediumslateblue : "#7b68ee", mediumspringgreen : "#00fa9a", 
            mediumturquoise : "#48d1cc", mediumvioletred : "#c71585", midnightblue : "#191970", mintcream : "#f5fffa", 
            mistyrose : "#ffe4e1", moccasin : "#ffe4b5", navajowhite : "#ffdead", navy : "#000080", oldlace : "#fdf5e6", 
            olive : "#808000", olivedrab : "#6b8e23", orange : "#ffa500", orangered : "#ff4500", orchid : "#da70d6", 
            palegoldenrod : "#eee8aa", palegreen : "#98fb98", paleturquoise : "#afeeee", palevioletred : "#db7093", 
            papayawhip : "#ffefd5", peachpuff : "#ffdab9", peru : "#cd853f", pink : "#ffc0cb", plum : "#dda0dd", 
            powderblue : "#b0e0e6", purple : "#800080", red : "#f00", rosybrown : "#bc8f8f", royalblue : "#4169e1", 
            saddlebrown : "#8b4513", salmon : "#fa8072", sandybrown : "#f4a460", seagreen : "#2e8b57", 
            seashell : "#fff5ee", sienna : "#a0522d", silver : "#c0c0c0", skyblue : "#87ceeb", slateblue : "#6a5acd", 
            slategray : "#708090", snow : "#fffafa", springgreen : "#00ff7f", steelblue : "#4682b4", tan : "#d2b48c", 
            teal : "#008080", thistle : "#d8bfd8", tomato : "#ff6347", turquoise : "#40e0d0", violet : "#ee82ee", 
            wheat : "#f5deb3", white : "#fff", whitesmoke : "#f5f5f5", yellow : "#ff0", yellowgreen : "#9acd32"
        };
        if (e.toString().toLowerCase() in U) {
            e = U[e.toString().toLowerCase()]
        }
        if (!e) {
            return {
                r : 0, g : 0, b : 0, hex : "#000"
            }
        }
        if (e == "none") {
            return {
                r :- 1, g :- 1, b :- 1, hex : "none"
            }
        }
        var O, P, T, R = e.match(/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hsb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hsb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i);
        if (R)
        {
            if (R[2])
            {
                T = parseInt(R[2].substring(5), 16);
                P = parseInt(R[2].substring(3, 5), 16);
                O = parseInt(R[2].substring(1, 3), 16)
            }
            if (R[3])
            {
                T = parseInt(R[3].substring(3) + R[3].substring(3), 16);
                P = parseInt(R[3].substring(2, 3) + R[3].substring(2, 3), 16);
                O = parseInt(R[3].substring(1, 2) + R[3].substring(1, 2), 16)
            }
            if (R[4])
            {
                R = R[4].split(/\s*,\s*/);
                O = parseFloat(R[0], 10);
                P = parseFloat(R[1], 10);
                T = parseFloat(R[2], 10)
            }
            if (R[5])
            {
                R = R[5].split(/\s*,\s*/);
                O = parseFloat(R[0], 10) * 2.55;
                P = parseFloat(R[1], 10) * 2.55;
                T = parseFloat(R[2], 10) * 2.55
            }
            if (R[6])
            {
                R = R[6].split(/\s*,\s*/);
                O = parseFloat(R[0], 10);
                P = parseFloat(R[1], 10);
                T = parseFloat(R[2], 10);
                return Raphael.hsb2rgb(O, P, T)
            }
            if (R[7])
            {
                R = R[7].split(/\s*,\s*/);
                O = parseFloat(R[0], 10) * 2.55;
                P = parseFloat(R[1], 10) * 2.55;
                T = parseFloat(R[2], 10) * 2.55;
                return Raphael.hsb2rgb(O, P, T)
            }
            var R = {
                r : O, g : P, b : T
            };
            var i = Math.round(O).toString(16);
            (i.length == 1) && (i = "0" + i);
            var Q = Math.round(P).toString(16);
            (Q.length == 1) && (Q = "0" + Q);
            var S = Math.round(T).toString(16);
            (S.length == 1) && (S = "0" + S);
            R.hex = "#" + i + Q + S;
            return R
        }
        else {
            return {
                r :- 1, g :- 1, b :- 1, hex : "none"
            }
        }
    };
    c.getColor = function (i)
    {
        var O = arguments.callee.start = arguments.callee.start || {
            h : 0, s : 1, b : i || 0.75
        };
        var e = Raphael.hsb2rgb(O.h, O.s, O.b);
        O.h += 0.075;
        if (O.h > 1) {
            O.h = 0;
            O.s -= 0.2;
            if (O.s <= 0) {
                arguments.callee.start = {
                    h : 0, s : 1, b : O.b
                }
            }
        }
        return e.hex;
    };
    c.getColor.reset = function ()
    {
        this.start = undefined;
    };
    c.parsePathString = function (e)
    {
        var P = {
            a : 7, c : 6, h : 1, l : 2, m : 2, q : 4, s : 4, t : 2, v : 1, z : 0
        },
        i = [], O = function ()
        {
            var R = "";
            for (var Q = 0, S = this.length; Q < S; Q++) {
                R += this [Q][0] + this [Q].join(",").substring(2)
            }
            return R;
        };
        if (e.toString.toString() == O.toString()) {
            return e
        }
        e.replace(/([achlmqstvz])[\s,]*((-?\d*(?:e-?\d+|\.?\d*)\s*,?\s*)+)/ig, function (R, Q, U)
        {
            var T = [], S = Q.toLowerCase();
            U.replace(/(-?\d*(?:e-?\d+|\.?\d*))\s*,?\s*/ig, function (W, V)
            {
                V && T.push(+V)
            });
            while (T.length >= P[S]) {
                i.push([Q].concat(T.splice(0, P[S])));
                if (!P[S]) {
                    break
                }
            }
        });
        i.toString = O;
        return i;
    };
    var v = function (X)
    {
        var e = X;
        if (typeof X == "string") {
            e = Raphael.parsePathString(X)
        }
        e = s(e);
        var T = [], S = [], O = 0;
        for (var Q = 0, W = e.length; Q < W; Q++)
        {
            switch (e[Q][0])
            {
                case "Z":
                    break;
                case "A":
                    T.push(e[Q][e[Q].length - 2]);
                    S.push(e[Q][e[Q].length - 1]);
                    break;
                default:
                    for (var P = 1, R = e[Q].length; P < R; P++) {
                        if (P % 2) {
                            T.push(e[Q][P])
                        }
                        else {
                            S.push(e[Q][P])
                        }
                    }
            }
        }
        var V = Math.min.apply(Math, T), U = Math.min.apply(Math, S);
        return {
            x : V, y : U, width : Math.max.apply(Math, T) - V, height : Math.max.apply(Math, S) - U, X : T, 
            Y : S
        }
    };
    var b = function (O)
    {
        var S = [];
        if (typeof O == "string") {
            O = c.parsePathString(O)
        }
        var U = 0, T = 0, e = 0;
        if (O[0][0] == "M") {
            U = O[0][1];
            T = O[0][2];
            e++;
            S.push(O[0])
        }
        for (var Q = e, V = O.length; Q < V; Q++)
        {
            S[Q] = [];
            if (O[Q][0] != O[Q][0].toLowerCase())
            {
                S[Q][0] = O[Q][0].toLowerCase();
                switch (S[Q][0])
                {
                    case "a":
                        S[Q][1] = O[Q][1];
                        S[Q][2] = O[Q][2];
                        S[Q][3] = 0;
                        S[Q][4] = O[Q][4];
                        S[Q][5] = O[Q][5];
                        S[Q][6] =+ (O[Q][6] - U).toFixed(3);
                        S[Q][7] =+ (O[Q][7] - T).toFixed(3);
                        break;
                    case "v":
                        S[Q][1] =+ (O[Q][1] - T).toFixed(3);
                        break;
                    default:
                        for (var P = 1, R = O[Q].length; P < R; P++) {
                            S[Q][P] =+ (O[Q][P] - ((P % 2) ? U : T)).toFixed(3)
                        }
                }
            }
            else {
                S[Q] = O[Q]
            }
            switch (S[Q][0])
            {
                case "z":
                    break;
                case "h":
                    U += S[Q][S[Q].length - 1];
                    break;
                case "v":
                    T += S[Q][S[Q].length - 1];
                    break;
                default:
                    U += S[Q][S[Q].length - 2];
                    T += S[Q][S[Q].length - 1]
            }
        }
        S.toString = O.toString;
        return S;
    };
    var s = function (O)
    {
        var S = [];
        if (typeof O == "string") {
            O = c.parsePathString(O)
        }
        var U = 0, T = 0, e = 0;
        if (O[0][0] == "M") {
            U =+ O[0][1];
            T =+ O[0][2];
            e++;
            S[0] = O[0]
        }
        for (var Q = e, V = O.length; Q < V; Q++)
        {
            S[Q] = [];
            if (O[Q][0] != (O[Q][0] + "").toUpperCase())
            {
                S[Q][0] = (O[Q][0] + "").toUpperCase();
                switch (S[Q][0])
                {
                    case "A":
                        S[Q][1] = O[Q][1];
                        S[Q][2] = O[Q][2];
                        S[Q][3] = 0;
                        S[Q][4] = O[Q][4];
                        S[Q][5] = O[Q][5];
                        S[Q][6] =+ (O[Q][6] + U).toFixed(3);
                        S[Q][7] =+ (O[Q][7] + T).toFixed(3);
                        break;
                    case "V":
                        S[Q][1] =+ O[Q][1] + T;
                        break;
                    default:
                        for (var P = 1, R = O[Q].length; P < R; P++) {
                            S[Q][P] =+ O[Q][P] + ((P % 2) ? U : T)
                        }
                }
            }
            else {
                S[Q] = O[Q]
            }
            switch (S[Q][0])
            {
                case "Z":
                    break;
                case "H":
                    U = S[Q][1];
                    break;
                case "V":
                    T = S[Q][1];
                    break;
                default:
                    U = S[Q][S[Q].length - 2];
                    T = S[Q][S[Q].length - 1];
            }
        }
        S.toString = O.toString;
        return S;
    };
    var A = function (S, R)
    {
        var Q = [s(Raphael.parsePathString(S)), s(Raphael.parsePathString(R))], O = [ {
            x : 0, y : 0, bx : 0, by : 0, X : 0, Y : 0
        },
        {
            x : 0, y : 0, bx : 0, by : 0, X : 0, Y : 0
        }], e = function (U, V)
        {
            if (!U) {
                return ["U"]
            }
            switch (U[0])
            {
                case "M":
                    V.X = U[1];
                    V.Y = U[2];
                    break;
                case "S":
                    var i = V.x + (V.x - (V.bx || V.x));
                    var W = V.y + (V.y - (V.by || V.y));
                    U = ["C", i, W, U[1], U[2], U[3], U[4]];
                    break;
                case "T":
                    var i = V.x + (V.x - (V.bx || V.x));
                    var W = V.y + (V.y - (V.by || V.y));
                    U = ["Q", i, W, U[1], U[2]];
                    break;
                case "H":
                    U = ["L", U[1], V.y];
                    break;
                case "V":
                    U = ["L", V.x, U[1]];
                    break;
                case "Z":
                    U = ["L", V.X, V.Y];
                    break
            }
            return U;
        },
        T = function (W, V, Y)
        {
            if (Q[W][Y][0] == "M" && Q[V][Y][0] != "M")
            {
                Q[V].splice(Y, 0, ["M", O[V].x, O[V].y]);
                O[W].bx = Q[W][Y][Q[W][Y].length - 4] || 0;
                O[W].by = Q[W][Y][Q[W][Y].length - 3] || 0;
                O[W].x = Q[W][Y][Q[W][Y].length - 2];
                O[W].y = Q[W][Y][Q[W][Y].length - 1];
                return true
            }
            else
            {
                if (Q[W][Y][0] == "L" && Q[V][Y][0] == "C") {
                    Q[W][Y] = ["C", O[W].x, O[W].y, Q[W][Y][1], Q[W][Y][2], Q[W][Y][1], Q[W][Y][2]]
                }
                else
                {
                    if (Q[W][Y][0] == "L" && Q[V][Y][0] == "Q") {
                        Q[W][Y] = ["Q", Q[W][Y][1], Q[W][Y][2], Q[W][Y][1], Q[W][Y][2]]
                    }
                    else
                    {
                        if (Q[W][Y][0] == "Q" && Q[V][Y][0] == "C")
                        {
                            var U = Q[V][Y][Q[V][Y].length - 2];
                            var aa = Q[V][Y][Q[V][Y].length - 1];
                            Q[V].splice(Y + 1, 0, ["Q", U, aa, U, aa]);
                            Q[W].splice(Y, 0, ["C", O[W].x, O[W].y, O[W].x, O[W].y, O[W].x, O[W].y]);
                            Y++;
                            O[V].bx = Q[V][Y][Q[V][Y].length - 4] || 0;
                            O[V].by = Q[V][Y][Q[V][Y].length - 3] || 0;
                            O[V].x = Q[V][Y][Q[V][Y].length - 2];
                            O[V].y = Q[V][Y][Q[V][Y].length - 1];
                            return true
                        }
                        else
                        {
                            if (Q[W][Y][0] == "A" && Q[V][Y][0] == "C")
                            {
                                var U = Q[V][Y][Q[V][Y].length - 2];
                                var aa = Q[V][Y][Q[V][Y].length - 1];
                                Q[V].splice(Y + 1, 0, ["A", 0, 0, Q[W][Y][3], Q[W][Y][4], Q[W][Y][5], 
                                U, aa]);
                                Q[W].splice(Y, 0, ["C", O[W].x, O[W].y, O[W].x, O[W].y, O[W].x, O[W].y]);
                                Y++;
                                O[V].bx = Q[V][Y][Q[V][Y].length - 4] || 0;
                                O[V].by = Q[V][Y][Q[V][Y].length - 3] || 0;
                                O[V].x = Q[V][Y][Q[V][Y].length - 2];
                                O[V].y = Q[V][Y][Q[V][Y].length - 1];
                                return true
                            }
                            else
                            {
                                if (Q[W][Y][0] == "U")
                                {
                                    Q[W][Y][0] = Q[V][Y][0];
                                    for (var X = 1, Z = Q[V][Y].length; X < Z; X++) {
                                        Q[W][Y][X] = (X % 2) ? O[W].x : O[W].y
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return false;
        };
        for (var P = 0; P < Math.max(Q[0].length, Q[1].length); P++)
        {
            Q[0][P] = e(Q[0][P], O[0]);
            Q[1][P] = e(Q[1][P], O[1]);
            if (Q[0][P][0] != Q[1][P][0] && (T(0, 1, P) || T(1, 0, P))) {
                continue
            }
            O[0].bx = Q[0][P][Q[0][P].length - 4] || 0;
            O[0].by = Q[0][P][Q[0][P].length - 3] || 0;
            O[0].x = Q[0][P][Q[0][P].length - 2];
            O[0].y = Q[0][P][Q[0][P].length - 1];
            O[1].bx = Q[1][P][Q[1][P].length - 4] || 0;
            O[1].by = Q[1][P][Q[1][P].length - 3] || 0;
            O[1].x = Q[1][P][Q[1][P].length - 2];
            O[1].y = Q[1][P][Q[1][P].length - 1]
        }
        return Q;
    };
    var l = function (X)
    {
        if (typeof X == "string")
        {
            X = X.split(/\s*\-\s*/);
            var P = X.shift();
            if (P.toLowerCase() == "v") {
                P = 90
            }
            else {
                if (P.toLowerCase() == "h") {
                    P = 0
                }
                else {
                    P = parseFloat(P, 10);
                }
            }
            P =- P;
            var V = 
            {
                angle : P, type : "linear", dots : [], vector : [0, 0, Math.cos(P * Math.PI / 180).toFixed(3), 
                Math.sin(P * Math.PI / 180).toFixed(3)]
            };
            var W = 1 / (Math.max(Math.abs(V.vector[2]), Math.abs(V.vector[3])) || 1);
            V.vector[2] *= W;
            V.vector[3] *= W;
            if (V.vector[2] < 0) {
                V.vector[0] =- V.vector[2];
                V.vector[2] = 0
            }
            if (V.vector[3] < 0) {
                V.vector[1] =- V.vector[3];
                V.vector[3] = 0
            }
            V.vector[0] = V.vector[0].toFixed(3);
            V.vector[1] = V.vector[1].toFixed(3);
            V.vector[2] = V.vector[2].toFixed(3);
            V.vector[3] = V.vector[3].toFixed(3);
            for (var S = 0, Y = X.length; S < Y; S++)
            {
                var e = {};
                var U = X[S].match(/^([^:]*):?([\d\.]*)/);
                e.color = F(U[1]).hex;
                U[2] && (e.offset = U[2] + "%");
                V.dots.push(e)
            }
            for (var S = 1, Y = V.dots.length - 1; S < Y; S++)
            {
                if (!V.dots[S].offset)
                {
                    var O = parseFloat(V.dots[S - 1].offset || 0, 10), Q = false;
                    for (var R = S + 1; R < Y; R++) {
                        if (V.dots[R].offset) {
                            Q = V.dots[R].offset;
                            break
                        }
                    }
                    if (!Q) {
                        Q = 100;
                        R = Y
                    }
                    Q = parseFloat(Q, 10);
                    var T = (Q - O) / (R - S + 1);
                    for (; S < R; S++) {
                        O += T;
                        V.dots[S].offset = O + "%";
                    }
                }
            }
            return V
        }
        else {
            return X;
        }
    };
    if (c.svg)
    {
        var M = function (P, e, Q)
        {
            var i = d.createElementNS(Q.svgns, "path");
            i.setAttribute("fill", "none");
            if (Q.canvas) {
                Q.canvas.appendChild(i)
            }
            var O = new k(i, Q);
            O.isAbsolute = true;
            O.type = "path";
            O.last = {
                x : 0, y : 0, bx : 0, by : 0
            };
            O.absolutely = function ()
            {
                this.isAbsolute = true;
                return this;
            };
            O.relatively = function ()
            {
                this.isAbsolute = false;
                return this;
            };
            O.moveTo = function (R, U)
            {
                var T = this.isAbsolute ? "M" : "m";
                T += parseFloat(R, 10).toFixed(3) + " " + parseFloat(U, 10).toFixed(3) + " ";
                var S = this [0].getAttribute("d") || "";
                (S == "M0,0") && (S = "");
                this [0].setAttribute("d", S + T);
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(R, 10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(U, 10);
                this.attrs.path = S + T;
                return this;
            };
            O.lineTo = function (R, U)
            {
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(R, 10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(U, 10);
                var T = this.isAbsolute ? "L" : "l";
                T += parseFloat(R, 10).toFixed(3) + " " + parseFloat(U, 10).toFixed(3) + " ";
                var S = this [0].getAttribute("d") || "";
                this [0].setAttribute("d", S + T);
                this.attrs.path = S + T;
                return this;
            };
            O.arcTo = function (W, V, S, U, R, Y)
            {
                var X = this.isAbsolute ? "A" : "a";
                X += [parseFloat(W, 10).toFixed(3), parseFloat(V, 10).toFixed(3), 0, S, U, parseFloat(R, 
                10).toFixed(3), parseFloat(Y, 10).toFixed(3)].join(" ");
                var T = this [0].getAttribute("d") || "";
                this [0].setAttribute("d", T + X);
                this.last.x = parseFloat(R, 10);
                this.last.y = parseFloat(Y, 10);
                this.attrs.path = T + X;
                return this;
            };
            O.cplineTo = function (S, Z, U)
            {
                if (!U) {
                    return this.lineTo(S, Z)
                }
                else
                {
                    var R = {};
                    var aa = parseFloat(S, 10);
                    var X = parseFloat(Z, 10);
                    var ab = parseFloat(U, 10);
                    var W = this.isAbsolute ? "C" : "c";
                    var V = [ + this.last.x + ab, + this.last.y, aa - ab, X, aa, X];
                    for (var T = 0, ac = V.length; T < ac; T++) {
                        W += V[T].toFixed(3) + " "
                    }
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + V[4];
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + V[5];
                    this.last.bx = V[2];
                    this.last.by = V[3];
                    var Y = this [0].getAttribute("d") || "";
                    this [0].setAttribute("d", Y + W);
                    this.attrs.path = Y + W;
                    return this;
                }
            };
            O.curveTo = function ()
            {
                var U = {}, W = [0, 1, 2, 3, "s", 5, "c"];
                var V = W[arguments.length];
                if (this.isAbsolute) {
                    V = V.toUpperCase()
                }
                for (var S = 0, T = arguments.length; S < T; S++) {
                    V += parseFloat(arguments[S], 10).toFixed(3) + " "
                }
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[arguments.length - 2], 
                10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[arguments.length - 1], 
                10);
                this.last.bx = parseFloat(arguments[arguments.length - 4], 10);
                this.last.by = parseFloat(arguments[arguments.length - 3], 10);
                var R = this.node.getAttribute("d") || "";
                this.node.setAttribute("d", R + V);
                this.attrs.path = R + V;
                return this;
            };
            O.qcurveTo = function ()
            {
                var U = {}, W = [0, 1, "t", 3, "q"];
                var V = W[arguments.length];
                if (this.isAbsolute) {
                    V = V.toUpperCase()
                }
                for (var S = 0, T = arguments.length; S < T; S++) {
                    V += parseFloat(arguments[S], 10).toFixed(3) + " "
                }
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[arguments.length - 2], 
                10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[arguments.length - 1], 
                10);
                if (arguments.length != 2)
                {
                    this.last.qx = parseFloat(arguments[arguments.length - 4], 10);
                    this.last.qy = parseFloat(arguments[arguments.length - 3], 10)
                }
                var R = this.node.getAttribute("d") || "";
                this.node.setAttribute("d", R + V);
                this.attrs.path = R + V;
                return this;
            };
            O.addRoundedCorner = function (V, T)
            {
                var U = 0.5522 * V, S = this.isAbsolute, X = this;
                if (S) {
                    this.relatively();
                    S = function ()
                    {
                        X.absolutely()
                    }
                }
                else {
                    S = function () {}
                }
                var W = 
                {
                    l : function ()
                    {
                        return {
                            u : function ()
                            {
                                X.curveTo(-U, 0, - V, - (V - U), - V, - V)
                            },
                            d : function ()
                            {
                                X.curveTo(-U, 0, - V, V - U, - V, V)
                            }
                        }
                    },
                    r : function ()
                    {
                        return {
                            u : function ()
                            {
                                X.curveTo(U, 0, V, - (V - U), V, - V)
                            },
                            d : function ()
                            {
                                X.curveTo(U, 0, V, V - U, V, V)
                            }
                        }
                    },
                    u : function ()
                    {
                        return {
                            r : function ()
                            {
                                X.curveTo(0, - U, - (U - V), - V, V, - V)
                            },
                            l : function ()
                            {
                                X.curveTo(0, - U, U - V, - V, - V, - V)
                            }
                        }
                    },
                    d : function ()
                    {
                        return {
                            r : function ()
                            {
                                X.curveTo(0, U, - (U - V), V, V, V)
                            },
                            l : function ()
                            {
                                X.curveTo(0, U, U - V, V, - V, V)
                            }
                        }
                    }
                };
                W[T[0]]()[T[1]]();
                S();
                return X;
            };
            O.andClose = function ()
            {
                var R = this [0].getAttribute("d") || "";
                this [0].setAttribute("d", R + "Z ");
                this.attrs.path = R + "Z ";
                return this;
            };
            if (e) {
                O.attrs.path = "" + e;
                O.absolutely();
                a.pathfinder(O, O.attrs.path)
            }
            if (P) {
                B(O, P)
            }
            return O;
        };
        var u = function (T, R, U)
        {
            R = l(R);
            var Q = d.createElementNS(U.svgns, (R.type || "linear") + "Gradient");
            Q.id = "raphael-gradient-" + Raphael.idGenerator++;
            if (R.vector && R.vector.length)
            {
                Q.setAttribute("x1", R.vector[0]);
                Q.setAttribute("y1", R.vector[1]);
                Q.setAttribute("x2", R.vector[2]);
                Q.setAttribute("y2", R.vector[3])
            }
            U.defs.appendChild(Q);
            var S = true;
            for (var O = 0, P = R.dots.length; O < P; O++)
            {
                var e = d.createElementNS(U.svgns, "stop");
                if (R.dots[O].offset) {
                    S = false
                }
                e.setAttribute("offset", R.dots[O].offset ? R.dots[O].offset : (O == 0) ? "0%" : "100%");
                e.setAttribute("stop-color", F(R.dots[O].color).hex || "#fff");
                Q.appendChild(e)
            }
            if (S && typeof R.dots[P - 1].opacity != "undefined") {
                e.setAttribute("stop-opacity", R.dots[P - 1].opacity)
            }
            T.setAttribute("fill", "url(#" + Q.id + ")");
            T.style.opacity = 1;
            T.style.fillOpacity = 1;
            T.setAttribute("opacity", 1);
            T.setAttribute("fill-opacity", 1)
        };
        var p = function (i)
        {
            if (i.pattern)
            {
                var e = i.node.getBBox();
                i.pattern.setAttribute("patternTransform", "translate(" + [e.x, e.y].join(",") + ")")
            }
        };
        var B = function (O, P)
        {
            var U = 
            {
                "-" : [3, 1], "." : [1, 1], "-." : [3, 1, 1, 1], "-.." : [3, 1, 1, 1, 1, 1], ". " : [1, 
                3], "- " : [4, 3], "--" : [8, 3], "- ." : [4, 3, 1, 3], "--." : [8, 3, 1, 3], "--.." : [8, 
                3, 1, 3, 1, 3]
            },
            e = function (ag, af)
            {
                af = U[af.toString().toLowerCase()];
                if (af)
                {
                    var ad = ag.attrs["stroke-width"] || "1", aa = {
                        round : ad, square : ad, butt : 0
                    }
                    [ag.attrs["stroke-linecap"] || P["stroke-linecap"]] || 0, ae = [];
                    for (var ab = 0, ac = af.length; ab < ac; ab++) {
                        ae.push(af[ab] * ad + ((ab % 2) ? 1 :- 1) * aa)
                    }
                    af = ae.join(",");
                    ag.node.setAttribute("stroke-dasharray", af)
                }
            };
            for (var S in P)
            {
                var W = P[S];
                O.attrs[S] = W;
                switch (S)
                {
                    case "path":
                        if (O.type == "path") {
                            O.node.setAttribute("d", "M0,0");
                            a.pathfinder(O, W)
                        }
                    case "rx":
                    case "cx":
                    case "x":
                        O.node.setAttribute(S, W);
                        p(O);
                        break;
                    case "ry":
                    case "cy":
                    case "y":
                        O.node.setAttribute(S, W);
                        p(O);
                        break;
                    case "width":
                        O.node.setAttribute(S, W);
                        break;
                    case "height":
                        O.node.setAttribute(S, W);
                        break;
                    case "src":
                        if (O.type == "image") {
                            O.node.setAttributeNS(svg.xlink, "href", W)
                        }
                        break;
                    case "stroke-width":
                        O.node.style.strokeWidth = W;
                        O.node.setAttribute(S, W);
                        if (O.attrs["stroke-dasharray"]) {
                            e(O, O.attrs["stroke-dasharray"])
                        }
                        break;
                    case "stroke-dasharray":
                        e(O, W);
                        break;
                    case "rotation":
                        O.rotate(W, true);
                        break;
                    case "translation":
                        var Z = (W + "").split(N);
                        O.translate((+Z[0] + 1 || 2) - 1, (+Z[1] + 1 || 2) - 1);
                        break;
                    case "scale":
                        var Z = (W + "").split(N);
                        O.scale(+Z[0] || 1, + Z[1] ||+ Z[0] || 1);
                        break;
                    case "fill":
                        var R = W.match(/^url\(([^\)]+)\)$/i);
                        if (R)
                        {
                            var i = d.createElementNS(O.svg.svgns, "pattern");
                            var Y = d.createElementNS(O.svg.svgns, "image");
                            i.id = "raphael-pattern-" + Raphael.idGenerator++;
                            i.setAttribute("x", 0);
                            i.setAttribute("y", 0);
                            i.setAttribute("patternUnits", "userSpaceOnUse");
                            Y.setAttribute("x", 0);
                            Y.setAttribute("y", 0);
                            Y.setAttributeNS(O.svg.xlink, "href", R[1]);
                            i.appendChild(Y);
                            var Q = d.createElement("img");
                            Q.style.position = "absolute";
                            Q.style.top = "-9999em";
                            Q.style.left = "-9999em";
                            Q.onload = function ()
                            {
                                i.setAttribute("width", this.offsetWidth);
                                i.setAttribute("height", this.offsetHeight);
                                Y.setAttribute("width", this.offsetWidth);
                                Y.setAttribute("height", this.offsetHeight);
                                d.body.removeChild(this);
                                a.safari()
                            };
                            d.body.appendChild(Q);
                            Q.src = R[1];
                            O.svg.defs.appendChild(i);
                            O.node.style.fill = "url(#" + i.id + ")";
                            O.node.setAttribute("fill", "url(#" + i.id + ")");
                            O.pattern = i;
                            p(O);
                            break
                        }
                        delete P.gradient;
                        delete O.attrs.gradient;
                        if (typeof O.attrs.opacity != "undefined" && typeof P.opacity == "undefined")
                        {
                            O.node.style.opacity = O.attrs.opacity;
                            O.node.setAttribute("opacity", O.attrs.opacity)
                        }
                        if (typeof O.attrs["fill-opacity"] != "undefined" && typeof P["fill-opacity"] == "undefined")
                        {
                            O.node.style.fillOpacity = O.attrs["fill-opacity"];
                            O.node.setAttribute("fill-opacity", O.attrs["fill-opacity"])
                        }
                    case "stroke":
                        O.node.style[S] = F(W).hex;
                        O.node.setAttribute(S, F(W).hex);
                        break;
                    case "gradient":
                        u(O.node, W, O.svg);
                        break;
                    case "opacity":
                    case "fill-opacity":
                        if (O.attrs.gradient)
                        {
                            var V = d.getElementById(O.node.getAttribute("fill").replace(/^url\(#|\)$/g, ""));
                            if (V) {
                                var X = V.getElementsByTagName("stop");
                                X[X.length - 1].setAttribute("stop-opacity", W)
                            }
                            break
                        }
                    default:
                        var T = S.replace(/(\-.)/g, function (aa)
                        {
                            return aa.substring(1).toUpperCase();
                        });
                        O.node.style[T] = W;
                        O.node.setAttribute(S, W);
                        break
                }
            }
            J(O, P)
        };
        var E = 1.2;
        var J = function (P, O)
        {
            if (P.type != "text" || !("text" in O || "font" in O || "font-size" in O || "x" in O)) {
                return
            }
            var V = P.node.firstChild ? parseInt(d.defaultView.getComputedStyle(P.node.firstChild, "").getPropertyValue("font-size"), 
            10) : 10;
            var U = 0;
            if ("text" in O)
            {
                while (P.node.firstChild) {
                    P.node.removeChild(P.node.firstChild)
                }
                var e = (O.text + "").split("\n");
                for (var Q = 0, T = e.length; Q < T; Q++)
                {
                    var R = d.createElementNS(P.svg.svgns, "tspan");
                    Q && R.setAttribute("dy", V * E);
                    Q && R.setAttribute("x", P.attrs.x);
                    R.appendChild(d.createTextNode(e[Q]));
                    P.node.appendChild(R);
                    U += V * E
                }
            }
            else
            {
                var e = P.node.getElementsByTagName("tspan");
                for (var Q = 0, T = e.length; Q < T; Q++) {
                    Q && e[Q].setAttribute("dy", V * E);
                    Q && e[Q].setAttribute("x", P.attrs.x);
                    U += V * E
                }
            }
            U -= V * (E - 1);
            var S = U / 2 - V;
            if (S) {
                P.node.setAttribute("y", P.attrs.y - S)
            }
            setTimeout(function () {})
        };
        var k = function (i, e)
        {
            var P = 0, O = 0;
            this [0] = i;
            this.node = i;
            this.svg = e;
            this.attrs = this.attrs || {};
            this.transformations = [];
            this._ = {
                tx : 0, ty : 0, rt : {
                    deg : 0, x : 0, y : 0
                },
                sx : 1, sy : 1
            }
        };
        k.prototype.rotate = function (i, e, P)
        {
            if (i == null) {
                return this._.rt.deg
            }
            var O = this.getBBox();
            i = i.toString().split(N);
            if (i.length - 1) {
                e = parseFloat(i[1], 10);
                P = parseFloat(i[2], 10)
            }
            i = parseFloat(i[0], 10);
            if (e != null) {
                this._.rt.deg = i
            }
            else {
                this._.rt.deg += i
            }
            if (P == null) {
                e = null
            }
            e = e == null ? O.x + O.width / 2 : e;
            P = P == null ? O.y + O.height / 2 : P;
            if (this._.rt.deg) {
                this.transformations[0] = ("rotate(" + this._.rt.deg + " " + e + " " + P + ")")
            }
            else {
                this.transformations[0] = ""
            }
            this.node.setAttribute("transform", this.transformations.join(" "));
            return this;
        };
        k.prototype.hide = function ()
        {
            this.node.style.display = "none";
            return this;
        };
        k.prototype.show = function ()
        {
            this.node.style.display = "block";
            return this;
        };
        k.prototype.remove = function ()
        {
            this.node.parentNode.removeChild(this.node)
        };
        k.prototype.getBBox = function ()
        {
            return this.node.getBBox();
        };
        k.prototype.attr = function ()
        {
            if (arguments.length == 1 && typeof arguments[0] == "string")
            {
                if (arguments[0] == "translation") {
                    return this.translate()
                }
                return this.attrs[arguments[0]]
            }
            if (arguments.length == 1 && arguments[0] instanceof Array)
            {
                var e = {};
                for (var i in arguments[0]) {
                    e[arguments[0][i]] = this.attrs[arguments[0][i]]
                }
                return e
            }
            if (arguments.length == 2) {
                var O = {};
                O[arguments[0]] = arguments[1];
                B(this, O)
            }
            else {
                if (arguments.length == 1 && typeof arguments[0] == "object") {
                    B(this, arguments[0])
                }
            }
            return this;
        };
        k.prototype.toFront = function ()
        {
            this.node.parentNode.appendChild(this.node);
            return this;
        };
        k.prototype.toBack = function ()
        {
            if (this.node.parentNode.firstChild != this.node) {
                this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild)
            }
            return this;
        };
        k.prototype.insertAfter = function (e)
        {
            if (e.node.nextSibling) {
                e.node.parentNode.insertBefore(this.node, e.node.nextSibling)
            }
            else {
                e.node.parentNode.appendChild(this.node)
            }
            return this;
        };
        k.prototype.insertBefore = function (e)
        {
            e.node.parentNode.insertBefore(this.node, e.node);
            return this;
        };
        var w = function (i, e, R, Q)
        {
            var P = d.createElementNS(i.svgns, "circle");
            P.setAttribute("cx", e);
            P.setAttribute("cy", R);
            P.setAttribute("r", Q);
            P.setAttribute("fill", "none");
            P.setAttribute("stroke", "#000");
            if (i.canvas) {
                i.canvas.appendChild(P)
            }
            var O = new k(P, i);
            O.attrs = O.attrs || {};
            O.attrs.cx = e;
            O.attrs.cy = R;
            O.attrs.r = Q;
            O.attrs.stroke = "#000";
            O.type = "circle";
            return O;
        };
        var D = function (O, e, T, i, R, S)
        {
            var Q = d.createElementNS(O.svgns, "rect");
            Q.setAttribute("x", e);
            Q.setAttribute("y", T);
            Q.setAttribute("width", i);
            Q.setAttribute("height", R);
            if (S) {
                Q.setAttribute("rx", S);
                Q.setAttribute("ry", S)
            }
            Q.setAttribute("fill", "none");
            Q.setAttribute("stroke", "#000");
            if (O.canvas) {
                O.canvas.appendChild(Q)
            }
            var P = new k(Q, O);
            P.attrs = P.attrs || {};
            P.attrs.x = e;
            P.attrs.y = T;
            P.attrs.width = i;
            P.attrs.height = R;
            P.attrs.stroke = "#000";
            if (S) {
                P.attrs.rx = P.attrs.ry = S
            }
            P.type = "rect";
            return P;
        };
        var f = function (i, e, S, R, Q)
        {
            var P = d.createElementNS(i.svgns, "ellipse");
            P.setAttribute("cx", e);
            P.setAttribute("cy", S);
            P.setAttribute("rx", R);
            P.setAttribute("ry", Q);
            P.setAttribute("fill", "none");
            P.setAttribute("stroke", "#000");
            if (i.canvas) {
                i.canvas.appendChild(P)
            }
            var O = new k(P, i);
            O.attrs = O.attrs || {};
            O.attrs.cx = e;
            O.attrs.cy = S;
            O.attrs.rx = R;
            O.attrs.ry = Q;
            O.attrs.stroke = "#000";
            O.type = "ellipse";
            return O;
        };
        var n = function (O, S, e, T, i, R)
        {
            var Q = d.createElementNS(O.svgns, "image");
            Q.setAttribute("x", e);
            Q.setAttribute("y", T);
            Q.setAttribute("width", i);
            Q.setAttribute("height", R);
            Q.setAttribute("preserveAspectRatio", "none");
            Q.setAttributeNS(O.xlink, "href", S);
            if (O.canvas) {
                O.canvas.appendChild(Q)
            }
            var P = new k(Q, O);
            P.attrs = P.attrs || {};
            P.attrs.x = e;
            P.attrs.y = T;
            P.attrs.width = i;
            P.attrs.height = R;
            P.type = "image";
            return P;
        };
        var C = function (i, e, R, Q)
        {
            var P = d.createElementNS(i.svgns, "text");
            P.setAttribute("x", e);
            P.setAttribute("y", R);
            P.setAttribute("text-anchor", "middle");
            if (i.canvas) {
                i.canvas.appendChild(P)
            }
            var O = new k(P, i);
            O.attrs = O.attrs || {};
            O.attrs.x = e;
            O.attrs.y = R;
            O.type = "text";
            B(O, {
                font : o.font, stroke : "none", fill : "#000", text : Q
            });
            return O;
        };
        var t = function (e)
        {
            var P = d.createElementNS(e.svgns, "g");
            if (e.canvas) {
                e.canvas.appendChild(P)
            }
            var O = new k(P, e);
            for (var Q in e)
            {
                if (Q[0] != "_" && typeof e[Q] == "function")
                {
                    O[Q] = (function (i)
                    {
                        return function ()
                        {
                            var R = e[i].apply(e, arguments);
                            P.appendChild(R[0]);
                            return R;
                        }
                    })(Q)
                }
            }
            O.type = "group";
            return O;
        };
        var z = function (i, e)
        {
            this.width = i || this.width;
            this.height = e || this.height;
            this.canvas.setAttribute("width", this.width);
            this.canvas.setAttribute("height", this.height);
            return this;
        };
        var j = function ()
        {
            if (typeof arguments[0] == "string") {
                var O = d.getElementById(arguments[0]);
                var P = arguments[1];
                var i = arguments[2]
            }
            if (typeof arguments[0] == "object") {
                var O = arguments[0];
                var P = arguments[1];
                var i = arguments[2]
            }
            if (typeof arguments[0] == "number") {
                var O = 1, e = arguments[0], R = arguments[1], P = arguments[2], i = arguments[3]
            }
            if (!O) {
                throw new Error("SVG container not found.")
            }
            a.canvas = d.createElementNS(a.svgns, "svg");
            a.canvas.setAttribute("width", P || 320);
            a.width = P || 320;
            a.canvas.setAttribute("height", i || 200);
            a.height = i || 200;
            if (O == 1)
            {
                d.body.appendChild(a.canvas);
                a.canvas.style.position = "absolute";
                a.canvas.style.left = e + "px";
                a.canvas.style.top = R + "px"
            }
            else
            {
                if (O.firstChild) {
                    O.insertBefore(a.canvas, O.firstChild)
                }
                else {
                    O.appendChild(a.canvas)
                }
            }
            O = 
            {
                canvas : a.canvas,
                clear : function ()
                {
                    while (this.canvas.firstChild) {
                        this.canvas.removeChild(this.canvas.firstChild)
                    }
                    this.defs = d.createElementNS(a.svgns, "defs");
                    this.canvas.appendChild(this.defs)
                }
            };
            for (var Q in a) {
                if (Q != "create") {
                    O[Q] = a[Q];
                }
            }
            for (var Q in c.fn) {
                if (!O[Q]) {
                    O[Q] = c.fn[Q];
                }
            }
            O.clear();
            return O;
        };
        a.remove = function ()
        {
            this.canvas.parentNode.removeChild(this.canvas)
        };
        a.svgns = "http://www.w3.org/2000/svg";
        a.xlink = "http://www.w3.org/1999/xlink";
        a.safari = function ()
        {
            if (navigator.vendor == "Apple Computer, Inc.")
            {
                var e = this.rect(-this.width, - this.height, this.width * 3, this.height * 3).attr({
                    stroke : "none"
                });
                setTimeout(function ()
                {
                    e.remove()
                }, 0)
            }
        }
    }
    if (c.vml)
    {
        M = function (T, e, R)
        {
            var P = L("group"), S = P.style;
            S.position = "absolute";
            S.left = 0;
            S.top = 0;
            S.width = R.width + "px";
            S.height = R.height + "px";
            var O = L("shape"), i = O.style;
            i.width = R.width + "px";
            i.height = R.height + "px";
            O.path = "";
            if (T["class"]) {
                O.className = "rvml " + T["class"]
            }
            O.coordsize = this.coordsize;
            O.coordorigin = this.coordorigin;
            P.appendChild(O);
            R.canvas.appendChild(P);
            var Q = new k(O, P, R);
            Q.isAbsolute = true;
            Q.type = "path";
            Q.path = [];
            Q.last = {
                x : 0, y : 0, bx : 0, by : 0, isAbsolute : true
            };
            Q.Path = "";
            Q.absolutely = function ()
            {
                this.isAbsolute = true;
                return this;
            };
            Q.relatively = function ()
            {
                this.isAbsolute = false;
                return this;
            };
            Q.moveTo = function (U, W)
            {
                var V = this.isAbsolute ? "m" : "t";
                V += Math.round(parseFloat(U, 10)) + " " + Math.round(parseFloat(W, 10));
                this.node.path = this.Path += V;
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(U, 10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(W, 10);
                this.last.isAbsolute = this.isAbsolute;
                this.attrs.path += (this.isAbsolute ? "M" : "m") + [U, W];
                return this;
            };
            Q.lineTo = function (U, W)
            {
                var V = this.isAbsolute ? "l" : "r";
                V += Math.round(parseFloat(U, 10)) + " " + Math.round(parseFloat(W, 10));
                this [0].path = this.Path += V;
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(U, 10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(W, 10);
                this.last.isAbsolute = this.isAbsolute;
                this.attrs.path += (this.isAbsolute ? "L" : "l") + [U, W];
                return this;
            };
            Q.arcTo = function (W, U, ad, X, V, ah)
            {
                V = (this.isAbsolute ? 0 : this.last.x) + V;
                ah = (this.isAbsolute ? 0 : this.last.y) + ah;
                var Y = this.last.x, aj = this.last.y, ai = (Y - V) / 2, ag = (aj - ah) / 2, ac = (ad == X ?- 1 : 1) * Math.sqrt(Math.abs(W * W * U * U - W * W * ag * ag - U * U * ai * ai) / (W * W * ag * ag + U * U * ai * ai)), 
                ab = ac * W * ag / U + (Y + V) / 2, aa = ac *- U * ai / W + (aj + ah) / 2, ae = X ? (this.isAbsolute ? "wa" : "wr") : (this.isAbsolute ? "at" : "ar"), 
                Z = Math.round(ab - W), af = Math.round(aa - U);
                ae += [Z, af, Math.round(Z + W * 2), Math.round(af + U * 2), Math.round(Y), Math.round(aj), 
                Math.round(parseFloat(V, 10)), Math.round(parseFloat(ah, 10))].join(", ");
                this.node.path = this.Path += ae;
                this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(V, 10);
                this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(ah, 10);
                this.last.isAbsolute = this.isAbsolute;
                this.attrs.path += (this.isAbsolute ? "A" : "a") + [W, U, 0, ad, X, V, ah];
                return this;
            };
            Q.cplineTo = function (U, aa, W)
            {
                if (!W) {
                    return this.lineTo(U, aa)
                }
                else
                {
                    var ab = Math.round(Math.round(parseFloat(U, 10) * 100) / 100), Z = Math.round(Math.round(parseFloat(aa, 
                    10) * 100) / 100), ac = Math.round(Math.round(parseFloat(W, 10) * 100) / 100), Y = this.isAbsolute ? "c" : "v", 
                    X = [Math.round(this.last.x) + ac, Math.round(this.last.y), ab - ac, Z, ab, Z], V = [this.last.x + W, 
                    this.last.y, U - W, aa, U, aa];
                    Y += X.join(" ") + " ";
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + X[4];
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + X[5];
                    this.last.bx = X[2];
                    this.last.by = X[3];
                    this.node.path = this.Path += Y;
                    this.attrs.path += (this.isAbsolute ? "C" : "c") + V;
                    return this;
                }
            };
            Q.curveTo = function ()
            {
                var W = this.isAbsolute ? "c" : "v";
                if (arguments.length == 6)
                {
                    this.last.bx = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[2], 10);
                    this.last.by = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[3], 10);
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[4], 10);
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[5], 10);
                    W += [Math.round(parseFloat(arguments[0], 10)), Math.round(parseFloat(arguments[1], 
                    10)), Math.round(parseFloat(arguments[2], 10)), Math.round(parseFloat(arguments[3], 
                    10)), Math.round(parseFloat(arguments[4], 10)), Math.round(parseFloat(arguments[5], 
                    10))].join(" ") + " ";
                    this.last.isAbsolute = this.isAbsolute;
                    this.attrs.path += (this.isAbsolute ? "C" : "c") + Array.prototype.splice.call(arguments, 
                    0, arguments.length)
                }
                if (arguments.length == 4)
                {
                    var V = this.last.x * 2 - this.last.bx;
                    var U = this.last.y * 2 - this.last.by;
                    this.last.bx = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[0], 10);
                    this.last.by = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[1], 10);
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[2], 10);
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[3], 10);
                    W += [Math.round(V), Math.round(U), Math.round(parseFloat(arguments[0], 10)), Math.round(parseFloat(arguments[1], 
                    10)), Math.round(parseFloat(arguments[2], 10)), Math.round(parseFloat(arguments[3], 
                    10))].join(" ") + " ";
                    this.attrs.path += (this.isAbsolute ? "S" : "s") + Array.prototype.splice.call(arguments, 
                    0, arguments.length)
                }
                this.node.path = this.Path += W;
                return this;
            };
            Q.qcurveTo = function ()
            {
                var U = "qb";
                if (arguments.length == 4)
                {
                    this.last.qx = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[0], 10);
                    this.last.qy = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[1], 10);
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[2], 10);
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[3], 10);
                    U += [Math.round(this.last.qx), Math.round(this.last.qy), Math.round(this.last.x), 
                    Math.round(this.last.y)].join(" ") + " ";
                    this.last.isAbsolute = this.isAbsolute;
                    this.attrs.path += (this.isAbsolute ? "Q" : "q") + Array.prototype.splice.call(arguments, 
                    0, arguments.length)
                }
                if (arguments.length == 2)
                {
                    this.last.qx = this.last.x * 2 - this.last.qx;
                    this.last.qy = this.last.y * 2 - this.last.qy;
                    this.last.x = (this.isAbsolute ? 0 : this.last.x) + parseFloat(arguments[2], 10);
                    this.last.y = (this.isAbsolute ? 0 : this.last.y) + parseFloat(arguments[3], 10);
                    U += [Math.round(this.last.qx), Math.round(this.last.qy), Math.round(this.last.x), 
                    Math.round(this.last.y)].join(" ") + " ";
                    this.attrs.path += (this.isAbsolute ? "T" : "t") + Array.prototype.splice.call(arguments, 
                    0, arguments.length)
                }
                this.node.path = this.Path += U;
                this.path.push({
                    type : "qcurve", arg : [].slice.call(arguments, 0), pos : this.isAbsolute
                });
                return this;
            };
            Q.addRoundedCorner = function (X, V)
            {
                var W = 0.5522 * X, U = this.isAbsolute, Z = this;
                if (U) {
                    this.relatively();
                    U = function ()
                    {
                        Z.absolutely()
                    }
                }
                else {
                    U = function () {}
                }
                var Y = 
                {
                    l : function ()
                    {
                        return {
                            u : function ()
                            {
                                Z.curveTo(-W, 0, - X, - (X - W), - X, - X)
                            },
                            d : function ()
                            {
                                Z.curveTo(-W, 0, - X, X - W, - X, X)
                            }
                        }
                    },
                    r : function ()
                    {
                        return {
                            u : function ()
                            {
                                Z.curveTo(W, 0, X, - (X - W), X, - X)
                            },
                            d : function ()
                            {
                                Z.curveTo(W, 0, X, X - W, X, X)
                            }
                        }
                    },
                    u : function ()
                    {
                        return {
                            r : function ()
                            {
                                Z.curveTo(0, - W, - (W - X), - X, X, - X)
                            },
                            l : function ()
                            {
                                Z.curveTo(0, - W, W - X, - X, - X, - X)
                            }
                        }
                    },
                    d : function ()
                    {
                        return {
                            r : function ()
                            {
                                Z.curveTo(0, W, - (W - X), X, X, X)
                            },
                            l : function ()
                            {
                                Z.curveTo(0, W, W - X, X, - X, X)
                            }
                        }
                    }
                };
                Y[V.charAt(0)]()[V.charAt(1)]();
                U();
                return Z;
            };
            Q.andClose = function ()
            {
                this.node.path = (this.Path += "x e");
                this.attrs.path += "z";
                return this;
            };
            if (e) {
                Q.absolutely();
                Q.attrs.path = "";
                a.pathfinder(Q, "" + e)
            }
            B(Q, T);
            if (T.gradient) {
                u(Q, T.gradient)
            }
            return Q;
        };
        var B = function (e, i)
        {
            var W = e.node.style, Q = e;
            e.attrs = e.attrs || {};
            for (var P in i) {
                e.attrs[P] = i[P]
            }
            if (i.path && e.type == "path") {
                e.Path = "";
                e.path = [];
                a.pathfinder(e, i.path)
            }
            if (i.rotation != null) {
                e.rotate(i.rotation, true)
            }
            if (i.translation) {
                var V = (i.translation + "").split(N);
                e.translate(V[0], V[1])
            }
            if (i.scale) {
                var V = (i.scale + "").split(N);
                e.scale(V[0], V[1])
            }
            if (e.type == "image" && i.src) {
                e.node.src = i.src
            }
            if (e.type == "image" && i.opacity)
            {
                e.node.filterOpacity = " progid:DXImageTransform.Microsoft.Alpha(opacity=" + (i.opacity * 100) + ")";
                e.node.style.filter = (e.node.filterMatrix || "") + (e.node.filterOpacity || "")
            }
            i.font && (W.font = i.font);
            i["font-family"] && (W.fontFamily = i["font-family"]);
            i["font-size"] && (W.fontSize = i["font-size"]);
            i["font-weight"] && (W.fontWeight = i["font-weight"]);
            i["font-style"] && (W.fontStyle = i["font-style"]);
            if (typeof i.opacity != "undefined" || typeof i["stroke-width"] != "undefined" || typeof i.fill != "undefined" || typeof i.stroke != "undefined" || i["stroke-width"] || i["stroke-opacity"] || i["stroke-dasharray"] || i["stroke-miterlimit"] || i["stroke-linejoin"] || i["stroke-linecap"])
            {
                e = e.shape || e.node;
                var U = (e.getElementsByTagName("fill") && e.getElementsByTagName("fill")[0]) || L("fill");
                if ("fill-opacity" in i || "opacity" in i) {
                    U.opacity = ((+i["fill-opacity"] + 1 || 2) - 1) * ((+i.opacity + 1 || 2) - 1)
                }
                if (i.fill) {
                    U.on = true
                }
                if (typeof U.on == "undefined" || i.fill == "none") {
                    U.on = false
                }
                if (U.on && i.fill)
                {
                    var O = i.fill.match(/^url\(([^\)]+)\)$/i);
                    if (O) {
                        U.src = O[1];
                        U.type = "tile"
                    }
                    else {
                        U.color = F(i.fill).hex;
                        U.src = "";
                        U.type = "solid";
                    }
                }
                e.appendChild(U);
                var T = (e.getElementsByTagName("stroke") && e.getElementsByTagName("stroke")[0]) || L("stroke");
                if ((i.stroke && i.stroke != "none") || i["stroke-width"] || typeof i["stroke-opacity"] != "undefined" || i["stroke-dasharray"] || i["stroke-miterlimit"] || i["stroke-linejoin"] || i["stroke-linecap"]) {
                    T.on = true
                }
                if (i.stroke == "none" || typeof T.on == "undefined" || i.stroke == 0) {
                    T.on = false
                }
                if (T.on && i.stroke) {
                    T.color = F(i.stroke).hex
                }
                T.opacity = ((+i["stroke-opacity"] + 1 || 2) - 1) * ((+i.opacity + 1 || 2) - 1);
                i["stroke-linejoin"] && (T.joinstyle = i["stroke-linejoin"] || "miter");
                T.miterlimit = i["stroke-miterlimit"] || 8;
                i["stroke-linecap"] && (T.endcap = {
                    butt : "flat", square : "square", round : "round"
                }
                [i["stroke-linecap"]] || "miter");
                i["stroke-width"] && (T.weight = (parseFloat(i["stroke-width"], 10) || 1) * 12 / 16);
                if (i["stroke-dasharray"])
                {
                    var R = 
                    {
                        "-" : "shortdash", "." : "shortdot", "-." : "shortdashdot", "-.." : "shortdashdotdot", 
                        ". " : "dot", "- " : "dash", "--" : "longdash", "- ." : "dashdot", "--." : "longdashdot", 
                        "--.." : "longdashdotdot"
                    };
                    T.dashstyle = R[i["stroke-dasharray"]] || ""
                }
                e.appendChild(T)
            }
            if (Q.type == "text")
            {
                var S = d.createElement("span"), W = S.style;
                Q.attrs.font && (W.font = Q.attrs.font);
                Q.attrs["font-family"] && (W.fontFamily = Q.attrs["font-family"]);
                Q.attrs["font-size"] && (W.fontSize = Q.attrs["font-size"]);
                Q.attrs["font-weight"] && (W.fontWeight = Q.attrs["font-weight"]);
                Q.attrs["font-style"] && (W.fontStyle = Q.attrs["font-style"]);
                Q.node.parentNode.appendChild(S);
                S.innerText = Q.node.string;
                Q.W = Q.attrs.w = S.offsetWidth;
                Q.H = Q.attrs.h = S.offsetHeight;
                Q.X = Q.attrs.x - Math.round(Q.W / 2);
                Q.Y = Q.attrs.y - Math.round(Q.H / 2);
                Q.node.parentNode.removeChild(S)
            }
        };
        var m = function (i, e, Q, P)
        {
            var O = Math.round(Math.atan((parseFloat(Q, 10) - parseFloat(i, 10)) / (parseFloat(P, 10) - parseFloat(e, 
            10))) * 57.29) || 0;
            if (!O && parseFloat(i, 10) < parseFloat(e, 10)) {
                O = 180
            }
            O -= 180;
            if (O < 0) {
                O += 360
            }
            return O;
        };
        var u = function (U, T)
        {
            T = l(T);
            U.attrs = U.attrs || {};
            var P = U.attrs;
            U.attrs.gradient = T;
            U = U.shape || U[0];
            var S = U.getElementsByTagName("fill");
            if (S.length) {
                S = S[0]
            }
            else {
                S = L("fill")
            }
            if (T.dots.length)
            {
                S.on = true;
                S.method = "none";
                S.type = ((T.type + "").toLowerCase() == "radial") ? "gradientTitle" : "gradient";
                if (typeof T.dots[0].color != "undefined") {
                    S.color = F(T.dots[0].color).hex
                }
                if (typeof T.dots[T.dots.length - 1].color != "undefined") {
                    S.color2 = F(T.dots[T.dots.length - 1].color).hex
                }
                var e = [];
                for (var Q = 0, R = T.dots.length; Q < R; Q++) {
                    if (T.dots[Q].offset) {
                        e.push(T.dots[Q].offset + " " + F(T.dots[Q].color).hex)
                    }
                }
                var O = typeof T.dots[T.dots.length - 1].opacity == "undefined" ? (typeof P.opacity == "undefined" ? 1 : P.opacity) : T.dots[T.dots.length - 1].opacity;
                if (e.length) {
                    S.colors.value = e.join(",");
                    O = typeof P.opacity == "undefined" ? 1 : P.opacity
                }
                else {
                    S.colors.value = "0% " + S.color
                }
                S.opacity = O;
                if (typeof T.angle != "undefined") {
                    S.angle = (-T.angle + 270) % 360
                }
                else {
                    if (T.vector) {
                        S.angle = m.apply(null, T.vector);
                    }
                }
                if ((T.type + "").toLowerCase() == "radial") {
                    S.focus = "100%";
                    S.focusposition = "0.5 0.5";
                }
            }
        };
        var k = function (Q, S, e)
        {
            var R = 0, O = 0, i = 0, P = 1;
            this [0] = Q;
            this.node = Q;
            this.X = 0;
            this.Y = 0;
            this.attrs = {};
            this.Group = S;
            this.vml = e;
            this._ = {
                tx : 0, ty : 0, rt : {
                    deg : 0
                },
                sx : 1, sy : 1
            }
        };
        k.prototype.rotate = function (i, e, O)
        {
            if (i == null) {
                return this._.rt.deg
            }
            i = i.toString().split(N);
            if (i.length - 1) {
                e = parseFloat(i[1], 10);
                O = parseFloat(i[2], 10)
            }
            i = parseFloat(i[0], 10);
            if (O == null) {
                e = null
            }
            if (e != null) {
                this._.rt.deg = i
            }
            else {
                this._.rt.deg += i
            }
            this._.rt.cx = e;
            this._.rt.cy = O;
            this.setBox(null, e, O);
            this.Group.style.rotation = this._.rt.deg;
            return this;
        };
        k.prototype.setBox = function (Q, R, P)
        {
            var e = this.Group.style, S = (this.shape && this.shape.style) || this.node.style;
            for (var T in Q) {
                this.attrs[T] = Q[T]
            }
            R = R || this._.rt.cx;
            P = P || this._.rt.cy;
            var W = this.attrs, Z, Y, aa, V;
            switch (this.type)
            {
                case "circle":
                    Z = W.cx - W.r;
                    Y = W.cy - W.r;
                    aa = V = W.r * 2;
                    break;
                case "ellipse":
                    Z = W.cx - W.rx;
                    Y = W.cy - W.ry;
                    aa = W.rx * 2;
                    V = W.ry * 2;
                    break;
                case "rect":
                case "image":
                    Z = W.x;
                    Y = W.y;
                    aa = W.width || 0;
                    V = W.height || 0;
                    break;
                case "text":
                    this.textpath.v = ["m", Math.round(W.x), ", ", Math.round(W.y - 2), "l", Math.round(W.x) + 1, 
                    ", ", Math.round(W.y - 2)].join("");
                    Z = W.x - Math.round(this.W / 2);
                    Y = W.y - this.H / 2;
                    aa = this.W;
                    V = this.H;
                    break;
                case "path":
                    if (!this.attrs.path) {
                        Z = 0;
                        Y = 0;
                        aa = this.vml.width;
                        V = this.vml.height
                    }
                    else {
                        var U = v(this.attrs.path), Z = U.x;
                        Y = U.y;
                        aa = U.width;
                        V = U.height
                    }
                    break;
                default:
                    Z = 0;
                    Y = 0;
                    aa = this.vml.width;
                    V = this.vml.height;
                    break
            }
            R = (R == null) ? Z + aa / 2 : R;
            P = (P == null) ? Y + V / 2 : P;
            var O = R - this.vml.width / 2, X = P - this.vml.height / 2;
            if (this.type == "path" || this.type == "text")
            {
                e.left = O + "px";
                e.top = X + "px";
                this.X = this.type == "text" ? Z :- O;
                this.Y = this.type == "text" ? Y :- X;
                this.W = aa;
                this.H = V;
                S.left =- O + "px";
                S.top =- X + "px"
            }
            else
            {
                e.left = O + "px";
                e.top = X + "px";
                this.X = Z;
                this.Y = Y;
                this.W = aa;
                this.H = V;
                e.width = this.vml.width + "px";
                e.height = this.vml.height + "px";
                S.left = Z - O + "px";
                S.top = Y - X + "px";
                S.width = aa + "px";
                S.height = V + "px";
            }
        };
        k.prototype.hide = function ()
        {
            this.Group.style.display = "none";
            return this;
        };
        k.prototype.show = function ()
        {
            this.Group.style.display = "block";
            return this;
        };
        k.prototype.getBBox = function ()
        {
            return {
                x : this.X, y : this.Y, width : this.W, height : this.H
            }
        };
        k.prototype.remove = function ()
        {
            this [0].parentNode.removeChild(this [0]);
            this.Group.parentNode.removeChild(this.Group);
            this.shape && this.shape.parentNode.removeChild(this.shape)
        };
        k.prototype.attr = function ()
        {
            if (arguments.length == 1 && typeof arguments[0] == "string")
            {
                if (arguments[0] == "translation") {
                    return this.translate()
                }
                return this.attrs[arguments[0]]
            }
            if (this.attrs && arguments.length == 1 && arguments[0] instanceof Array)
            {
                var e = {};
                for (var O = 0, P = arguments[0].length; O < P; O++) {
                    e[arguments[0][O]] = this.attrs[arguments[0][O]]
                }
                return e
            }
            var Q;
            if (arguments.length == 2) {
                Q = {};
                Q[arguments[0]] = arguments[1]
            }
            if (arguments.length == 1 && typeof arguments[0] == "object") {
                Q = arguments[0]
            }
            if (Q)
            {
                if (Q.gradient) {
                    u(this, Q.gradient)
                }
                if (Q.text && this.type == "text") {
                    this.node.string = Q.text
                }
                if (Q.id) {
                    this.node.id = Q.id
                }
                B(this, Q);
                this.setBox(Q)
            }
            return this;
        };
        k.prototype.toFront = function ()
        {
            this.Group.parentNode.appendChild(this.Group);
            return this;
        };
        k.prototype.toBack = function ()
        {
            if (this.Group.parentNode.firstChild != this.Group) {
                this.Group.parentNode.insertBefore(this.Group, this.Group.parentNode.firstChild)
            }
            return this;
        };
        k.prototype.insertAfter = function (e)
        {
            if (e.Group.nextSibling) {
                e.Group.parentNode.insertBefore(this.Group, e.Group.nextSibling)
            }
            else {
                e.Group.parentNode.appendChild(this.Group)
            }
            return this;
        };
        k.prototype.insertBefore = function (e)
        {
            e.Group.parentNode.insertBefore(this.Group, e.Group);
            return this;
        };
        var w = function (i, e, S, Q)
        {
            var P = L("group");
            var R = L("oval");
            P.appendChild(R);
            i.canvas.appendChild(P);
            var O = new k(R, P, i);
            O.type = "circle";
            B(O, {
                stroke : "#000", fill : "none"
            });
            O.attrs.cx = e;
            O.attrs.cy = S;
            O.attrs.r = Q;
            O.setBox({
                x : e - Q, y : S - Q, width : Q * 2, height : Q * 2
            });
            return O;
        };
        var D = function (i, T, S, U, P, e)
        {
            var Q = L("group");
            var O = L(e ? "roundrect" : "rect");
            if (e) {
                O.arcsize = e / (Math.min(U, P))
            }
            Q.appendChild(O);
            i.canvas.appendChild(Q);
            var R = new k(O, Q, i);
            R.type = "rect";
            B(R, {
                stroke : "#000"
            });
            R.attrs.x = T;
            R.attrs.y = S;
            R.attrs.w = U;
            R.attrs.h = P;
            R.attrs.r = e;
            R.setBox({
                x : T, y : S, width : U, height : P
            });
            return R;
        };
        var f = function (i, e, T, R, Q)
        {
            var P = L("group");
            var S = L("oval");
            P.appendChild(S);
            i.canvas.appendChild(P);
            var O = new k(S, P, i);
            O.type = "ellipse";
            B(O, {
                stroke : "#000"
            });
            O.attrs.cx = e;
            O.attrs.cy = T;
            O.attrs.rx = R;
            O.attrs.ry = Q;
            O.setBox({
                x : e - R, y : T - Q, width : R * 2, height : Q * 2
            });
            return O;
        };
        var n = function (i, e, T, S, U, P)
        {
            var Q = L("group");
            var O = L("image");
            O.src = e;
            Q.appendChild(O);
            i.canvas.appendChild(Q);
            var R = new k(O, Q, i);
            R.type = "image";
            R.attrs.x = T;
            R.attrs.y = S;
            R.attrs.w = U;
            R.attrs.h = P;
            R.setBox({
                x : T, y : S, width : U, height : P
            });
            return R;
        };
        var C = function (i, V, U, W)
        {
            var R = L("group"), Q = R.style;
            var P = L("shape"), T = P.style;
            var X = L("path"), e = X.style;
            X.v = ["m", Math.round(V), ", ", Math.round(U - 2), "l", Math.round(V) + 1, ", ", Math.round(U - 2)].join("");
            X.textpathok = true;
            T.width = i.width;
            T.height = i.height;
            Q.position = "absolute";
            Q.left = 0;
            Q.top = 0;
            Q.width = i.width;
            Q.height = i.height;
            var O = L("textpath");
            O.string = W;
            O.on = true;
            O.coordsize = i.coordsize;
            O.coordorigin = i.coordorigin;
            P.appendChild(O);
            P.appendChild(X);
            R.appendChild(P);
            i.canvas.appendChild(R);
            var S = new k(O, R, i);
            S.shape = P;
            S.textpath = X;
            S.type = "text";
            S.attrs.x = V;
            S.attrs.y = U;
            S.attrs.w = 1;
            S.attrs.h = 1;
            B(S, {
                font : o.font, stroke : "none", fill : "#000"
            });
            return S;
        };
        var z = function (i, e)
        {
            this.width = i || this.width;
            this.height = e || this.height;
            this.canvas.style.width = this.width + "px";
            this.canvas.style.height = this.height + "px";
            this.canvas.parentNode.style.clip = "rect(0 " + this.width + " " + this.height + " 0)";
            this.canvas.coordsize = this.width + " " + this.height;
            return this;
        };
        d.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
        try
        {
            if (!d.namespaces.rvml) {
                d.namespaces.add("rvml", "urn:schemas-microsoft-com:vml")
            }
            var L = function (e)
            {
                return d.createElement("<rvml:" + e + ' class="rvml">');
            }
        }
        catch (K)
        {
            var L = function (e)
            {
                return d.createElement("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
            }
        }
        var j = function ()
        {
            var O, P, W;
            if (typeof arguments[0] == "string") {
                O = d.getElementById(arguments[0]);
                P = arguments[1];
                W = arguments[2]
            }
            if (typeof arguments[0] == "object") {
                O = arguments[0];
                P = arguments[1];
                W = arguments[2]
            }
            if (typeof arguments[0] == "number") {
                O = 1;
                x = arguments[0];
                y = arguments[1];
                P = arguments[2];
                W = arguments[3]
            }
            if (!O) {
                throw new Error("VML container not found.")
            }
            var T = d.createElement("div"), S = d.createElement("div"), e = a.canvas = L("group"), R = T.style, 
            Q = e.style;
            a.width = P;
            a.height = W;
            P = P || "320px";
            W = W || "200px";
            R.clip = "rect(0 " + P + "px " + W + "px 0)";
            R.top = "-2px";
            R.left = "-2px";
            R.position = "absolute";
            Q.position = "absolute";
            S.style.position = "relative";
            Q.width = P;
            Q.height = W;
            e.coordsize = (/%$/.test(P) ? P : parseFloat(P, 10)) + " " + (/%$/.test(W) ? W : parseFloat(W, 
            10));
            e.coordorigin = "0 0";
            var U = L("rect"), V = U.style;
            V.left = V.top = 0;
            V.width = Q.width;
            V.height = Q.height;
            U.filled = U.stroked = "f";
            e.appendChild(U);
            T.appendChild(e);
            S.appendChild(T);
            if (O == 1)
            {
                d.body.appendChild(S);
                R.position = "absolute";
                R.left = x + "px";
                R.top = y + "px";
                R.width = P;
                R.height = W;
                O = {
                    style : {
                        width : P, height : W
                    }
                }
            }
            else
            {
                R.width = O.style.width = P;
                R.height = O.style.height = W;
                if (O.firstChild) {
                    O.insertBefore(S, O.firstChild)
                }
                else {
                    O.appendChild(S)
                }
            }
            for (var i in a) {
                O[i] = a[i]
            }
            for (var i in c.fn) {
                if (!O[i]) {
                    O[i] = c.fn[i];
                }
            }
            O.clear = function ()
            {
                var X = [];
                for (var Y = 0, Z = e.childNodes.length; Y < Z; Y++) {
                    if (e.childNodes[Y] != U) {
                        X.push(e.childNodes[Y])
                    }
                }
                for (Y = 0, Z = X.length; Y < Z; Y++) {
                    e.removeChild(X[Y])
                }
            };
            return O;
        };
        a.remove = function ()
        {
            this.canvas.parentNode.parentNode.parentNode.removeChild(this.canvas.parentNode.parentNode)
        };
        a.safari = function () {}
    }
    var g = (function ()
    {
        if (d.addEventListener)
        {
            return function (Q, O, i, e)
            {
                var P = function (R)
                {
                    return i.call(e, R);
                };
                Q.addEventListener(O, P, false);
                return function ()
                {
                    Q.removeEventListener(O, P, false);
                    return true;
                }
            }
        }
        else
        {
            if (d.attachEvent)
            {
                return function (R, P, O, i)
                {
                    var Q = function (S)
                    {
                        return O.call(i, S || G.event);
                    };
                    R.attachEvent("on" + P, Q);
                    var e = function ()
                    {
                        R.detachEvent("on" + P, Q);
                        return true;
                    };
                    if (P == "mouseover")
                    {
                        R.attachEvent("onmouseenter", Q);
                        return function ()
                        {
                            R.detachEvent("onmouseenter", Q);
                            return e();
                        }
                    }
                    else
                    {
                        if (P == "mouseout")
                        {
                            R.attachEvent("onmouseleave", Q);
                            return function ()
                            {
                                R.detachEvent("onmouseleave", Q);
                                return e();
                            }
                        }
                    }
                    return e;
                }
            }
        }
    })();
    for (var H = r.length; H--; )
    {
        (function (e)
        {
            k.prototype[e] = function (i)
            {
                if (typeof i == "function")
                {
                    this.events = this.events || {};
                    this.events[e] = this.events[e] || {};
                    this.events[e][i] = this.events[e][i] || [];
                    this.events[e][i].push(g(this.shape || this.node, e, i, this))
                }
                return this;
            };
            k.prototype["un" + e] = function (i)
            {
                this.events && this.events[e] && this.events[e][i] && this.events[e][i].length && this.events[e][i].shift()() && !this.events[e][i].length && delete this.events[e][i]
            }
        })(r[H])
    }
    a.circle = function (e, O, i)
    {
        return w(this, e, O, i);
    };
    a.rect = function (e, Q, i, O, P)
    {
        return D(this, e, Q, i, O, P);
    };
    a.ellipse = function (e, P, O, i)
    {
        return f(this, e, P, O, i);
    };
    a.path = function (i, e)
    {
        return M(i, e, this);
    };
    a.image = function (P, e, Q, i, O)
    {
        return n(this, P, e, Q, i, O);
    };
    a.text = function (e, O, i)
    {
        return C(this, e, O, i);
    };
    a.group = function ()
    {
        return this;
    };
    a.drawGrid = function (V, U, W, S, R, T, P)
    {
        P = P || "#000";
        var X = ["M", V, U, "L", V + W, U, V + W, U + S, V, U + S, V, U], e = S / T, O = W / R;
        for (var Q = 1; Q < T; Q++) {
            X = X.concat(["M", V, U + Q * e, "L", V + W, U + Q * e])
        }
        for (var Q = 1; Q < R; Q++) {
            X = X.concat(["M", V + Q * O, U, "L", V + Q * O, U + S])
        }
        return this.path(
        {
            stroke : P, "stroke-width" : 1
        },
        X.join(","))
    };
    a.pathfinder = function (S, R)
    {
        var O = 
        {
            M : function (i, T)
            {
                this.moveTo(i, T)
            },
            C : function (V, X, T, W, i, U)
            {
                this.curveTo(V, X, T, W, i, U)
            },
            Q : function (T, V, i, U)
            {
                this.qcurveTo(T, V, i, U)
            },
            T : function (i, T)
            {
                this.qcurveTo(i, T)
            },
            S : function (T, V, i, U)
            {
                S.curveTo(T, V, i, U)
            },
            L : function (i, T)
            {
                S.lineTo(i, T)
            },
            H : function (i)
            {
                this.lineTo(i, this.last.y)
            },
            V : function (i)
            {
                this.lineTo(this.last.x, i)
            },
            A : function (W, V, T, U, X, i, Y)
            {
                this.arcTo(W, V, U, X, i, Y)
            },
            Z : function ()
            {
                this.andClose()
            }
        };
        R = s(R);
        for (var P = 0, Q = R.length; P < Q; P++) {
            var e = R[P].shift();
            O[e].apply(S, R[P])
        }
    };
    a.set = function (e)
    {
        return new h(e);
    };
    a.setSize = z;
    k.prototype.stop = function ()
    {
        clearTimeout(this.animation_in_progress)
    };
    k.prototype.scale = function (V, U)
    {
        if (V == undefined && U == undefined) {
            return {
                x : this._.sx, y : this._.sy
            }
        }
        U = U || V;
        isNaN(U) && (U = V);
        var ad, aa, O, e;
        if (V != 0)
        {
            var Y = Math.round(V / Math.abs(V)), W = Math.round(U / Math.abs(U)), ac = this.node.style;
            ad = this.attr("x");
            aa = this.attr("y");
            O = this.attr("cx");
            e = this.attr("cy");
            if (Y != 1 || W != 1)
            {
                if (this.transformations)
                {
                    this.transformations[2] = "scale(" + [Y, W] + ")";
                    this.node.setAttribute("transform", this.transformations.join(" "));
                    ad = (Y < 0) ?- this.attr("x") - this.attrs.width * V * Y / this._.sx : this.attr("x");
                    aa = (W < 0) ?- this.attr("y") - this.attrs.height * U * W / this._.sy : this.attr("y");
                    O = this.attr("cx") * Y;
                    e = this.attr("cy") * W
                }
                else
                {
                    this.node.filterMatrix = " progid:DXImageTransform.Microsoft.Matrix(M11=" + Y + ", M12=0, M21=0, M22=" + W + ", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')";
                    ac.filter = (this.node.filterMatrix || "") + (this.node.filterOpacity || "")
                }
            }
            else
            {
                if (this.transformations)
                {
                    this.transformations[2] = "";
                    this.node.setAttribute("transform", this.transformations.join(" "))
                }
                else
                {
                    this.node.filterMatrix = "";
                    ac.filter = (this.node.filterMatrix || "") + (this.node.filterOpacity || "")
                }
            }
            switch (this.type)
            {
                case "rect":
                case "image":
                    this.attr(
                    {
                        width : this.attrs.width * V * Y / this._.sx, height : this.attrs.height * U * W / this._.sy, 
                        x : ad, y : aa
                    });
                    break;
                case "circle":
                case "ellipse":
                    this.attr(
                    {
                        rx : this.attrs.rx * V * Y / this._.sx, ry : this.attrs.ry * U * W / this._.sy, r : this.attrs.r * V * W / this._.sx, 
                        cx : O, cy : e
                    });
                    break;
                case "path":
                    var ab = b(Raphael.parsePathString(this.attr("path"))), X = true, R = v(this.attrs.path), 
                    ad =- R.width * (V - 1) / 2, aa =- R.height * (U - 1) / 2;
                    for (var Q = 0, Z = ab.length; Q < Z; Q++)
                    {
                        if (ab[Q][0].toUpperCase() == "M" && X) {
                            continue
                        }
                        else {
                            X = false
                        }
                        if (ab[Q][0].toUpperCase() == "A") {
                            ab[Q][ab[Q].length - 2] *= V * Y;
                            ab[Q][ab[Q].length - 1] *= U * W
                        }
                        else {
                            for (var P = 1, S = ab[Q].length; P < S; P++) {
                                ab[Q][P] *= (P % 2) ? V * Y / this._.sx : U * W / this._.sy
                            }
                        }
                    }
                    var T = v(ab), ad = R.x + R.width / 2 - T.x - T.width / 2, aa = R.y + R.height / 2 - T.y - T.height / 2;
                    ab = b(ab);
                    ab[0][1] += ad;
                    ab[0][2] += aa;
                    this.attr({
                        path : ab.join(" ")
                    })
            }
        }
        this._.sx = V;
        this._.sy = U;
        return this;
    };
    k.prototype.animate = function (af, Y, Q)
    {
        clearTimeout(this.animation_in_progress);
        var ab = {}, O = {}, W = {}, V = {
            x : 0, y : 0
        };
        for (var Z in af)
        {
            if (Z in q)
            {
                ab[Z] = this.attr(Z);
                if (typeof ab[Z] == "undefined") {
                    ab[Z] = o[Z]
                }
                O[Z] = af[Z];
                switch (q[Z])
                {
                    case "number":
                        W[Z] = (O[Z] - ab[Z]) / Y;
                        break;
                    case "colour":
                        ab[Z] = F(ab[Z]);
                        var aa = F(O[Z]);
                        W[Z] = {
                            r : (aa.r - ab[Z].r) / Y, g : (aa.g - ab[Z].g) / Y, b : (aa.b - ab[Z].b) / Y
                        };
                        break;
                    case "path":
                        var R = A(ab[Z], O[Z]);
                        ab[Z] = R[0];
                        O[Z] = R[1];
                        W[Z] = [];
                        for (var ad = 0, U = ab[Z].length; ad < U; ad++)
                        {
                            W[Z][ad] = [0];
                            for (var ac = 1, ae = ab[Z][ad].length; ac < ae; ac++) {
                                W[Z][ad][ac] = (O[Z][ad][ac] - ab[Z][ad][ac]) / Y
                            }
                        }
                        break;
                    case "csv":
                        var e = af[Z].toString().split(N), T = ab[Z].toString().split(N);
                        if (Z == "translation") {
                            ab[Z] = [0, 0];
                            W[Z] = [e[0] / Y, e[1] / Y]
                        }
                        else
                        {
                            if (Z == "rotation") {
                                ab[Z] = (T[1] == e[1] && T[2] == e[2]) ? T : [0, e[1], e[2]];
                                W[Z] = [(e[0] - ab[Z][0]) / Y, 0, 0]
                            }
                            else {
                                ab[Z] = (ab[Z] + "").split(N);
                                W[Z] = [(e[0] - ab[Z][0]) / Y, (e[1] - ab[Z][0]) / Y];
                            }
                        }
                        O[Z] = e;
                }
            }
        }
        var P = new Date(), X = 0, S = this;
        (function ()
        {
            var ah = (new Date()).getTime() - P.getTime(), ao = {}, ag;
            if (ah < Y)
            {
                for (var al in ab)
                {
                    switch (q[al])
                    {
                        case "number":
                            ag =+ ab[al] + ah * W[al];
                            break;
                        case "colour":
                            ag = "rgb(" + [Math.round(ab[al].r + ah * W[al].r), Math.round(ab[al].g + ah * W[al].g), 
                            Math.round(ab[al].b + ah * W[al].b)].join(",") + ")";
                            break;
                        case "path":
                            ag = [];
                            for (var aj = 0, ap = ab[al].length; aj < ap; aj++)
                            {
                                ag[aj] = [ab[al][aj][0]];
                                for (var ai = 1, ak = ab[al][aj].length; ai < ak; ai++) {
                                    ag[aj][ai] = ab[al][aj][ai] + ah * W[al][aj][ai]
                                }
                                ag[aj] = ag[aj].join(" ")
                            }
                            ag = ag.join(" ");
                            break;
                        case "csv":
                            if (al == "translation") {
                                var an = W[al][0] * (ah - X), am = W[al][1] * (ah - X);
                                V.x += an;
                                V.y += am;
                                ag = [an, am].join(" ")
                            }
                            else
                            {
                                if (al == "rotation") {
                                    ag =+ ab[al][0] + ah * W[al][0];
                                    ab[al][1] && (ag += "," + ab[al][1] + "," + ab[al][2])
                                }
                                else {
                                    ag = [ + ab[al][0] + ah * W[al][0], + ab[al][1] + ah * W[al][1]].join(" ");
                                }
                            }
                            break
                    }
                    if (al == "font-size") {
                        ao[al] = ag + "px"
                    }
                    else {
                        ao[al] = ag;
                    }
                }
                S.attr(ao);
                S.animation_in_progress = setTimeout(arguments.callee, 0);
                a.safari()
            }
            else
            {
                (V.x || V.y) && S.translate(-V.x, - V.y);
                S.attr(af);
                clearTimeout(S.animation_in_progress);
                a.safari();
                (typeof Q == "function") && Q.call(S)
            }
            X = ah;
        })();
        return this;
    };
    k.prototype.translate = function (e, O)
    {
        if (e == null) {
            return {
                x : this._.tx, y : this._.ty
            }
        }
        this._.tx +=+ e;
        this._.ty +=+ O;
        switch (this.type)
        {
            case "circle":
            case "ellipse":
                this.attr({
                    cx : this.attrs.cx + e, cy : this.attrs.cy + O
                });
                break;
            case "rect":
            case "image":
            case "text":
                this.attr({
                    x : this.attrs.x + e, y : this.attrs.y + O
                });
                break;
            case "path":
                var i = b(this.attrs.path);
                i[0][1] +=+ e;
                i[0][2] +=+ O;
                this.attr({
                    path : i.join(" ")
                });
                break
        }
        return this;
    };
    var h = function (O)
    {
        this.items = [];
        this.length = (O && O.length) || 0;
        if (O && O.constructor == Array)
        {
            for (var e = O.length; e--; ) {
                if (O[e].constructor == k) {
                    this.items[this.items.length] = O[e];
                }
            }
        }
    };
    h.prototype.push = function (i)
    {
        if (i && i.constructor == k) {
            var e = this.items.length;
            this.items[e] = i;
            this [e] = i;
            this.length++
        }
        return this;
    };
    h.prototype.pull = function (P)
    {
        var i = this.items.splice(P, 1)[0];
        for (var e = P, O = this.items.length; e < O; e++) {
            this [e] = this [e + 1]
        }
        delete this [O + 1];
        this.length--;
        return i;
    };
    for (var I in k.prototype)
    {
        h.prototype[I] = (function (e)
        {
            return function ()
            {
                for (var O = this.items.length; O--; ) {
                    this.items[O][e].apply(this.items[O], arguments)
                }
                return this;
            }
        })(I)
    }
    h.prototype.getBBox = function ()
    {
        var e = [], S = [], O = [], Q = [];
        for (var P = this.items.length; P--; )
        {
            var R = this.items[P].getBBox();
            e.push(R.x);
            S.push(R.y);
            O.push(R.x + R.width);
            Q.push(R.y + R.height)
        }
        e = Math.min.apply(Math, e);
        S = Math.min.apply(Math, S);
        return {
            x : e, y : S, width : Math.max.apply(Math, O) - e, height : Math.max.apply(Math, Q) - S
        }
    };
    return c;
})();
Time.AutoComplete = function (a, b)
{
    this.suggest = new y5.Suggest(a, Time.PageLayout.geoFinder);
    y5.on("y5:Suggest:select", function (d, c)
    {
        y5.fire("Time:AutoComplete:change", a, d, c)
    }, a, this);
    y5.on("y5:Suggest:noresult", function (d, c)
    {
        y5.fire("Time:AutoComplete:noresult", a, d, c)
    }, a, this);
    y5.on("y5:Suggest:open", function ()
    {
        y5.fire("Time:AutoComplete:open", a)
    }, a, this);
    y5.on("y5:Suggest:close", function ()
    {
        y5.fire("Time:AutoComplete:close", a)
    }, a, this)
};
Time.AutoComplete.prototype = 
{
    enable : function ()
    {
        this.suggest.enable()
    },
    disable : function ()
    {
        this.suggest.disable()
    }
};
y5.require(["Widget.Menu", "Suggest"], function ()
{
    y5.loaded("Time:AutoComplete")
});
Time.GeoFinder = function ()
{
    this.data = geodata;
    this.maxItems = 10;
};
Time.GeoFinder.prototype = 
{
    process : function (d, a)
    {
        a = a || this.maxItems;
        var c = [];
        var b = y5.String.trim(d.toLowerCase());
        if (b)
        {
            this.data.filter(function (e)
            {
                return (y5.String.startsWith(e[1].toLowerCase(), b));
            }).forEach(function (e)
            {
                c.push({
                    id : e[0], value : e[1]
                })
            });
            if (c.length > a) {
                c.length = a;
            }
        }
        return {
            elements : c, tokens : d
        }
    }
};
y5.loaded("Time:GeoFinder");
Time.CompareCities = function (a)
{
    this.form = a;
    this.inputs = y5.$$("input.time-city-input", this.form);
    this.ids = y5.$$("input.time-city-id", this.form);
    this.button = y5.$$(".time-compare-button", this.form)[0];
    this.checkCompare();
    this.inputs.forEach(function (c, d)
    {
        var b = this;
        function e(g, f)
        {
            var h = b.ids[d];
            if (h) {
                if (h.value == g) {
                    return
                }
                h.value = g || ""
            }
            if (f) {
                c.value = f
            }
            var i = b.inputs[d + 1];
            window.setTimeout(function ()
            {
                if (i && h.value) {
                    i.focus()
                }
                b.checkCompare()
            }, 100);
            return true
        }
        new Time.AutoComplete(c, e);
        y5.on("Time:AutoComplete:change", e, c, this);
        y5.on("Time:AutoComplete:noresult", e, c, this)
    }, this)
};
Time.CompareCities.prototype = 
{
    writeClockDiff : function (b)
    {
        var a = y5.$("clock-diff-value");
        if (typeof b != "undefined" && a) {
            a.innerHTML = Time.Utils.formatOffset(b);
        }
    },
    checkCompare : function ()
    {
        var a = true, c;
        for (var b = 0; b < this.ids.length; b++)
        {
            c = (this.ids[b].value != "" && this.inputs[b].value != "");
            y5.Classes.assign(this.inputs[b], "fill", c);
            a = a && c
        }
        c = this.button.disabled;
        this.button.disabled = !a;
        if (c && a) {
            this.button.focus()
        }
    }
};
y5.require(["Time:AutoComplete", "Time:ClockControl", "Time:Utils"], function ()
{
    y5.loaded("Time:CompareCities")
});
Time.InformerSelector = function (a)
{
    this.form = a;
    this.input = y5.$$("input.time-city-input", this.form)[0];
    this.select = y5.$$("select.time-city-select", this.form)[0];
    this.initCodeArea();
    this.activateForm();
    this.builderCode();
    y5.on("change", this.showInformer, this.select, this);
    y5.Shortcut.down(["enter", "down"], this.goToList, this.input, this, {
        preventDefault : true, checkTarget : false
    })
};
Time.InformerSelector.prototype = 
{
    activateForm : function ()
    {
        new y5.Form(this.form, true);
        y5.on("y5:valueChanged", this.showCities, this.input, this)
    },
    showCities : function (a)
    {
        var c = Time.PageLayout.geoFinder.process(a.value);
        y5.Dom.clearNode(this.select);
        if (c.elements.length > 0)
        {
            c.elements.forEach(function (f, d)
            {
                var e = y5.Element.create("option", {
                    value : f.id
                });
                e = this.select.appendChild(e);
                e.text = f.value;
            }, this)
        }
        else
        {
            var b = y5.Element.create("option");
            b = this.select.appendChild(b);
            b.innerHTML = "&#8230;";
            b.disabled = true;
        }
    },
    initCodeArea : function ()
    {
        var a = y5.$("options-code");
        y5.on("focus", function (c, b)
        {
            if (typeof (b.select) == "function")
            {
                b.select()
            }
        }, a)
    },
    showInformer : function ()
    {
        var a = this.select.selectedIndex;
        if (a !=- 1) {
            var b = this.select.options[a];
            if (!b.disabled) {
                this.builderCode(b.value)
            }
        }
    },
    goToList : function ()
    {
        this.select.selectedIndex = 0;
        this.showInformer();
        y5.Utils.setTimeout(function ()
        {
            this.select.focus()
        }, 0, this)
    },
    builderCode : function (c)
    {
        var a = y5.$("options-code");
        var e = y5.$("informer");
        var f = y5.$("options-type1");
        var d = y5.$("options-type2");
        var h = d && d.checked ? "vertical" : "informer";
        var b = h == "vertical" ? 110 : 220;
        var i = h == "vertical" ? 220 : 110;
        if (c) {
            Time.PageLayout.currentCity = c
        }
        var g = '<object type="application/x-shockwave-flash" width="' + b + '" height="' + i + '" data="http://img.yandex.net/i/time/clock.swf?3">\r\n    <param name="movie" value="http://img.yandex.net/i/time/clock.swf?3"/>\r\n    <param name="quality" value="high"/>\r\n    <param name="bgcolor" value="#FFFFFF"/>\r\n    <param name="wmode" value="opaque"/>\r\n    <param name="FlashVars" value="id=' + Time.PageLayout.currentCity + "&type=" + h + '"/>\r\n</object>';
        a.value = g;
        e.innerHTML = g;
    }
};
y5.require(["Time:AutoComplete", "Form"], function ()
{
    y5.loaded("Time:InformerSelector")
});
Time.ClockSwitcher = function (a, b)
{
    this.element = a;
    this.init(b)
};
Time.ClockSwitcher.prototype = 
{
    init : function (a)
    {
        this.linkAnalog = y5.$$(".analog", this.element)[0];
        this.linkDigital = y5.$$(".digital", this.element)[0];
        this.observeAnalog = y5.on("click", this.setAnalog, this.linkAnalog, this);
        this.observeDigital = y5.on("click", this.setDigital, this.linkDigital, this);
        if (a == "analog") {
            y5.Classes.add(this.linkAnalog, "current")
        }
        else {
            y5.Classes.add(this.linkDigital, "current")
        }
        y5.Classes.remove(this.element, "invisible")
    },
    setAnalog : function (a)
    {
        a.preventDefault();
        a.stopPropagation();
        a.target.blur();
        if (Time.PageLayout.type == "analog") {
            return
        }
        y5.fire("Time:SwitchType", Time, "analog");
        y5.Classes.remove(this.linkDigital, "current");
        y5.Classes.add(this.linkAnalog, "current");
        y5.Cookie.set("clocktype", "a")
    },
    setDigital : function (a)
    {
        a.preventDefault();
        a.stopPropagation();
        a.target.blur();
        if (Time.PageLayout.type == "digital") {
            return
        }
        y5.fire("Time:SwitchType", Time, "digital");
        y5.Classes.remove(this.linkAnalog, "current");
        y5.Classes.add(this.linkDigital, "current");
        y5.Cookie.set("clocktype", "d")
    }
};
y5.loaded("Time:ClockSwitcher");
Time.IClockControl = function () {};
Time.IClockControl.prototype = 
{
    _setSunriseAndSunset : function (b, a)
    {
        this.sunrise = new Date(Time.PageLayout.gmt * 1000 + this.offset * 1000);
        this.sunrise.setUTCHours(7);
        this.sunrise.setUTCMinutes(0);
        this.sunrise.setUTCSeconds(0);
        this.sunset = new Date(Time.PageLayout.gmt * 1000 + this.offset * 1000);
        this.sunset.setUTCHours(19);
        this.sunset.setUTCMinutes(0);
        this.sunset.setUTCSeconds(0)
    },
    setNextTime : function ()
    {
        this._refreshCurrentTime();
        this._setCurrentTime(this.currentTime)
    },
    _initDigitalClockNode : function ()
    {
        Time.ClockDigitalRenderer.initNode(this)
    },
    _setCurrentTime : function (b)
    {
        if (!b) {
            b = this.getCurrentTime()
        }
        if (!this [this.type + "Node"]) {
            this.renderer.createNode(this, b)
        }
        else {
            this.renderer.setCurrentTime(this, b)
        }
        var a = this.currentTime.getDate();
        if (!this.lastDate) {
            this.lastDate = a
        }
        if (this.lastDate != a) {
            this._setClockInfo(false)
        }
    },
    _refreshCurrentTime : function ()
    {
        var a = this._getOffset(this);
        this.currentTime = new Date(Time.PageLayout.gmt * 1000 + a * 1000);
    },
    getCurrentTime : function ()
    {
        if (!this.currentTime) {
            this._refreshCurrentTime()
        }
        return this.currentTime;
    },
    _getOffset : function ()
    {
        var a;
        if (!this.clockSwitchTime) {
            return this.offset
        }
        if (this.clockSwitchTime.toSummer.getTime() <= Time.PageLayout.gmt * 1000 && this.clockSwitchTime.toWinter.getTime() > Time.PageLayout.gmt * 1000) {
            a = (Time.Utils.russianOffsets[this.tz] + 1) * 60 * 60
        }
        else {
            a = Time.Utils.russianOffsets[this.tz] * 60 * 60
        }
        if (this.offset != a) {
            this.offset = a;
            y5.fire("Time:OffsetChanging", this, true)
        }
        return a;
    },
    _activateNode : function (a)
    {
        this._refreshParentClass(a);
        if (!this [a + "Node"]) {
            var c = this.getCurrentTime();
            this.renderer.createNode(this, c)
        }
        else
        {
            if (a == "digital")
            {
                if (y5.Classes.test(this [a + "Node"], "b-clock-digital-start")) {
                    y5.Classes.remove(this [a + "Node"], "b-clock-digital-start")
                }
                this._setCurrentTime();
                y5.Classes.remove(this [a + "Node"], "g-hidden")
            }
            if (a == "analog")
            {
                this [a + "Node"].style.visibility = "hidden";
                y5.Classes.remove(this [a + "Node"], "g-hidden");
                var b = this;
                window.setTimeout(function ()
                {
                    b._setCurrentTime();
                    b[a + "Node"].style.visibility = "visible";
                    b.paper.safari()
                }, 10)
            }
        }
    },
    _disactivateNode : function (a)
    {
        if (this [a + "Node"]) {
            y5.Classes.add(this [a + "Node"], "g-hidden")
        }
    },
    _refreshParentClass : function (a) {},
    switchType : function (a)
    {
        if (this.type == a) {
            return
        }
        this._disactivateNode(this._getOpposedType(a));
        this.type = a;
        this.renderer = (this.type == "digital") ? Time.ClockDigitalRenderer : Time.ClockAnalogRenderer;
        this._activateNode(a)
    },
    _getOpposedType : function (a)
    {
        return (a == "digital") ? "analog" : "digital";
    },
    _setClockInfo : function ()
    {
        this.infoText = Time.Utils.formatOffset(this.offset, true) + " " + this.parentName + "<br/>";
        this.infoText += Time.Utils.getFullDayInfo(this);
        this.lineNums = Time.Utils.countLineNums(this.infoText);
    },
    writeClockInfo : function ()
    {
        var b = this.infoText;
        for (var a = this.lineNums; a <= Time.PageLayout.maxLineNums; a++) {
            b += "<br/>"
        }
        this.info.innerHTML = b;
    },
    _getClockOffset : function ()
    {
        if (!this.tz) {
            return this.offset;
        }
    },
    resetClockData : function (a)
    {
        this.offset = a.offset;
        this.parentName = a.parent;
        this.tz = a.tz;
        this.clockSwitchTime = Time.Utils.getClockSwitchTime(this.tz);
        this._setSunriseAndSunset(a.sunrise, a.sunset);
        this.weatherIconSrc = a.weather_icon;
        if (this.weatherIconSrc) {
            this.iconSize = {
                width : a.weather_icon_width, height : a.weather_icon_height
            }
        }
        this._refreshCurrentTime()
    },
    onCityDataChanging : function (a)
    {
        this._setClockInfo(a);
        if (this.analogNode) {
            Time.ClockAnalogRenderer.setWeatherIcon(this)
        }
    },
    onNewCitySelected : function (a, c, b)
    {
        this.resetClockData(b);
        this.onCityDataChanging();
        this.title.innerHTML = c;
        this.input.value = c;
        this.geoId = a;
        if (this.id == "clock-1") {
            Time.PageLayout.currentCity = this.geoId
        }
        y5.fire("Time:ClockInfoChanging", document);
    },
    _setExtraControlIntervals : function ()
    {
        this.extraControlIntervals = Time.Utils.getExtraControlIntervals(this.tz);
    },
    _getGeoIdFromDom : function ()
    {
        return y5.$$(".time-city-id", this.element)[0].innerHTML;
    }
};
y5.require(["Time:AutoComplete", "Time:ClockDigitalRenderer", "Time:ClockAnalogRenderer", "Time:Utils", 
"Form"], function ()
{
    y5.loaded("Time:IClockControl")
});
Time.ClockDigitalRenderer = 
{
    createNode : function (c, d)
    {
        var a = y5.$(c.id);
        c.digitalNode = document.createElement("div");
        var b = this._getOutputTime(d);
        c.digitalNode.innerHTML = '<div class="b-clock-digital b-clock-digital-hhmmss"><div><b class="d' + b.h1 + '"><i>' + b.h1 + '</i></b><b class="d' + b.h2 + '"><i>' + b.h2 + '</i></b><b class="dc"><i>:</i></b><b class="d' + b.m1 + '"><i>' + b.m1 + '</i></b><b class="d' + b.m2 + '"><i>' + b.m2 + '</i></b><b class="dc"><i>:</i></b><b class="d' + b.s1 + '"><i>' + b.s1 + '</i></b><b class="d' + b.s2 + '"><i>' + b.s2 + "</i></b></div></div>";
        a.appendChild(c.digitalNode)
    },
    initNode : function (b)
    {
        var a = y5.$(b.id);
        b.digitalNode = y5.$$("div", a)[0];
    },
    getDisplayTime : function (d)
    {
        if (!d.digitBlocks) {
            d.digitBlocks = this._getDigitBlocks(d)
        }
        var a = ["h1", "h2", "m1", "m2", "s1", "s2"], b = y5.$$("i", d.digitBlocks.h1)[0].innerHTML + y5.$$("i", 
        d.digitBlocks.h2)[0].innerHTML, c = y5.$$("i", d.digitBlocks.m1)[0].innerHTML + y5.$$("i", d.digitBlocks.m2)[0].innerHTML, 
        e = y5.$$("i", d.digitBlocks.s1)[0].innerHTML + y5.$$("i", d.digitBlocks.s2)[0].innerHTML, f = new Date();
        f.setUTCHours(b);
        f.setUTCMinutes(c);
        f.setUTCSeconds(e);
        return f;
    },
    setCurrentTime : function (e, f)
    {
        var c = this._getOutputTime(f);
        var a;
        if (!e.digitBlocks) {
            e.digitBlocks = this._getDigitBlocks(e)
        }
        a = ["h1", "h2", "m1", "m2", "s1", "s2"];
        for (var d = 0, b = a.length; d < b; d++)
        {
            e.digitBlocks[a[d]].className = "d" + c[a[d]];
            y5.Element.html(y5.$$("i", e.digitBlocks[a[d]])[0], c[a[d]])
        }
    },
    _getDigitBlocks : function (b)
    {
        var a = y5.$$("b", b.digitalNode), c;
        c = {
            h1 : a[0], h2 : a[1], m1 : a[3], m2 : a[4], s1 : a[6], s2 : a[7]
        };
        return c;
    },
    _getOutputTime : function (d)
    {
        var a = d.getUTCHours();
        var b = d.getUTCMinutes();
        var c = d.getUTCSeconds();
        a = (a < 10) ? "0" + a : "" + a;
        b = (b < 10) ? "0" + b : "" + b;
        c = (c < 10) ? "0" + c : "" + c;
        return {
            h1 : a.substring(0, 1), h2 : a.substring(1), m1 : b.substring(0, 1), m2 : b.substring(1), 
            s1 : c.substring(0, 1), s2 : c.substring(1)
        }
    }
};
y5.loaded("Time:ClockDigitalRenderer");
Time.ClockAnalogRenderer = 
{
    createNode : function (c, e)
    {
        var b = y5.$(c.id);
        c.analogNode = document.createElement("div");
        y5.Dom.insertBefore(c.analogNode, c.digitalNode);
        var d = this.getClockR(c);
        c.paper = Raphael(c.analogNode, d * 2, d * 2);
        //c.imgNight = c.paper.image(this.getClockImage(c, "night"), 0, 0, d * 2, d * 2);
        c.imgDay = c.paper.image(this.getClockImage(c, "day"), 0, 0, d * 2, d * 2);
        //c.imgNightShine = c.paper.image(this.getClockImageShine(c, "night"), 0, 0, d * 2, d * 2);
        //c.imgDayShine = c.paper.image(this.getClockImageShine(c, "day"), 0, 0, d * 2, d * 2);
        c.imgNight = c.paper.image(this.getClockImage(c, "day"), 0, 0, d * 2, d * 2);
        c.imgNightShine = c.paper.image(this.getClockImage(c, "day"), 0, 0, d * 2, d * 2);
        c.imgDayShine = c.paper.image(this.getClockImage(c, "day"), 0, 0, d * 2, d * 2);
        c.hour = this.drawHand(c, "hour");
        c.min = this.drawHand(c, "min");
        c.sec = this.drawHand(c, "sec");
        this.setCurrentTime(c, e);
        if (y5.Browser.ie) {
            var a = y5.$$("group", c.analogNode);
            a[0].style.left = "0px"
        }
        if (y5.Browser.ie && y5.Browser.version < 7) {
            var f = y5.$$("div", c.analogNode)[0];
            f.style.left = "-50px"
        }
        if (y5.Browser.ie && y5.Browser.version == 8)
        {
            var f = y5.$$("div", c.analogNode)[0];
            if (c.id == "clock-5" || c.id == "clock-6") {
                f.style.left = "120px"
            }
            else {
                f.style.left = "20px";
            }
        }
        //this.setWeatherIcon(c);
        y5.on("Time:DayPartChanging", this.switchDayPart, c, this);
        c.paper.safari()
    },
    getClockR : function (a)
    {
        return (a.clockSize == "big") ? 35 : 50;
    },
    getClockImage : function (b, a)
    {
        return "http://time.yandex.ru/i/watches-" + a + "-" + b.clockSize + ".png";
    },
    getClockImageShine : function (b, a)
    {
        return "http://time.yandex.ru/i/watches-" + a + "-" + b.clockSize + "-shine.png";
    },
    setWeatherIcon : function (a)
    {
        if (a.weatherIconSrcOld == a.weatherIconSrc) {
            return
        }
        if (a.weatherIcon) {
            a.weatherIcon.remove()
        }
        a.weatherIconSrcOld = a.weatherIconSrc;
        if (!a.weatherIconSrc) {
            return
        }
        var c = this.getClockR(a);
        var b = a.iconSize.width;
        a.weatherIcon = a.paper.image(a.weatherIconSrc, c - a.iconSize.width / 2, 2 * c - 20 - a.iconSize.height, 
        a.iconSize.width, a.iconSize.height);
        a.weatherIcon.insertAfter(a.imgDay)
    },
    sunset : function (c)
    {
        var b = 100, a = 0;
        var d = new y5.Timer(function ()
        {
            c.imgNight.attr("opacity", 0.01 * a);
            c.imgDay.attr("opacity", 0.01 * b);
            c.imgDayShine.attr("opacity", 0.01 * b);
            c.imgNightShine.attr("opacity", 0.01 * a);
            if (b >= 50)
            {
                c.hour.attr("fill", this.getHandColor("#000000", "#DAA520", a, 50));
                c.min.attr("fill", this.getHandColor("#000000", "#DAA520", a, 50))
            }
            else
            {
                c.hour.attr("fill", this.getHandColor("#DAA520", "#ffffff", a - 50, 50));
                c.min.attr("fill", this.getHandColor("#DAA520", "#808080", a - 50, 50))
            }
            b--;
            a++;
            if (a > 100) {
                d.disable()
            }
        }, 30, this)
    },
    sunrise : function (c)
    {
        var b = 0, a = 100;
        var d = new y5.Timer(function ()
        {
            c.imgDay.attr("opacity", 0.01 * b);
            c.imgNight.attr("opacity", 0.01 * a);
            c.imgDayShine.attr("opacity", 0.01 * b);
            c.imgNightShine.attr("opacity", 0.01 * a);
            if (a >= 50)
            {
                c.hour.attr("fill", this.getHandColor("#ffffff", "#DAA520", b, 50));
                c.min.attr("fill", this.getHandColor("#808080", "#DAA520", b, 50))
            }
            else
            {
                c.hour.attr("fill", this.getHandColor("#DAA520", "#000000", b - 50, 50));
                c.min.attr("fill", this.getHandColor("#DAA520", "#000000", b - 50, 50))
            }
            b++;
            a--;
            if (b > 100) {
                d.disable()
            }
        }, 30, this)
    },
    getDayPartParams : function (a)
    {
        var b = {};
        if (a == "day")
        {
            b.newDayPart = "Day";
            b.oldDayPart = "Night";
            b.hourHandColor = "black";
            b.minHandColor = "black";
            b.secHandColor = "red"
        }
        else
        {
            b.newDayPart = "Night";
            b.oldDayPart = "Day";
            b.hourHandColor = "black";
            b.minHandColor = "black";
            b.secHandColor = "red"
        }
        return b;
    },
    setDayPart : function (b, a)
    {
        var c = this.getDayPartParams(a);
        b["img" + c.newDayPart].attr("opacity", 1);
        b["img" + c.oldDayPart].attr("opacity", 0);
        b["img" + c.newDayPart + "Shine"].attr("opacity", 1);
        b["img" + c.oldDayPart + "Shine"].attr("opacity", 0);
        b.hour.attr("fill", c.hourHandColor);
        b.min.attr("fill", c.minHandColor);
        b.sec.attr("fill", c.secHandColor)
    },
    setDayPartIE : function (b, a)
    {
        var c = this.getDayPartParams(a);
        b["img" + c.newDayPart].show();
        b["img" + c.oldDayPart].hide();
        b["img" + c.newDayPart + "Shine"].show();
        b["img" + c.oldDayPart + "Shine"].hide();
        b.hour.attr("fill", c.hourHandColor);
        b.min.attr("fill", c.minHandColor);
        b.sec.attr("fill", c.secHandColor)
    },
    switchDayPart : function (c, b, a)
    {
        c.dayPart = a;
        if (y5.Browser.ie) {
            this.setDayPartIE(c, a)
        }
        else
        {
            if (b) {
                if (a == "day") {
                    this.sunrise(c)
                }
                else {
                    this.sunset(c)
                }
            }
            else {
                this.setDayPart(c, a)
            }
        }
    },
    refreshDayPart : function (b, a, c)
    {
        if (!b.dayPart) {
            b.dayPart = Time.Utils.getDayPart(b, c);
            this.switchDayPart(b, false, b.dayPart)
        }
        else {
            var d = Time.Utils.getDayPart(b, c);
            if (b.dayPart != d) {
                this.switchDayPart(b, a, d)
            }
        }
    },
    getHandColor : function (g, f, b, l)
    {
        var k = /#(.{2})(.{2})(.{2})/;
        var i = b / l;
        var a = 1 - i;
        var j = g.match(k);
        var h = f.match(k);
        var e = Math.floor(parseInt(j[1], 16) * a + parseInt(h[1], 16) * i).toString(16);
        var d = Math.floor(parseInt(j[2], 16) * a + parseInt(h[2], 16) * i).toString(16);
        var c = Math.floor(parseInt(j[3], 16) * a + parseInt(h[3], 16) * i).toString(16);
        return "#" + e + d + c;
    },
    getHandSizes : function (a, b)
    {
        var d = {}, c = (a.clockSize == "big");
        switch (b)
        {
            case "hour":
                d.length = (c) ? 22 : 30;
                d.diff = 5;
                d.headWidth = 3;
                d.tailWidth = 2;
                break;
            case "min":
                d.length = (c) ? 28 : 35;
                d.diff = 7;
                d.headWidth = 2;
                d.tailWidth = 1;
                break;
            case "sec":
                d.length = (c) ? 32 : 40;
                d.diff = 10;
                d.headWidth = 1;
                d.tailWidth = 1;
                break
        }
        return d;
    },
    drawHand : function (c, e)
    {
        var d = this.getClockR(c);
        var b = this.getHandSizes(c, e);
        var a = c.paper.path({
            "stroke-width" : 0
        }).moveTo(d + b.tailWidth / 2, d - (b.length - b.diff)).cplineTo(d + b.headWidth / 2, d + b.diff).cplineTo(d, 
        d + b.diff).cplineTo(d, d + (b.length - b.diff)).cplineTo(d, d + b.diff).cplineTo(d - b.headWidth / 2, 
        d + b.diff).cplineTo(d - b.tailWidth / 2, d - (b.length - b.diff)).cplineTo(d + b.tailWidth / 2, 
        d - (b.length - b.diff));
        return a;
    },
    setCurrentTime : function (c, f)
    {
        c.paper.safari();
        var d = this.getClockR(c);
        var b = this._getOutputTime(f);
        var a = Math.round(360 / 12 * (b.hour + b.min / 60));
        var g = Math.round(360 / 60 * b.min);
        var e = Math.round(360 / 60 * b.sec);
        c.hour.rotate(a, d, d);
        c.min.rotate(g, d, d);
        c.sec.rotate(e, d, d);
        this.refreshDayPart(c, true, f);
        c.paper.safari()
    },
    _getOutputTime : function (d)
    {
        var a = d.getUTCHours() % 12 || 12, b = d.getUTCMinutes(), c = d.getUTCSeconds();
        return {
            hour : a, min : b, sec : c
        }
    }
};
y5.require(["Time:Utils", "Timer"], function ()
{
    y5.loaded("Time:ClockAnalogRenderer")
});
Time.Utils = 
{
    getDataFromServer : function (a, g, e)
    {
        var d = new y5.Request.XML("http://time.yandex.ru/js/sync.js.xml");
        d.onload = function (i)
        {
            if (typeof i.responseText == "string") {
                var h = JSON.parse(i.responseText);
                if (typeof g == "function")
                {
                    g(h)
                }
            }
        };
        d.onerror = function ()
        {
            if (typeof e == "function")
            {
                e()
            }
        };
        var c = [];
        for (var b = 0; b < a.length; b++) {
            c.push(a[b])
        }
        var f = [];
        f.push("geo=" + c.join(","));
        f.push("rand=" + new Date().getTime());
        d.onexception = function (h) {};
        d.send(f.join("&"))
    },
    sendCitiesToServer : function ()
    {
        var c = new y5.Request.XML("http://time.yandex.ru/actions/save.xml");
        var b = [], a = 1;
        for (var e in Time.PageLayout.collection) {
            if (a > 4) {
                break
            }
            b.push(Time.PageLayout.collection[e].geoId);
            a++
        }
        var d = [];
        d.push("geo=" + b.join(","));
        d.push("rand=" + new Date().getTime());
        c.send(d.join("&"))
    },
    getDayPart : function (b, c)
    {
        var a = (c.getTime() > b.sunrise.getTime() && c.getTime() < b.sunset.getTime()) ? "day" : "night";
        return a;
    },
    days : ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], months : ["января", 
    "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"], 
    getFullDayInfo : function (a)
    {
        return this.days[a.getCurrentTime().getUTCDay()] + ", " + a.getCurrentTime().getUTCDate() + " " + this.months[a.getCurrentTime().getUTCMonth()];
    },
    countLineNums : function (a)
    {
        return Math.round(a.length / 20);
    },
    formatOffset : function (e, d)
    {
        if (e == 0) {
            return (d ? "UTC" : "=")
        }
        var b = parseInt(e / 3600, 10);
        var c = Math.round((Math.abs(e) % 3600) / 60);
        if (c == 60) {
            c = 0;
            b += b > 0 ? 1 :- 1
        }
        if (e > 0) {
            b = "+" + b
        }
        else {
            if (b == 0) {
                b = "-" + b;
            }
        }
        if (c > 0) {
            if (c < 10) {
                c = "0" + c
            }
            c = ":" + c
        }
        else {
            c = ""
        }
        var a = (d ? "UTC" : "") + b + c;
        a = a.replace("-", "\u2212");
        return a;
    },
    getClockSwitchRule : function (a)
    {
        if (this.russianTZ.indexOf(a) !=- 1) {
            return this.getRussianClockSwitchTime;
        }
    },
    russianOffsets : 
    {
        USZ1 : 2, MSK : 3, MSD : 3, MSKS : 3, SAMT : 4, SAMST : 4, YEKT : 5, YEKST : 5, OMSST : 6, OMST : 6, 
        NOVT : 6, KRAT : 7, KRAST : 7, IRKT : 8, IRKST : 8, YAKT : 9, YAKST : 9, VLAT : 10, VLAST : 10, 
        MAGT : 11, PETT : 12, PETST : 12
    },
    getClockSwitchTime : function (a)
    {
        if (!a) {
            return
        }
        if (!this.russianOffsets[a]) {
            return
        }
        return this.getRussianClockSwitchTime(this.russianOffsets[a]);
    },
    getRussianClockSwitchTime : function (a)
    {
        var c = new Date();
        var b = new Date();
        c.setUTCMonth(2);
        c.setUTCDate(31);
        b.setUTCMonth(9);
        b.setUTCDate(31);
        c.setUTCDate(31 - c.getUTCDay());
        c.setUTCHours(2 - a);
        c.setUTCMinutes(0);
        c.setUTCSeconds(0);
        c.setUTCMilliseconds(0);
        b.setUTCDate(31 - b.getUTCDay());
        b.setUTCHours(2 - a);
        b.setUTCMinutes(0);
        b.setUTCSeconds(0);
        b.setUTCMilliseconds(0);
        return {
            toSummer : c, toWinter : b
        }
    },
    leapYear : function (a)
    {
        if (a % 4 == 0) {
            return true
        }
        return false;
    },
    getDays : function (c, b)
    {
        var a = new Array(12);
        a[0] = 31;
        a[1] = (this.leapYear(b)) ? 29 : 28;
        a[2] = 31;
        a[3] = 30;
        a[4] = 31;
        a[5] = 30;
        a[6] = 31;
        a[7] = 31;
        a[8] = 30;
        a[9] = 31;
        a[10] = 30;
        a[11] = 31;
        return a[c];
    }
};
y5.loaded("Time:Utils");
Time.ClockControl = function (a, b)
{
    this.element = a;
    this.clockSize = "big";
    this.id = y5.$$("div.time-city-clock", this.element)[0].id;
    this._initDigitalClockNode();
    this._initControls();
    this.resetClockData(b);
    this._refreshCurrentTime();
    this.onCityDataChanging();
    this.switchType(Time.PageLayout.type);
    this.geoId = this._getGeoIdFromDom();
    y5.on("Time:OffsetChanging", this._setClockInfo, this)
};
Time.ClockControl.prototype = 
{
    _initControls : function ()
    {
        this._initInputControl();
        this._initInfoLine();
        if (this.id == "clock-1") {
            this._initIAmHereBlock()
        }
    },
    _initIAmHereBlock : function ()
    {
        var a = y5.$$("i", this.element)[0];
        if (a) {
            y5.Classes.add(a, "im-here")
        }
    },
    _initInputControl : function ()
    {
        this.button = y5.$$("h3", this.element)[0];
        this.input = y5.$$("input", this.button)[0];
        this.title = y5.$$("span", this.button)[0];
        this.showObserver = y5.on("click", this._showInput, this.button, this);
        this.hideObserver = y5.on("click", this._hideOnClick, document, this, {
            add : false
        });
        this.autocomplete = new Time.AutoComplete(this.input);
        y5.on("Time:AutoComplete:change", this._onCityChanging, this.input, this)
    },
    _setClockInfo : function (a)
    {
        this.infoText = Time.Utils.formatOffset(this.offset, true) + " " + this.parentName + "<br/>";
        this.infoText += Time.Utils.getFullDayInfo(this);
        this.lineNums = Time.Utils.countLineNums(this.infoText);
        if (a) {
            this.setAdjustedClockInfo()
        }
        else {
            this.info.innerHTML = this.infoText;
        }
    },
    setAdjustedClockInfo : function ()
    {
        var b = this.infoText;
        for (var a = this.lineNums; a <= Time.PageLayout.maxLineNums; a++) {
            b += "<br/>"
        }
        this.info.innerHTML = b;
    },
    _initInfoLine : function ()
    {
        this.info = y5.$$("p", this.element)[0];
    },
    _showInput : function ()
    {
        this.autocomplete.enable();
        y5.Classes.add(this.element, "time-input");
        this.showObserver.disable();
        this.hideObserver.enable();
        y5.Timer.setTimeout(function ()
        {
            this.input.focus();
            this.input.select()
        }, 50, this)
    },
    _hideOnClick : function (a)
    {
        if (!y5.Dom.isChild(a.target, this.element)) {
            this._hideInput()
        }
    },
    _hideInput : function ()
    {
        window.focus();
        this.autocomplete.disable();
        if (this.input.value != y5.Element.text(this.title)) {
            this.input.value = y5.Element.text(this.title)
        }
        this.hideObserver.disable();
        this.showObserver.enable();
        y5.Classes.remove(this.element, "time-input")
    },
    _refreshParentClass : function (a)
    {
        y5.Classes.assign(this.element, "b-clocks-without-flash", a == "digital")
    },
    _getCityData : function (a, c, b)
    {
        Time.Utils.getDataFromServer([a], c, b)
    },
    _onCityChanging : function (c, e)
    {
        if (c == this.geoId) {
            return
        }
        var b = this;
        var a = function (f)
        {
            Time.PageLayout.gmt = f[0];
            b.onNewCitySelected(c, e, f[1]);
            b._hideInput();
            Time.Utils.sendCitiesToServer()
        };
        var d = function ()
        {
            b._hideInput()
        };
        this._getCityData(c, a, d);
        return true;
    }
};
y5.require(["Time:IClockControl"], function ()
{
    y5.extend(Time.ClockControl, Time.IClockControl, "IClockControl");
    y5.loaded("Time:ClockControl")
});
Time.SimpleClockControl = function (a, b)
{
    this.element = a;
    this.clockSize = "big";
    this.id = this.element.id;
    this._initControls();
    this.resetClockData(b);
    this._refreshCurrentTime();
    this.onCityDataChanging();
    this.geoId = this._getGeoIdFromDom();
    this._initDigitalClockNode();
    this.switchType(Time.PageLayout.type);
    y5.on("Time:OffsetChanging", function ()
    {
        this._setClockInfo();
        Time.PageLayout.refreshClocksDiff()
    }, this)
};
Time.SimpleClockControl.prototype = 
{
    _initControls : function ()
    {
        this.title = y5.$(this.id + "-title");
        this.info = y5.$(this.id + "-info");
    },
    _setClockInfo : function ()
    {
        this.infoText = Time.Utils.formatOffset(this.offset, true) + " " + this.parentName + "<br/>";
        this.infoText += Time.Utils.getFullDayInfo(this);
        this.info.innerHTML = this.infoText;
    }
};
y5.require(["Time:IClockControl"], function ()
{
    y5.extend(Time.SimpleClockControl, Time.IClockControl, "IClockControl");
    y5.loaded("Time:SimpleClockControl")
});
Time.PageLayout = 
{
    initOnce : function (a)
    {
        this.initGeoFinder();
        if (a == "index")
        {
            this.startPreInitTimer();
            this.collection = {};
            this.currentCity = null;
            this.gmt = clocks[0];
            this.initClockSwitcher();
            this.initClocks();
            this.stopPreInitTimer();
            this.isSynchronizing = false;
            y5.on("Time:ClockInfoChanging", this.resetClocksInfoLines, document, this)
        }
        else {
            if (a == "informer") {
                this.currentCity = null;
                this.initInformer()
            }
        }
        this.initCompareControl()
    },
    startPreInitTimer : function ()
    {
        this.preInitTimeShift = 0;
        this.preInitTimer = new y5.Timer(function ()
        {
            this.preInitTimeShift += 1000
        }, 1000, this)
    },
    stopPreInitTimer : function ()
    {
        this.preInitTimer.disable()
    },
    initClockSwitcher : function ()
    {
        var b = y5.$("clockSwitcher");
        var a = y5.Cookie.get("clocktype");
        this.type = (a == null || a == "a") ? "analog" : "digital";
        if (b) {
            this.switcher = new Time.ClockSwitcher(b, this.type);
        }
    },
    initGeoFinder : function ()
    {
        this.geoFinder = new Time.GeoFinder();
    },
    initClocks : function ()
    {
        this.initMainClocks();
        this.initDiffClocks();
        y5.on("Time:SwitchType", this.switchType, Time, this);
        this.synchronizeTimer = new y5.Timer(this.synchronize, 300000, this);
        this.startClocks()
    },
    initMainClocks : function ()
    {
        var d = y5.$$(".b-clocks")[0];
        var c = y5.$$(".city", d);
        for (var b = 0; b < c.length; b++) {
            var a = new Time.ClockControl(c[b], clocks[b + 1]);
            this.collection[a.id] = a
        }
        this.resetClocksInfoLines();
    },
    initDiffClocks : function ()
    {
        var d = y5.$$(".b-clock-diff")[0];
        var c = y5.$$(".time-city-clock", d);
        for (var b = 0; b < c.length; b++)
        {
            var a = new Time.SimpleClockControl(c[b], clocks[5 + b]);
            this.collection[a.id] = a;
            if (a.id == "clock-1") {
                this.currentCity = a.geoId;
            }
        }
    },
    switchType : function (a)
    {
        this.type = a;
        for (var b in this.collection) {
            this.collection[b].switchType(a)
        }
    },
    getClockType : function ()
    {
        return this.type;
    },
    synchronize : function ()
    {
        var b = this;
        if (this.isSynchronizing) {
            return
        }
        this.isSynchronizing = true;
        var c = function (e)
        {
            b.gmt = e[0];
            var g = 1;
            for (var h in b.collection) {
                var f = b.collection[h];
                f.resetClockData(e[g]);
                f.onCityDataChanging(true);
                g++
            }
            b.lastCorrectiveTime = null;
            b.isSynchronizing = false;
            b.refreshClocksDiff()
        };
        var a = [];
        for (var d in this.collection) {
            a.push(this.collection[d].geoId)
        }
        Time.Utils.getDataFromServer(a, c)
    },
    resetClocksInfoLines : function ()
    {
        var b = 0;
        for (var a in this.collection)
        {
            if (a != "clock-5" && a != "clock-6") {
                b = (this.collection[a].lineNums > b) ? this.collection[a].lineNums : b
            }
        }
        this.maxLineNums = b;
        this.adjustClocksInfo()
    },
    adjustClocksInfo : function ()
    {
        for (var b in this.collection) {
            if (b != "clock-5" && b != "clock-6") {
                var a = this.collection[b];
                a.setAdjustedClockInfo()
            }
        }
    },
    refreshClocksDiff : function ()
    {
        var b = this.collection["clock-5"];
        var a = this.collection["clock-6"];
        if (b && a) {
            var c = (a._getOffset() - b._getOffset());
            this.compareControl.writeClockDiff(c)
        }
    },
    startClocks : function ()
    {
        if (!this.timeout) {
            this.timeout = new y5.Timer(this.setNextTime, 1000, this)
        }
        else {
            this.timeout.enable()
        }
    },
    stopClocks : function ()
    {
        if (this.timeout) {
            this.timeout.disable()
        }
    },
    checkTimeoutError : function ()
    {
        if (this.isSynchronizing) {
            return {
                type : "ok", diff : 0
            }
        }
        var a = new Date();
        if (!this.lastCorrectiveTime) {
            this.lastCorrectiveTime = a
        }
        var b = a - this.lastCorrectiveTime;
        this.lastCorrectiveTime = a;
        if (b < 0) {
            return {
                type : "error", diff : b
            }
        }
        else {
            if (b < 6000) {
                return {
                    type : "ok", diff : b
                }
            }
            else {
                return {
                    type : "error", diff : b
                }
            }
        }
    },
    setNextTime : function ()
    {
        var a = this.checkTimeoutError();
        if (a.type == "error") {
            this.synchronize()
        }
        this.gmt = this.gmt + 1;
        if (Time.PageLayout.gmt != this.gmt) {
            Time.PageLayout.gmt = this.gmt
        }
        for (var b in this.collection) {
            this.collection[b].setNextTime()
        }
    },
    initCompareControl : function ()
    {
        var a = y5.$("compareForm");
        if (a) {
            this.compareControl = new Time.CompareCities(a);
        }
    },
    initInformer : function ()
    {
        var a = y5.$("informerForm");
        if (a) {
            this.informer = new Time.InformerSelector(a);
        }
    }
};
y5.require(["Time:ClockControl", "Time:SimpleClockControl", "Time:CompareCities", "Time:GeoFinder", "Time:InformerSelector", 
"Time:ClockSwitcher", "Timer"], function ()
{
    y5.loaded("Time:PageLayout")
});
function onKeyDown(a)
{
    a = a ? a : window.event;
    if (a.keyCode == 27) {
        return false
    }
    return true
}
function achtung()
{
    var a = new y5.Request.XML("/actions/achtung.xml");
    a.send()
};

