function Uppod(f) {
    function ca() {
        if (f.uid) {
            va = navigator.userAgent.toLowerCase();
            if (va.indexOf("ipad") > 0) qa = true;
            (ra = !! document.createElement("canvas").getContext) && (ra = !! document.createElement("video").canPlayType);
            b = new Fa;
            if (ra) {
                c(b.stg, {
                    backgroundColor: "#" + b.bgcolor,
                    textAlign: "left"
                });
                var i = (b.m == "video") ? b.sh : 0;
                G = new ha({
                    w: b.sw,
                    h: 0,
                    bgc: b.bodycolor,
                    brd: b.brd,
                    brdc: b.brdcolor
                });
                b.stg.appendChild(G.c);
                c(G.c, {
                    position: "relative",
                    top: 0,
                    left: 0
                });
                b.scrn_w = b.sw - b.padding * 2;
                b.scrn_h = b.sh - b.padding * 2;
                i = (b.m == "video") ? b.scrn_h : 0;
                L = new ha({
                    w: b.scrn_w,
                    h: i,
                    bgc: b.screencolor
                });
                G.c.appendChild(L.c);
                c(L.c, {
                    position: "absolute",
                    top: 0,
                    left: b.padding
                });
                alrt = document.createElement("div");
                c(alrt, {
                    width: "100%",
                    position: "absolute",
                    top: 0,
                    left: 0,
                    color: "#" + b.commentcolor
                });
                G.c.appendChild(alrt);
                b.commentbgcolor.indexOf("|") == -1 && (b.commentbgcolor = b.commentbgcolor + "|" + b.commentbgcolor);
                alrt_bg = new ha({
                    w: b.sw,
                    h: "20",
                    o: 0,
                    bgc: b.commentbgcolor,
                    bga1: b.commentbgalpha1,
                    bga2: b.commentbgalpha2
                });
                alrt.appendChild(alrt_bg.c);
                alrt_txt = document.createElement("div");
                alrt.appendChild(alrt_txt);
                c(alrt_txt, {
                    position: "absolute",
                    top: 0,
                    left: 0,
                    padding: b.commentmargin,
                    paddingLeft: b.commentmargin + 5,
                    paddingBottom: b.commentmargin + 3,
                    fontFamily: b.namefont,
                    fontSize: b.namefontsize,
                    fontStyle: b.namefontstyle
                });
                if (b.comment != undefined && b.comment != "" && b.showcomment == 1) {
                    alrt_txt.innerHTML = b.comment;
                    c(alrt_bg.canvas, {
                        height: alrt_txt.offsetHeight,
                        width: b.sw
                    })
                } else alrt.style.display = "none";
                da();
                Ga();
                ea();
                sa(m);
                sa(alrt);
                sa(b.stg);
                if (e.autoplay) C();
            } /*else if (b.nohtml5.indexOf(".swf") > 0) new swfobject.embedSWF(b.nohtml5, b.uid, b.sw, b.sh, "10.0.0", false, f, {
                allowFullScreen: "true",
                allowScriptAccess: "always"
            });*/
            else b.stg.innerHTML = b.nohtml5
        } else alert("uppod:" + f.uid + " uid?")
    }
    function ea() {
        window.onkeydown = function (a) {
            var d = a.which;
            if (d == undefined) d = a.keyCode;
            M && d == 27 && q();
            if ((r || M) && d == 32) C()
        };
        if (b.cntrlhide == 1) b.stg.onmousemove = function () {
            if (ta) {
                c(m, {
                    visibility: "visible"
                });
                ta = false;
                setTimeout(k, 3E3)
            }
        };
        b.stg.onmouseup = function () {
            s && (s.active = false);
            l && (l.active = false)
        };
        b.stg.onmouseover = function () {
            ja = true
        };
        b.stg.onmouseout = function () {
            ja = false
        };
        b.stg.oncontextmenu = function (a) {
            if (!a) a = window.event;
            a.cancelBubble = true;
            a.stopPropagation && a.stopPropagation();
            if (S) c(S, {
                display: "block",
                position: "absolute",
                top: a.clientY,
                left: a.clientX
            });
            else {
                S = document.createElement("div");
                document.body.appendChild(S);
                var d = document.createElement("div");
                S.appendChild(d);
                d.innerHTML = "<b>Uppod HTML5</b> 0.0.7 -<br />modified by Roger Stebler";
                /*d.onclick = function () {
                    window.open("http://uppod.ru", "_blank")
                };*/
                c(S, {
                    borderRadius: "0px",
                    //cursor: "pointer",
                    position: "absolute",
                    top: a.clientY,
                    left: a.clientX,
                    backgroundColor: "#000",
                    color: "#fff",
                    borderStyle: "solid",
                    borderColor: "#000000",
                    borderWidth: "1px",
                    padding: "2px 5px 3px 5px",
                    font: "9px Tahoma",
                    opacity: "1",
                    zIndex: "200"
                })
            }
            return false
        };
        document.onclick = function () {
            S && c(S, {
                display: "none"
            })
        }
    }
    function da() {
        T = document.createElement("div");
        L.c.appendChild(T);
        T.onclick = C;
        e = document.createElement(b.m);
        T.appendChild(e);
        e.setAttribute("width", b.sw + "px");
        e.setAttribute("height", b.sh + "px");
        e.controls = qa ? true : false;
        e.preload = "metadata";
        e.autoplay = true;
        c(e, {
            position: "absolute",
            top: 0,
            left: 0
        });
        b.m == "audio" && c(e, {
            width: "0px",
            height: "0px"
        });
        setTimeout(Y, 33);
        b.poster != "" && e.setAttribute("poster", b.poster);
        b.auto != "none" && t();
        w = document.createElement("div");
        G.c.appendChild(w);
        c(w, {
            width: "100%",
            height: "100%",
            position: "absolute",
            top: 0,
            left: 0
        });
        w.onclick = C;
        if (qa) e.onclick = C;
        if (b.o > 0) {
            ka = document.createElement("canvas");
            var a = ka.getContext("2d");
            a.fillStyle = "#" + b.bgcolor;
            a.beginPath();
            a.moveTo(0, 0);
            a.lineTo(b.o / 2, 0);
            a.quadraticCurveTo(0, 0, 0, b.o / 2);
            a.closePath();
            a.fill();
            w.appendChild(ka);
            la = document.createElement("canvas");
            a = la.getContext("2d");
            a.fillStyle = "#" + b.bgcolor;
            a.beginPath();
            a.moveTo(0, 0);
            a.quadraticCurveTo(b.o / 2, 0, b.o / 2, b.o / 2);
            a.lineTo(b.o / 2, 0);
            a.closePath();
            a.fill();
            w.appendChild(la);
            ma = document.createElement("canvas");
            a = ma.getContext("2d");
            a.fillStyle = "#" + b.bgcolor;
            a.beginPath();
            a.moveTo(b.o / 2, 0);
            a.quadraticCurveTo(b.o / 2, b.o / 2, 0, b.o / 2);
            a.lineTo(b.o / 2, b.o / 2);
            a.closePath();
            a.fill();
            w.appendChild(ma);
            na = document.createElement("canvas");
            a = na.getContext("2d");
            a.fillStyle = "#" + b.bgcolor;
            a.beginPath();
            a.moveTo(0, 0);
            a.quadraticCurveTo(0, b.o / 2, b.o / 2, b.o / 2);
            a.lineTo(0, b.o / 2);
            a.closePath();
            a.fill();
            w.appendChild(na);
            fa()
        }
    }
    function fa() {
        c(ka, {
            position: "absolute",
            top: 0,
            left: 0
        });
        c(la, {
            position: "absolute",
            top: 0,
            left: b.sw - b.o / 2
        });
        c(ma, {
            position: "absolute",
            top: b.sh - b.o / 2,
            left: b.sw - b.o / 2
        });
        c(na, {
            position: "absolute",
            top: b.sh - b.o / 2,
            left: 0
        })
    }
    function t() {
        Z = [];
        if (b.file != "") if (b.file.indexOf("|") > 0) for (var a = b.file.split("|"), d = 0; d < a.length; d++) {
            Z[d] = document.createElement("source");
            Z[d].setAttribute("src", a[d]);
            e.appendChild(Z[d])
        } else {
            Z[0] = document.createElement("source");
            Z[0].setAttribute("src", b.file);
            e.appendChild(Z[0])
        }
    }
    function Y() {
        if (e.networkState > 0) {
            oa = true;
            c(e, {
                opacity: 1
            });
            b.auto == "play" && !r && C();
            playInterval = setInterval(N, 500);
            e.addEventListener("progress", Ha, false);
            var a = b.volume;
            e.volume = a;
            O && wa(a * O.w)
        } else setTimeout(Y, 33)
    }
    function C() {
        if (oa || e.autoplay) {
            xa = true;
            if (b.auto == "none") {
                t();
                b.auto = "play"
            }
            if (r) {
                e.pause();
                if (J != undefined) {
                    J.c.style.display = "block";
                    P.c.style.display = "none"
                }
                r = false;
                b.comment != undefined && b.comment != "" && b.showcomment == 1 && alrt && (alrt.style.display = "block")
            } else {
                e.play();
                if (J != undefined) {
                    J.c.style.display = "none";
                    P.c.style.display = "block"
                }
                r = true;
                b.cntrlhide == 1 && setTimeout(k, 3E3);
                b.comment != undefined && b.comment != "" && b.showcomment == 1 && alrt && (alrt.style.display = "none");
                if (e.currentTime == 0 && !Aa) {
                    U = true;
                    p();
                    H.c.innerHTML = "Loading..."
                }
            }
        }
    }
    function K() {
        r && C();
        T.removeChild(e);
        w != undefined && G.c.removeChild(w);
        delete e;
        delete w;
        if (l) {
            c(E.canvas, {
                width: "0"
            });
            c(D.canvas, {
                width: "0"
            })
        }
        da()
    }
    function j(a) {
        if (!M || a == "re") {
            b.iframe != "" && c(window.parent.document.getElementById(b.iframe), {
                width: window.parent.innerWidth,
                height: window.parent.innerHeight,
                position: "fixed",
                left: 0,
                top: 0
            });
            if (a != "re") {
                M = true;
                mediaWidth = b.sw;
                mediaHeight = b.sh;
                c(G.canvas, {
                    visibility: "hidden"
                });
                c(L.canvas, {
                    visibility: "hidden"
                });
                c(T, {
                    backgroundColor: "#000",
                    position: "fixed",
                    left: 0,
                    top: 0
                })
            }
            c(b.stg, {
                width: b.iframe != "" ? window.parent.innerWidth : window.innerWidth,
                height: b.iframe != "" ? window.parent.innerHeight : window.innerHeight,
                position: "fixed",
                left: 0,
                top: 0
            });
            b.debug == 0 && c(b.stg, {
                zIndex: "990"
            });
            w != undefined && (w.style.display = "none")
        } else q()
    }
    function q() {
        M = false;
        b.iframe != "" && c(window.parent.document.getElementById(b.iframe), {
            width: mediaWidth,
            height: mediaHeight,
            position: "static",
            left: 0,
            top: 0
        });
        c(T, {
            backgroundColor: "transparent",
            position: "absolute",
            left: 0,
            top: 0
        });
        c(b.stg, {
            width: mediaWidth,
            height: mediaHeight,
            position: "static",
            left: 0,
            top: 0
        });
        b.debug == 0 && c(b.stg, {
            zIndex: "1"
        });
        c(G.canvas, {
            visibility: "visible"
        });
        c(L.canvas, {
            visibility: "visible"
        });
        w != undefined && (w.style.display = "block")
    }
    function k() {
        if (r && !ja && e.currentTime > 0) {
            c(m, {
                visibility: "hidden"
            });
            ta = true
        }
        r && ja && setInterval(k, 3E3)
    }
    function n() {
        ya(0)
    }
    function u() {
        if (e.muted) {
            e.muted = false;
            V.c.style.display = "block";
            Q.c.style.display = "none"
        } else {
            e.muted = true;
            Q.c.style.display = "block";
            V.c.style.display = "none"
        }
    }
    function N() {
        if (e != undefined) {
            played = e.currentTime / e.duration;
            R != undefined && (R.c.innerHTML = za(e.currentTime));
            $ != undefined && ($.c.innerHTML = za(!e.duration || e.duration == "Infinity" ? 0 : e.duration));
            if (e.ended && r) {
                n();
                C()
            }
            loaded = 0;
            if (ua) {
                e.buffered ? e.buffered.length > 0 ? loaded = e.buffered.end(0) / e.duration : loaded = 0 : loaded = 0;
                var a = Math.round(loaded * x.w - ia),
                    d = Math.round(played * x.w - ia);
                a < 0 && (a = 1);
                !l.active && c(E.canvas, {
                    width: "" + d + "px"
                });
                e.buffered && c(D.canvas, {
                    width: "" + a + "px"
                });
                if (U && !Aa) if (e.currentTime > 0) {
                    g();
                    Aa = true
                }
                if (e.buffered) if (e.buffered.length > 0 && D.canvas.offsetWidth - E.canvas.offsetWidth <= 0 && r && !U) {
                    e.pause();
                    U = true;
                    p();
                    setTimeout(F, 2E3)
                }
            }
        }
        if (b.stg.offsetWidth != b.sw || b.stg.offsetHeight != b.sh) {
            b.sw = b.stg.offsetWidth;
            b.sh = b.stg.offsetHeight;
            if (!M) {
                c(G.canvas, {
                    width: b.sw,
                    height: b.sh
                });
                c(L.canvas, {
                    width: b.sw,
                    height: b.sh
                })
            }
            pa && c(pa.canvas, {
                width: "" + b.sw + "px",
                height: "" + b.cntrloutheight + "px"
            });
            alrt && c(alrt_bg.canvas, {
                width: "" + b.sw + "px"
            });
            c(T, {
                width: "" + b.sw + "px",
                height: "" + b.sh + "px"
            });
            c(e, {
                width: "" + b.sw + "px",
                height: "" + b.sh + "px"
            });
            b.o > 0 && fa();
            c(m, {
                top: b.sh - (b.cntrlout == 1 && !M ? 0 : b.cntrloutheight) + (!M ? b.padding : 0),
                left: 0
            });
            Ba()
        }
        if (M) if (b.iframe != "")(window.parent.innerWidth != b.stg.offsetWidth || window.parent.innerHeight != b.stg.offsetHeight) && j("re");
        else(window.innerWidth != b.stg.offsetWidth || window.innerHeight != b.stg.offsetHeight) && j("re")
    }
    function F() {
        if (U) if (D.canvas.offsetWidth - E.canvas.offsetWidth > x.canvas.offsetWidth / e.duration * b.buffersec || D.canvas.offsetWidth == x.canvas.offsetWidth) {
            e.play();
            U = false;
            g()
        } else {
            setTimeout(F, 2E3);
            if (b.controls.indexOf("buffer") > -1) H.c.innerHTML = (e.duration ? Math.round((D.canvas.offsetWidth - E.canvas.offsetWidth) / (x.canvas.offsetWidth / e.duration * b.buffersec) * 100) : "0") + "%"
        }
    }
    function p() {
        b.controls.indexOf("buffer") > -1 && c(H.c, {
            display: "block"
        })
    }
    function g() {
        if (b.controls.indexOf("buffer") > -1) {
            c(H.c, {
                display: "none"
            });
            H.c.innerHTML = ""
        }
        U = false
    }
    function Ha(a) {
        if (a.total && a.loaded && (e.buffered.length == 0 || !e.buffered)) {
            a = a.loaded / a.total;
            if (l) {
                a = Math.round(a * x.w - ia);
                a < 0 && (a = 1);
                c(D.canvas, {
                    width: "" + a + "px"
                })
            }
        }
    }
    function za(a) {
        a = Math.round(a);
        minutes = Math.floor(a / 60);
        minutes = minutes >= 10 ? minutes : minutes;
        a = Math.floor(a % 60);
        a = a >= 10 ? a : "0" + a;
        return minutes + ":" + a
    }
    function Ga() {
        m = document.createElement("div");
        G.c.appendChild(m);
        c(m, {
            position: "absolute",
            top: b.scrn_h - (b.cntrlout == 1 ? 0 : b.cntrloutheight) + b.padding,
            left: b.padding
        });
        if (b.cntrlout != 1 && b.cntrlbg == 1) {
            b.cntrlbgcolor.indexOf("|") == -1 && (b.cntrlbgcolor = b.cntrlbgcolor + "|" + b.cntrlbgcolor);
            pa = new ha({
                w: b.scrn_w,
                h: b.cntrloutheight,
                o: b.o / 2 - b.padding,
                onotop: 1,
                bgc: b.cntrlbgcolor,
                bga1: b.cntrlbgalpha1,
                bga2: b.cntrlbgalpha2
            });
            m.appendChild(pa.c)
        }
        y = b.controls.split(",");
        I = 0;
        o = [];
        v = [];
        for (var a = 0; a < y.length; a++) {
            if (y[a] == "play") {
                J = new z("play", 20, 20);
                m.appendChild(J.c);
                c(J.c, {
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - J.h) / 2
                });
                J.c.onclick = C;
                P = new z("pause", 20, 20, "", "play");
                m.appendChild(P.c);
                c(P.c, {
                    cursor: "pointer",
                    display: "none",
                    position: "absolute",
                    top: (b.cntrloutheight - P.h) / 2
                });
                P.c.onclick = C;
                o[a] = P.w + b.cntrlmargin;
                I += o[a];
                v[a] = J
            }
            if (y[a] == "back") {
                W = new z("back", 30, 20);
                m.appendChild(W.c);
                c(W.c, {
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - W.h) / 2
                });
                I += W.w + b.cntrlmargin;
                W.c.onclick = n;
                o[a] = W.w + b.cntrlmargin;
                I += o[a];
                v[a] = W
            }
            if (y[a] == "stop") {
                aa = new z("stop", 20, 20);
                m.appendChild(aa.c);
                c(aa.c, {
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - aa.h) / 2
                });
                aa.c.onclick = K;
                o[a] = aa.w + b.cntrlmargin;
                I += o[a];
                v[a] = aa
            }
            if (y[a] == "time_play") {
                R = new z("time_play", 30, 20);
                m.appendChild(R.c);
                c(R.c, {
                    cursor: "default",
                    position: "absolute",
                    top: (b.cntrloutheight - R.h) / 2 + 3
                });
                o[a] = R.w + b.cntrlmargin;
                I += o[a];
                v[a] = R
            }
            if (y[a] == "time_all") {
                $ = new z("time_all", 30, 20);
                m.appendChild($.c);
                c($.c, {
                    cursor: "default",
                    position: "absolute",
                    top: (b.cntrloutheight - R.h) / 2 + 3
                });
                o[a] = $.w + b.cntrlmargin;
                I += o[a];
                v[a] = $
            }
            if (y[a] == "volume") {
                V = new z("volume", 20, 20);
                m.appendChild(V.c);
                c(V.c, {
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - V.h) / 2
                });
                V.c.onclick = u;
                Q = new z("volume_mute", 20, 20);
                m.appendChild(Q.c);
                c(Q.c, {
                    display: "none",
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - Q.h) / 2
                });
                o[a] = Q.w + b.cntrlmargin;
                I += o[a];
                Q.c.onclick = u;
                v[a] = V
            }
            if (y[a] == "volbarline") {
                s = document.createElement("div");
                m.appendChild(s);
                O = new z("volbarline", b.cntrl_volbarline.w ? b.cntrl_volbarline.w : b.cntrlvolbarline.w, 20, "all");
                s.appendChild(O.c);
                s.active = false;
                c(O.c, {
                    opacity: O.s.all_a,
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                ga = new z("volbarline", b.cntrl_volbarline.w ? b.cntrl_volbarline.w : b.cntrlvolbarline.w, 20, "play");
                s.appendChild(ga.c);
                c(ga.c, {
                    opacity: ga.s.play_a,
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                c(s, {
                    position: "absolute",
                    top: (b.cntrloutheight - O.h) / 2
                });
                o[a] = O.w + b.cntrlmargin;
                I += o[a];
                c(ga.canvas, {
                    width: "0"
                });
                s.onmousedown = function (d) {
                    s.active = true;
                    if (!d) d = window.event;
                    Ca(d)
                };
                s.onmousemove = function (d) {
                    if (!d) d = window.event;
                    Ca(d)
                };
                s.onmouseup = function () {
                    s.active = false
                };
                v[a] = s
            }
            if (y[a] == "full") {
                ba = new z("full", 20, 20);
                m.appendChild(ba.c);
                c(ba.c, {
                    cursor: "pointer",
                    position: "absolute",
                    top: (b.cntrloutheight - ba.h) / 2
                });
                o[a] = ba.w + b.cntrlmargin;
                I += o[a];
                ba.c.onclick = j;
                v[a] = ba
            }
            if (y[a] == "buffer") {
                H = new z("buffer", 30, 14);
                m.appendChild(H.c);
                c(H.c, {
                    cursor: "default",
                    position: "absolute",
                    top: (b.cntrloutheight - H.h) / 2 - x.s.h - 3
                });
                v[a] = H
            }
            if (y[a] == "line") {
                ua = true;
                l = document.createElement("div");
                m.appendChild(l);
                x = new z("line", 20, 20, "all");
                l.appendChild(x.c);
                l.active = false;
                c(x.c, {
                    opacity: x.s.all_a,
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                D = new z("line", 20, 20, "load");
                l.appendChild(D.c);
                c(D.c, {
                    opacity: D.s.load_a,
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                E = new z("line", 20, 20, "play");
                l.appendChild(E.c);
                c(E.c, {
                    opacity: E.s.play_a,
                    position: "absolute",
                    top: 0,
                    left: 0
                });
                c(l, {
                    position: "absolute",
                    top: (b.cntrloutheight - x.h) / 2
                });
                c(E.canvas, {
                    width: "0"
                });
                c(D.canvas, {
                    width: "0"
                });
                l.onmousedown = function (d) {
                    r && e.pause();
                    l.active = true;
                    if (!d) d = window.event;
                    Da(d)
                };
                l.onmousemove = function (d) {
                    Da(d)
                };
                l.onmouseup = function () {
                    r && e.play();
                    l.active = false
                };
                v[a] = l
            }
        }
        Ba()
    }
    function Ba() {
        var a = b.sw - I - b.cntrlendmargin * 2 + 6 + b.cntrlmargin,
            d = b.cntrlendmargin;
        for (i = 0; i < y.length; i++) if (v[i]) {
            if (v[i] != l) {
                c(v[i].c != undefined ? v[i].c : v[i], {
                    left: d
                });
                y[i] == "play" && c(P.c, {
                    left: d
                });
                y[i] == "volume" && c(Q.c, {
                    left: d
                });
                d += o[i] + b.cntrlmargin
            } else {
                c(l, {
                    left: d + 3
                });
                x.w = a;
                E.w = a;
                D.w = a;
                c(x.canvas, {
                    width: "" + a + "px"
                });
                o[i] = a;
                d += o[i] + b.cntrlmargin + 6
            }
            b.controls.indexOf("buffer") > -1 && c(H.c, {
                left: l.offsetLeft
            })
        }
    }
    function Ca(a) {
        if (s.active) {
            if (!a) a = window.event;
			var i = (checkBrowserName('opera')) ? 0 : 15;
            wa(a.clientX - s.offsetLeft - b.stg.offsetLeft - L.c.offsetLeft - get_element_pos(document.getElementById(f.uid)).x - i)
        }
    }
    function wa(a) {
        c(ga.canvas, {
            width: "" + a + "px"
        });
        e.volume = Math.max(0, Math.min(1, a / O.w))
    }
    function Da(a) {
        if (l.active) {
            if (!a) a = window.event;
			var i = (checkBrowserName('opera')) ? 0 : 15;
            a = a.clientX - l.offsetLeft - b.stg.offsetLeft - L.c.offsetLeft - get_element_pos(document.getElementById(f.uid)).x - i;
            ya(a);
            c(E.canvas, {
                width: "" + (a - ia) + "px"
            })
        }
    }
	function get_element_pos(obj){
		var yOffset = obj.offsetTop||0;
		var xOffset = obj.offsetLeft||0;
		var elParent = obj.offsetParent;
		while(elParent){
			yOffset += (elParent.offsetTop||0);
			xOffset += (elParent.offsetLeft||0);
			elParent = elParent.offsetParent;
		}
		var readScroll;
		if((window.document.compatMode) && (window.document.compatMode == 'CSS1Compat') ){
			readScroll = window.document.documentElement;
		}else{
			readScroll = window.document.body;
		}
		xOffset -= (readScroll.scrollLeft - readScroll.clientLeft);
		yOffset -= (readScroll.scrollTop - readScroll.clientTop);
		return {x:xOffset,y:yOffset};
	}
	function checkBrowserName(name) {
		var agent = navigator.userAgent.toLowerCase();
		if (agent.indexOf(name.toLowerCase()) > -1) return true;
		return false;
	}
    function ya(a) {
        if (e.duration) {
            e.currentTime = Math.max(0, Math.min(1, a / x.w)) * e.duration;
            if (ua && a == 0) {
                ia = 0;
                c(D.canvas, {
                    left: 0
                });
                c(E.canvas, {
                    left: 0
                })
            }
        }
    }
    function z(a, d, h, A, B) {
        this.c = document.createElement("div");
        this.s = {};
        B == undefined && (B = a);
        for (var X in b.cntrlstyle) this.s[X] = b.cntrlstyle[X];
        for (X in b["cntrl" + B]) this.s[X] = b["cntrl" + B][X];
        for (X in b["cntrl_" + B]) this.s[X] = b["cntrl_" + B][X];
        if (A == "all") this.s.color = this.s.color_all;
        if (A == "load") this.s.color = this.s.color_load;
        if (A == "play") this.s.color = this.s.color_play;
        this.canvas = document.createElement("canvas");
        this.canvas.height = h * this.s.scale;
        this.canvas.width = d * this.s.scale;
        this.ctx = this.canvas.getContext("2d");
        this.s.bg == 1 && this.c.appendChild((new ha({
            w: d * this.s.scale,
            h: h * this.s.scale,
            o: h / 2 * this.s.bg_o * this.s.scale,
            bgc: this.s.bgcolor,
            sh: this.s.bg_sh,
            sh_c: this.s.sh_c,
            sh_a: this.s.sh_a
        })).c);
        if (this.s.color.indexOf("|") > 0) {
            A = this.s.color.split("|");
            B = this.ctx.createLinearGradient(0, 0, 0, h * this.s.scale);
            for (this.j = 0; this.j < A.length - 1; this.j++) B.addColorStop(this.j / (A.length - 1), "#" + A[this.j]);
            B.addColorStop(1, "#" + A[A.length - 1]);
            this.fstyle = B
        } else this.fstyle = "#" + this.s.color;
        this.ctx.fillStyle = this.fstyle;
        if (this.s.sh == 1) {
            this.ctx.shadowOffsetX = 0;
            this.ctx.shadowOffsetY = this.s.sh_under == 1 ? 2 : 0;
            this.ctx.shadowBlur = 5;
            this.ctx.shadowColor = "rgba(" + HTR("#" + this.s.sh_c) + "," + HTG("#" + this.s.sh_c) + "," + HTB("#" + this.s.sh_c) + "," + this.s.sh_a + ")"
        }
        if (a == "play") {
            this.ctx.beginPath();
            this.ctx.moveTo(6 * this.s.scale, 4 * this.s.scale);
            this.ctx.lineTo(16 * this.s.scale, 9 * this.s.scale);
            this.ctx.lineTo(6 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(6 * this.s.scale, 4 * this.s.scale);
            this.ctx.closePath();
            this.ctx.fill()
        }
        if (a == "pause") {
            this.ctx.beginPath();
            this.ctx.moveTo(6 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(6 * this.s.scale, 15 * this.s.scale);
            this.ctx.moveTo(12 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(12 * this.s.scale, 15 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.fill()
        }
        if (a == "stop") {
            this.ctx.beginPath();
            this.ctx.moveTo(5 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(5 * this.s.scale, 15 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.fill()
        }
        if (a == "back") {
            this.ctx.beginPath();
            this.ctx.moveTo(4 * this.s.scale, 10 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 10 * this.s.scale);
            this.ctx.lineTo(24 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(24 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 10 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 15 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.fill()
        }
        if (a == "volume") {
            this.ctx.beginPath();
            this.ctx.moveTo(5 * this.s.scale, 8 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 8 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 4 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 11 * this.s.scale);
            this.ctx.lineTo(5 * this.s.scale, 11 * this.s.scale);
            this.ctx.lineTo(5 * this.s.scale, 8 * this.s.scale);
            this.ctx.moveTo(15 * this.s.scale, 7 * this.s.scale);
            this.ctx.lineTo(16 * this.s.scale, 7 * this.s.scale);
            this.ctx.lineTo(16 * this.s.scale, 12 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 12 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 7 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.fill()
        }
        if (a == "volume_mute") {
            this.ctx.beginPath();
            this.ctx.moveTo(5 * this.s.scale, 8 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 8 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 4 * this.s.scale);
            this.ctx.lineTo(14 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(9 * this.s.scale, 11 * this.s.scale);
            this.ctx.lineTo(5 * this.s.scale, 11 * this.s.scale);
            this.ctx.lineTo(5 * this.s.scale, 8 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.fill()
        }
        if (a == "full") {
            this.ctx.beginPath();
            this.ctx.moveTo(5 * this.s.scale, 7 * this.s.scale);
            this.ctx.quadraticCurveTo(5 * this.s.scale, 5 * this.s.scale, 7 * this.s.scale, 5 * this.s.scale);
            this.ctx.lineTo(13 * this.s.scale, 5 * this.s.scale);
            this.ctx.quadraticCurveTo(15 * this.s.scale, 5 * this.s.scale, 15 * this.s.scale, 7 * this.s.scale);
            this.ctx.lineTo(15 * this.s.scale, 13 * this.s.scale);
            this.ctx.quadraticCurveTo(15 * this.s.scale, 15 * this.s.scale, 13 * this.s.scale, 15 * this.s.scale);
            this.ctx.lineTo(7 * this.s.scale, 15 * this.s.scale);
            this.ctx.quadraticCurveTo(5 * this.s.scale, 15 * this.s.scale, 5 * this.s.scale, 13 * this.s.scale);
            this.ctx.closePath();
            this.ctx.lineWidth = 1;
            this.ctx.strokeStyle = "#ffffff";
            this.ctx.stroke()
        }
        if (a == "line" || a == "volbarline") {
            this.ctx.beginPath();
            this.ctx.moveTo(0, 10 - this.s.h / 2);
            this.ctx.lineTo(d, 10 - this.s.h / 2);
            this.ctx.lineTo(d, 10 + this.s.h / 2);
            this.ctx.lineTo(0, 10 + this.s.h / 2);
            this.ctx.lineTo(0, 10 - this.s.h / 2);
            this.ctx.lineWidth = 0.1;
            this.ctx.stroke();
            this.ctx.closePath();
            this.ctx.fill()
        }
        if (a.indexOf("time") == 0) {
            this.c.innerHTML = "0:00";
            c(this.c, {
                width: d,
                color: "#ffffff",
                font: "10px Verdana",
                textAlign: "center"
            })
        }
        if (a == "buffer") {
            this.c.innerHTML = "";
            c(this.c, {
                display: "none",
                width: d,
                color: "#ffffff",
                font: "10px Arial",
                textAlign: "left"
            })
        }
        this.c.appendChild(this.canvas);
        c(this.canvas, {
            width: d * this.s.scale * (this.s.bg == 1 && this.s.bg_smallicon == 1 ? 0.8 : 1),
            height: h * this.s.scale * (this.s.bg == 1 && this.s.bg_smallicon == 1 ? 0.8 : 1),
            position: "absolute",
            top: this.s.bg == 1 && this.s.bg_smallicon == 1 ? 2 * this.s.scale : 0,
            left: this.s.bg == 1 && this.s.bg_smallicon == 1 ? 2 * this.s.scale : 0
        });
        this.w = d * this.s.scale;
        this.h = h * this.s.scale
    }
    function c(a, d) {
        for (var h in d) {
            typeof d[h] == "number" && h != "opacity" && (d[h] += "px");
            a.style[h] = d[h]
        }
    }
    function sa(a) {
        if (typeof a.onselectstart != "undefined") a.onselectstart = function () {
            return false
        };
        else if (typeof a.style.MozUserSelect != "undefined") a.style.MozUserSelect = "none";
        else a.onmousedown = function () {
            return false
        };
        a.style.cursor = "default"
    }
    function ha(a) {
        this.c = document.createElement("div");
        this.canvas = document.createElement("canvas");
        this.canvas.height = a.h;
        this.canvas.width = a.w;
        var d = this.canvas.getContext("2d");
        if (a.bgc.indexOf("|") > 0) {
            for (var h = a.bgc.split("|"), A = d.createLinearGradient(0, 0, 0, a.h), B = 0; B < h.length - 1; B++) A.addColorStop(B / (h.length - 1), "#" + h[B]);
            A.addColorStop(1, "#" + h[h.length - 1]);
            a.bga1 != undefined && A.addColorStop(0, "rgba(" + HTR(h[0]) + "," + HTG(h[0]) + "," + HTB(h[0]) + "," + a.bga1 + ")");
            a.bga2 != undefined && A.addColorStop(0.999, "rgba(" + HTR(h[h.length - 1]) + "," + HTG(h[h.length - 1]) + "," + HTB(h[h.length - 1]) + "," + a.bga2 + ")");
            d.fillStyle = A
        } else d.fillStyle = "#" + a.bgc;
        if (a.sh == 1) {
            d.shadowOffsetX = 0;
            d.shadowOffsetY = 0;
            d.shadowBlur = 5;
            d.shadowColor = "rgba(" + HTR("#" + a.sh_c) + "," + HTG("#" + a.sh_c) + "," + HTB("#" + a.sh_c) + "," + a.sh_a + ")"
        }
        if (a.o > 0) {
            d.beginPath();
            d.moveTo(a.onotop == 1 ? 0 : a.o, 0);
            d.lineTo(a.w - (a.onotop == 1 ? 0 : a.o), 0);
            a.onotop == 1 || d.quadraticCurveTo(a.w, 0, a.w, a.o);
            d.lineTo(a.w, a.h - a.o);
            d.quadraticCurveTo(a.w, a.h, a.w - a.o, a.h);
            d.lineTo(a.o, a.h);
            d.quadraticCurveTo(0, a.h, 0, a.h - a.o);
            d.lineTo(0, a.o);
            a.onotop == 1 || d.quadraticCurveTo(0, 0, a.o, 0);
            !a.brdc && (a.brdc = "cccccc");
            d.strokeStyle = "#" + a.brdc;
            if (a.brd == 0 || !a.brd) a.brd = 0.1;
            d.lineWidth = a.brd;
            d.stroke();
            d.fill()
        } else d.fillRect(0, 0, a.w, a.h);
        this.c.appendChild(this.canvas)
    }
    function Fa() {
        this.auto = "firstframe";
        this.bgcolor = "ffffff";
        this.bodycolor = "000000";
        this.brd = 0;
        this.brdcolor = "cccccc";
        this.buffersec = 5;
        this.cntrlbg = 1;
        this.cntrlbgcolor = "000000|000000";
        this.cntrlbgalpha1 = 0.15;
        this.cntrlbgalpha2 = 0.7;
        this.cntrlendmargin = 7;
        this.cntrlhide = 1;
        this.cntrlmargin = 3;
        this.cntrlout = 0;
        this.cntrloutheight = 35;
        this.cntrlsize = 1;
        this.cntrlbuffer = {
            center: 0
        };
        this.cntrl_buffer = {};
        this.cntrlfull = {
            out: 0
        };
        this.cntrl_full = {};
        this.cntrlstyle = {
            icon: 0,
            color: "ffffff",
            bg: 0,
            bg_o: 1,
            bg_smallicon: 1,
            bgcolor: "000000",
            bg_sh: "0",
            bg_in: "0",
            bg_gl: "0",
            gl_a1: 0.9,
            gl_a2: 0.1,
            gl_color: "FFFFFF",
            sh_blur: 6,
            sh_dist: 0,
            bg_a: 1,
            bg_w: 20,
            bg_h: 20,
            scale: 1,
            eff: 0,
            effE: "Cubic",
            sh: 0,
            sh_c: "000000",
            sh_a: 0.5,
            sh_under: 1,
            notip: 0,
            text: 0,
            center: 0,
            marginleft: 0,
            marginright: 0,
            margintop: 0,
            marginbottom: 0,
            alpha: 1
        };
        this.cntrlplay = {};
        this.cntrl_play = {};
        this.cntrlpause = {};
        this.cntrl_pause = {};
        this.cntrlstop = {};
        this.cntrl_stop = {};
        this.cntrlline = {
            h: 4,
            all_a: 0.3,
            load_a: 0.4,
            play_a: 1,
            click: 1,
            color_play: "ffffff",
            color_all: "ffffff",
            color_load: "ffffff"
        };
        this.cntrl_line = {};
        this.cntrl_volbarline = {};
        this.cntrlvolbarline = {
            h: 4,
            w: 40,
            all_a: 0.4,
            play_a: 1,
            color_play: "ffffff",
            color_all: "ffffff"
        };
        this.cntrl_volume = {};
        this.cntrlvolume = {};
        this.comment = "";
        this.showcomment = 1;
        this.commentcolor = "ffffff";
        this.commentbgcolor = "000000";
        this.commentbgcolor_k = false;
        this.commentbgalpha1 = 0.5;
        this.commentbgalpha2 = 0.1;
        this.commentalign = "left";
        this.commenttopmargin = 0;
        this.commentmargin = 7;
        this.namefont = "Verdana";
        this.namefontsize = 11;
        this.namefontstyle = "normal";
        this.controls = "play,back,time_play,line,time_all,volume,volbarline,full,buffer";
        this.debug = 0;
        this.file = "";
        this.htmlsize = 0;
        this.iframe = "";
        this.m = "video";
        this.nohtml5 = "";
        this.padding = this.o = 0;
        this.poster = "";
        this.screencolor = "000000";
        this.volume = 0.8;
        this.w = 500;
        this.h = 375;
        this.stg = document.getElementById(f.uid);
        this.stg == null && alert("Uppod: UID (" + f.uid + ") not found");
        this.sw = this.stg.offsetWidth;
        this.sh = this.stg.offsetHeight;
        this.lang = "ru";
        for (var a in f) this[a] = f[a];
        if (this.m == "audio") {
            this.cntrlhide = 0;
            this.controls = "play,back,time_play,line,time_all,volume,volbarline,buffer";
            this.uibg = 0
        }
        if (this.st) {
            str = Ea(this.st + "?" + Math.random());
            style = JSON.parse(str, function (d, h) {
                if (typeof h === "string" && d.indexOf("color") > -1) h = h.replace("#", "");
                return h
            });
            for (a in style) this[a] = style[a];
            if (this.htmlsize == 1 || !style.w && !style.h) {
                this.w = this.sw;
                this.h = this.sh
            }
        }
    }
    function Ea() {}
    function Ea(a) {
        if (a) {
            req = new XMLHttpRequest;
            req.open("GET", a, false);
            req.send(null);
            if (req.status == 200) return req.responseText
        }
    }
    var b, va, qa = false,
        ra = false,
        oa = false,
        r = false,
        M = false,
        ta = false,
        U = false,
        ja = false,
        xa = false,
        ua = false,
        Aa = false,
        ia = 0,
        S;
    if (document.getElementById(f.uid)) ca();
    else window.onload = function () {
        ca()
    };
    var G, L, ka, la, na, ma, T, e, Z, w, pa, J, P, W, aa, R, $, V, Q, s, O, ga, ba, l, x, D, E, H, I, y, o, v, m;
    this.getStatus = function () {
        return !xa ? 0 : U ? 3 : r ? 1 : 2
    };
    this.Play = function () {
        !r && oa && C()
    };
    this.Pause = function () {
        r && C()
    };
    this.Stop = function () {
        oa && K()
    }
}

function Tween(f) {
    f.dur == undefined && (f.dur = 1E3);
    f.what == "a" && (new Fx.Morph(f.mc, {
        duration: f.dur
    })).start({
        opacity: [f.from, f.to]
    })
}
function HTR(f) {
    return parseInt(cutHex(f).substring(0, 2), 16)
}
function HTG(f) {
    return parseInt(cutHex(f).substring(2, 4), 16)
}
function HTB(f) {
    return parseInt(cutHex(f).substring(4, 6), 16)
}
function cutHex(f) {
    return f.charAt(0) == "#" ? f.substring(1, 7) : f
}
function trace(f) {
    alert(f)
}
if (!this.JSON) this.JSON = {};
(function () {
    function f(j) {
        return j < 10 ? "0" + j : j
    }
    function ca(j) {
        fa.lastIndex = 0;
        return fa.test(j) ? '"' + j.replace(fa, function (q) {
            var k = C[q];
            return typeof k === "string" ? k : "\\u" + ("0000" + q.charCodeAt(0).toString(16)).slice(-4)
        }) + '"' : '"' + j + '"'
    }
    function ea(j, q) {
        var k, n, u, N, F = t,
            p, g = q[j];
        if (g && typeof g === "object" && typeof g.toJSON === "function") g = g.toJSON(j);
        if (typeof K === "function") g = K.call(q, j, g);
        switch (typeof g) {
        case "string":
            return ca(g);
        case "number":
            return isFinite(g) ? String(g) : "null";
        case "boolean":
        case "null":
            return String(g);
        case "object":
            if (!g) return "null";
            t += Y;
            p = [];
            if (Object.prototype.toString.apply(g) === "[object Array]") {
                N = g.length;
                for (k = 0; k < N; k += 1) p[k] = ea(k, g) || "null";
                u = p.length === 0 ? "[]" : t ? "[\n" + t + p.join(",\n" + t) + "\n" + F + "]" : "[" + p.join(",") + "]";
                t = F;
                return u
            }
            if (K && typeof K === "object") {
                N = K.length;
                for (k = 0; k < N; k += 1) {
                    n = K[k];
                    if (typeof n === "string") if (u = ea(n, g)) p.push(ca(n) + (t ? ": " : ":") + u)
                }
            } else for (n in g) if (Object.hasOwnProperty.call(g, n)) if (u = ea(n, g)) p.push(ca(n) + (t ? ": " : ":") + u);
            u = p.length === 0 ? "{}" : t ? "{\n" + t + p.join(",\n" + t) + "\n" + F + "}" : "{" + p.join(",") + "}";
            t = F;
            return u
        }
    }
    if (typeof Date.prototype.toJSON !== "function") {
        Date.prototype.toJSON = function () {
            return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
        };
        String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
            return this.valueOf()
        }
    }
    var da = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        fa = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        t, Y, C = {
            "\u0008": "\\b",
            "\t": "\\t",
            "\n": "\\n",
            "\u000c": "\\f",
            "\r": "\\r",
            '"': '\\"',
            "\\": "\\\\"
        },
        K;
    if (typeof JSON.stringify !== "function") JSON.stringify = function (j, q, k) {
        var n;
        Y = t = "";
        if (typeof k === "number") for (n = 0; n < k; n += 1) Y += " ";
        else if (typeof k === "string") Y = k;
        if ((K = q) && typeof q !== "function" && (typeof q !== "object" || typeof q.length !== "number")) throw Error("JSON.stringify");
        return ea("", {
            "": j
        })
    };
    if (typeof JSON.parse !== "function") JSON.parse = function (j, q) {
        function k(u, N) {
            var F, p, g = u[N];
            if (g && typeof g === "object") for (F in g) if (Object.hasOwnProperty.call(g, F)) {
                p = k(g, F);
                if (p !== undefined) g[F] = p;
                else delete g[F]
            }
            return q.call(u, N, g)
        }
        var n;
        j = String(j);
        da.lastIndex = 0;
        if (da.test(j)) j = j.replace(da, function (u) {
            return "\\u" + ("0000" + u.charCodeAt(0).toString(16)).slice(-4)
        });
        if (/^[\],:{}\s]*$/.test(j.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
            n = eval("(" + j + ")");
            return typeof q === "function" ? k({
                "": n
            }, "") : n
        }
        throw new SyntaxError("JSON.parse");
    }
})();
