给没谱的 Les Paul's 96th Birthday 2011-06-09 google logo guitar HTML and JavaScript 增加键盘记谱功能


<!doctype html>
<title>
    Les Paul's 96th Birthday 2011-06-09 google logo (extract source code from http://www.google.cn/logos/2011/lespaul.html by Microshaoft 2011-06-12)
</title>
    <META NAME="Generator" CONTENT="EditPlus,Microshaoft">
    <META NAME="Author" CONTENT="EditPlus,Microshaoft">
    <META NAME="Keywords" CONTENT="EditPlus,Microshaoft">
    <META NAME="Description" CONTENT="EditPlus,Microshaoft">
<!--
        给没谱的 2011-06-09 Les Paul's 96th Birthday google logo guitar 增加键盘记谱的功能
        标题党一回,其实就是增加一个文本框,使其得到焦点后,开始键盘弹奏,天然可以记谱
        Please download http://www.google.cn/logos/2011/guitar11-hp-sprite.png and save it on same path with html document file! 
        Please download http://www.google.cn/logos/swf/guitar11.swf and save it on same path with html document file! 
        And then save all HTML as below to an HTML document file, such as lespaul.htm. 
        Finally, access http://localhost/lespaul.htm by using Web Browser.
-->
    <br>
    Please download
    <a href="http://www.google.cn/logos/2011/guitar11-hp-sprite.png">http://www.google.cn/logos/2011/guitar11-hp-sprite.png</a>
    and save it at the same path with html document file!
    <br>
    Please download
    <a href="http://www.google.cn/logos/swf/guitar11.swf">http://www.google.cn/logos/swf/guitar11.swf</a>
    and save it at the same path with html document file!
    <br>
    And then save all HTML as below to an HTML document file, such as lespaul.htm.
    <br>
    Finally, access
    <a href="http://localhost/lespaul.swf">http://localhost/lespaul.htm</a> by using Web Browser.
<p>
<table border="1" align="center">
    <tr>
        <td colspan="3" align="center">乐谱</td>
    </tr>
    <tr>
        <td align="right">欢乐颂:</td>
        <td>EERT TREW QQWE EWW EERT TREW QQWE WQQ</td>
        <td align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
        </td>
    </tr>
    <tr>
        <td align="right">春江花月夜:</td>
        <td>H-HHK-LHG~G-G-H-KLD~D-SDG-DGH~KL-;-K-L;LKH-G~(-和~是长音)</td>
        <td align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
        </td>
    </tr>
    <tr>
        <td align="right">沧海一声笑:</td>
        <td>pouyt uytew wewetyuop ppouyty</td>
        <td align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
        </td>
    </tr>
    <tr>
        <td align="right">两只老虎:</td>
        <td>TYUT TYUT UIO UIO OPOIUT OPOIUT UWT UWT</td>
        <td align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
        </td>
    </tr>
    <tr>
        <td align="right">隐形的翅膀</td>
        <td>358787 6568321 11186532122 358787 6568321 1118653211</td>
        <td align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
        </td>
    </tr>
        <tr>
            <td colspan="3" align="center">
                给没谱的<br />
                2011-06-09 Les Paul's 96th Birthday google logo guitar<br />
                增加键盘记谱的功能<br />
                标题党一回,其实就是增加一个文本框,使其得到焦点后,开始键盘弹奏,天然可以记谱<br />
                请将焦点移至下面文本框,不要呼出输入法,然后键盘弹奏,可记下乐谱
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <input  type="text" size="100%" />
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <input type="button" value="play" onclick="alert('忽悠,没有研究出来!');" />
            </td>
        </tr>
</table>
<style>
    #hplogo{margin:0 auto}#hplogo:active,#hplogo:focus{outline:none}#hplogo-g{background:url(guitar11-hp-sprite.png)
    no-repeat 0 0;height:175px;position:relative;width:474px}#hplogo-click{background:url(guitar11-hp-sprite.png)
    no-repeat -2000px -2000px;cursor:pointer;height:130px;left:0;position:absolute;top:0;width:474px}#hplogo-lcd{height:30px;left:70px;position:absolute;top:129px;width:200px}#hplogo-lcd-icon{background:url(guitar11-hp-sprite.png)
    no-repeat -580px -162px;cursor:pointer;height:0;position:absolute;width:0}#hplogo-lcd-text{background:transparent;border:0
    none;color:#666;cursor:text;
    font-family:"VT323",arial,sans-serif;font-size:14px;left:77px;
    position:absolute;top:134px;text-decoration:none;width:182px}#hplogo-lcd-screen{background:url(guitar11-hp-sprite.png)
    no-repeat -2000px -2000px;height:20px;left:52px;position:absolute;top:134px;width:214px}#hplogo-on{background:url(guitar11-hp-sprite.png)
    no-repeat -2000px -2000px;height:37px;left:272px;position:absolute;top:123px;width:62px}#hplogo-led{background:url(guitar11-hp-sprite.png)
    no-repeat -2000px -2000px;height:21px;left:292px;position:absolute;top:133px;width:21px}.hplogo-str{background:url(guitar11-hp-sprite.png)
    no-repeat -530px -60px;height:20px;position:absolute;width:255px}#hplogot{-webkit-box-shadow:5px
    5px 10px #ddd;-moz-box-shadow:5px 5px 10px #ddd;box-shadow:5px 5px 10px
    #ddd;-webkit-transition:opacity 0.5s ease-out;-moz-transition:opacity 0.5s
    ease-out;-o-transition:opacity 0.5s ease-out;transition:opacity 0.5s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#ffffca;border:1px
    solid #b5b5b5;cursor:pointer;display:none;font:normal 9pt arial,sans-serif;left:128px;opacity:0;padding:2px
    3px;position:absolute;top:16px;white-space:nowrap}
</style>
<div style="font-family:arial,sans-serif;margin:80px auto;text-align:center;width:474px">
    <div id=hplogo>
        <div id=hplogo-g>
            <div id=hplogo-click onclick="google.doodle.go();">
            </div>
            <div id=hplogo-lcd-screen>
            </div>
            <div id=hplogo-lcd-icon>
            </div>
            <input id=hplogo-lcd-text value="" autocomplete=off onclick="this.focus();this.select()"
            readonly=readonly>
            <div id=hplogo-on>
            </div>
            <div id=hplogo-led>
            </div>
            <div id=hplogot>
                Les Paul's 96th Birthday
            </div>
        </div>
        <div style="height:0;left:-100px;overflow:hidden;position:absolute;top:-100px;width:0">
            <input id=hplogo-i>
        </div>
    </div>
    <br>
    <br>
    Back to
    <a href="http://www.google.com/logos/index.html#logo-2011lespaul-hp">
        Google Logos
    </a>
</div>
<script>
    (function() {
        //alert(window.location.toString() + "?");
        var g = null,
        h;
        try {
            if (!window.google) window.google = {};
            if (!google.doodle) google.doodle = {};
            var i, n, o, p, r, aa, s, t, ba, u, ca, da, ea = navigator.userAgent.indexOf("MSIE") >= 0,
            fa = [[3, "#776a62", "#2063ff", 2, [[28, 23], [103, 23]]], [5, "#776a62", "#f61b33", 2, [[28, 38], [103, 38]]], [0, "#776a62", "#ffdd24", 2, [[65, 67], [318, 67]]], [2, "#776a62", "#07d238", 2, [[28, 81], [281, 81]]], [7, "#776a62", "#2063ff", 1, [[28, 96.5], [281, 96.5]]], [9, "#776a62", "#f61b33", 1, [[29, 111.5], [104, 111.5]]], [1, "#776a62", "#07d238", 2, [[358, 66], [433, 66]]], [4, "#776a62", "#2063ff", 2, [[358, 81], [433, 81]]], [6, "#776a62", "#f61b33", 2, [[330, 96], [405, 96]]], [8, "#776a62", "#ffdd24", 1, [[358, 111.5], [434, 111.5]]]],
            ga = 0,
            ha = 0,
            v = 0,
            w = 0,
            x = !0,
            y = [],
            z = g,
            A = g,
            B = function(a) {
                a && a.parentNode && a.parentNode.removeChild(a)
            },
            C = function(a, b, c) {
                if (a) {
                    if (!google.doodle.ka) google.doodle.ka = [];
                    google.doodle.ka.push(arguments);
                    var d = a,
                    e = b,
                    f = c;
                    d.addEventListener ? d.addEventListener(e, f, !1) : d.attachEvent("on" + e, f)
                }
            },
            ia = function(a, b, c) {
                a && (a.removeEventListener ? a.removeEventListener(b, c, !1) : a.detachEvent("on" + b, c))
            },
            ja = function() {
                if (google.doodle.ka) for (var a; a = google.doodle.ka.pop();) ia.apply(g, a)
            },
            D = function(a) {
                a ? a.stopPropagation && a.stopPropagation() : window.event.cancelBubble = !0;
                return ! 1
            },
            E = function(a) {
                if (i !== a) {
                    var b = i;
                    i = a;
                    for (a = 0; a < y.length; ++a) y[a](b)
                }
            },
            F = 0;
            y.push(function() {
                var a = document.getElementById("hplogo-on");
                if (a) i == 1 ? (a.style.backgroundPosition = "-476px -139px", F = 0) : i == 2 ? F = 1 : (a.style.backgroundPosition = "-2000px -2000px", F = 0)
            });
            var ka = function(a) {
                i == 0 || i == 5 || i == 4 ? E(1) : E(4);
                return D(a)
            },
            G = g,
            ma = function(a) {
                B(document.getElementById("goo-gl-script"));
                G && window.clearTimeout(G);
                var b = "http://google-lespaul.appspot.com?callback=google.doodle.url&url=" + encodeURIComponent(a),
                c = document.createElement("script");
                c.src = b;
                c.id = "goo-gl-script";
                G = window.setTimeout(function() {
                    la(a)
                },
                2E3);
                (document.getElementById("xjsc") || document.body).appendChild(c)
            },
            na = function(a) {
                a && a.status == "OK" && !a.error && a.id && la(a.id)
            },
            la = function(a) {
                if (i == 0 || i == 4) {
                    window.clearTimeout(G);
                    var b = document.getElementById("hplogo-lcd-text");
                    if (b) b.value = a,
                    b.select()
                }
            },
            H = [[0, 0, 0, 0, 0, 0], [ - 540, -162, 9, 9, 59, 139], [ - 551, -162, 9, 6, 62, 139], [ - 559, -162, 11, 17, 55, 138]],
            I = function(a) {
                var b = document.getElementById("hplogo-lcd-screen");
                if (b) b.style.backgroundPosition = "-678px -139px";
                if (b = document.getElementById("hplogo-lcd-icon")) b.style.backgroundPosition = H[a][0] + "px " + H[a][1] + "px",
                b.style.height = H[a][2] + "px",
                b.style.width = H[a][3] + "px",
                b.style.left = H[a][4] + "px",
                b.style.top = H[a][5] + "px"
            };
            y.push(function(a) {
                var b = document.getElementById("hplogo-lcd-text");
                if (i == 5) {
                    if (I(1), b.value == "")
                    {
                        b.value = "Playing...";
                    }
                } else if (z && (i == 0 || i == 4)) {
                    if (I(2), J(), b.value == "Playing...") b.value = ""
                } else if (i == 1) I(3),
                b.value = "Recording...";
                if (i != 2 && (a == 1 || a == 2) && z) z.stop(),
                J(),
                I(z.u.length == 0 ? 0 : 2),
                b.value = "",
                A = g,
                (a = z.eb()) && ma(a)
            });
            var oa = function(a) {
                z && (i == 0 || i == 4) ? (E(5), z.play()) : i == 5 && E(4);
                return D(a)
            };
            y.push(function() {
                if (i != 0) try {
                    document.getElementById("hplogo-i").focus()
                } catch(a) {}
            });
            y.push(function() {
                i == 1 && (z = new K, A = z.ib())
            });
            var pa = !1,
            qa = {
                el: 1,
                iw: 1,
                ja: 1,
                kk: 1,
                ky: 1,
                ko: 1,
                lt: 1,
                lv: 1,
                mk: 1,
                mr: 1,
                ru: 1,
                th: 1,
                ur: 1,
                "zh-CN": 1,
                "zh-TW": 1
            },
            ra = function() {
                if (!pa && !qa[google.kHL]) {
                    pa = !0;
                    window.WebFontConfig = {
//==================begin comments by Microshaoft begin
//                        google: {
//                            families: ["VT323"]
//                        }
//==================end comments by Microshaoft end
                    };
//==================begin comments by Microshaoft begin
                    //var a = document.createElement("script");
                    //a.src = ("https:" == document.location.protocol ? "https": "http") + "://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";
                    //a.type = "text/javascript";
                    //a.async = "true";
                    //(document.getElementById("xjsc") || document.body).appendChild(a)
//==================end comments by Microshaoft end
                }
            },
            sa = !1,
            M = g,
            ua = function() {
                N();
                M = window.setTimeout(function() {
                    ta(!0)
                },
                1E3)
            },
            N = function() {
                M && window.clearTimeout(M);
                M = g;
                ta(!1)
            },
            ta = function(a) {
                var b = document.getElementById("hplogot");
                if (b) sa ? (b.style.display = "block", b.style.opacity = a ? 1 : 0) : b.style.display = a ? "block": "none"
            },
            za = function() {
                C(document, "keydown", va);
                C(document, "mousemove", O);
                C(document, "touchmove", O);
                C(document, "touchstart", wa);
                C(window, "resize", xa);
                C(document.body, "mouseout", ya);
                var a = document.getElementById("hplogo-on");
                if (a) a.onclick = ka,
                a.style.cursor = "pointer";
                if (a = document.getElementById("hplogo-led")) a.onclick = ka,
                a.style.cursor = "pointer";
                if (a = document.getElementById("hplogo-lcd-icon")) a.onclick = oa;
                if ((a = document.getElementById("hplogo-click")) && !ea) a.onmousemove = ua,
                a.onmouseout = N
            },
            wa = function(a) {
                var b = Aa(a);
                b[0] >= v && b[0] <= v + 474 && b[1] >= w && b[1] <= w + 175 && a.preventDefault()
            },
            Aa = function(a) {
                a = a || window.event;
                return [(a.clientX || a.targetTouches && a.targetTouches[0].clientX || 0) + (document.body.scrollLeft || document.documentElement.scrollLeft), (a.clientY || a.targetTouches && a.targetTouches[0].clientY || 0) + (document.body.scrollTop || document.documentElement.scrollTop)]
            },
            O = function(a) {
                a = a || window.event;
                a = Aa(a);
                ga = a[0];
                ha = a[1]
            },
            Ba = {
                49 : 2,
                50 : 6,
                51 : 3,
                52 : 0,
                53 : 7,
                54 : 1,
                55 : 8,
                56 : 4,
                57 : 9,
                48 : 5,
                81 : 2,
                87 : 6,
                69 : 3,
                82 : 0,
                84 : 7,
                89 : 1,
                85 : 8,
                73 : 4,
                79 : 9,
                80 : 5,
                65 : 2,
                83 : 6,
                68 : 3,
                70 : 0,
                71 : 7,
                72 : 1,
                74 : 8,
                75 : 4,
                76 : 9,
                186 : 5,
                90 : 2,
                88 : 6,
                67 : 3,
                86 : 0,
                66 : 7,
                78 : 1,
                77 : 8,
                188 : 4,
                190 : 9,
                191 : 5
            },
            va = function(a) {
                var b = a || window.event;
                return n && !b.altKey && !b.ctrlKey && !b.metaKey && (b = Ba[b.keyCode], typeof b == "number") ? (i == 0 && E(4), n.V(b), D(a)) : !0
            },
            xa = function() {
                x && o != g && (x = !1, window.setTimeout(function() {
                    x = !0;
                    var a = o,
                    b = 0;
                    do b += a.offsetLeft;
                    while (a = a.offsetParent);
                    v = b;
                    a = o;
                    b = 0;
                    do b += a.offsetTop;
                    while (a = a.offsetParent);
                    w = b
                },
                30))
            },
            ya = function(a) { (a = a || window.event) && !a.toElement && O(a)
            },
            Ca = function(a, b) {
                this.i = a;
                this.Y = b;
                this.width = 474;
                this.height = 175;
                this.J = [];
                this.Ja = this.U = !1;
                this.ha = 0;
                this.ta = this.T();
                this.ua = this.ia();
                this.qa = new P(0, 0);
                this.ra = new P(0, 0);
                this.Ia = !0;
                this.La = (new Date).getTime();
                this.Xa();
                this.Ka()
            };
            h = Ca.prototype;
            h.Xa = function() {
                for (var a = 0, b; b = fa[a++];) this.J.push(new Da(b[4][0][0], b[4][0][1], b[4][1][0], b[4][1][1], b[3], b[1], b[2], a, b[0], this.i, this.Y, this))
            };
            h.T = function() {
                return ga - v
            };
            h.ia = function() {
                return ha - w
            };
            h.Ha = function(a) {
                return Q(a, this.width) / this.width
            };
            h.kb = function() {
                this.bb();
                this.Ja && this.ab();
                this.U && (this.i && this.i.clearRect(0, 0, this.width, this.height), this.Ka())
            };
            h.Ka = function() {
                for (var a = 0, b; b = this.J[a++];) b.hb(),
                b.gb()
            };
            h.ya = function() {
                if (this.J) for (var a = 0, b; b = this.J[a++];) b.ya()
            };
            h.Va = function() {
                for (var a = 0, b; b = this.J[a++];) if (b.L || b.O) {
                    this.U = !0;
                    return
                }
                this.U = !1
            };
            h.bb = function() {
                var a = (new Date).getTime(),
                b = (a - this.La) / 1E3;
                this.La = a;
                var a = this.T(),
                c = this.ia();
                this.qa.x = this.ta;
                this.qa.y = this.ua;
                this.ra.x = a;
                this.ra.y = c;
                var d = a - this.ta,
                e = c - this.ua,
                d = Math.sqrt(d * d + e * e);
                this.Ja = d > 0;
                this.ha = (this.ha * 4 + Q(((b > 0 ? d / b: 0) - 70) / 1430, 1)) / 5;
                this.ta = a;
                this.ua = c
            };
            h.ab = function() {
                if (this.Ia) this.Ia = !1;
                else for (var a = 0, b; b = this.J[a++];) {
                    var c;
                    c = this.qa;
                    var d = this.ra,
                    e = b.Ra,
                    f = b.Qa,
                    j = d.y - c.y,
                    m = f.y - e.y,
                    k = c.x - d.x,
                    l = e.x - f.x,
                    q = d.x * c.y - c.x * d.y,
                    L = f.x * e.y - e.x * f.y,
                    W = j * l - m * k;
                    W == 0 ? c = g: (k = (k * L - l * q) / W, j = (m * q - j * L) / W, c = Math.pow(k - d.x, 2) + Math.pow(j - d.y, 2) > Math.pow(c.x - d.x, 2) + Math.pow(c.y - d.y, 2) || Math.pow(k - c.x, 2) + Math.pow(j - c.y, 2) > Math.pow(c.x - d.x, 2) + Math.pow(c.y - d.y, 2) || Math.pow(k - f.x, 2) + Math.pow(j - f.y, 2) > Math.pow(e.x - f.x, 2) + Math.pow(e.y - f.y, 2) || Math.pow(k - e.x, 2) + Math.pow(j - e.y, 2) > Math.pow(e.x - f.x, 2) + Math.pow(e.y - f.y, 2) ? g: new P(k, j));
                    c && !b.L && (this.ha < 0.4 ? b.Ya(c.x, c.y) : b.Ma(c.x, c.y, !1))
                }
            };
            h.V = function(a) {
                a >= 0 && a < 12 && this.J[a].V()
            };
            var Q = function(a, b) {
                return a < 0 ? 0 : a > b ? b: a
            },
            Ea = function(a) {
                for (var b = [], a = a.match(/[0-9a-f]{2}/gi), c = 0, d; d = a[c++];) b.push(parseInt(d, 16));
                return b
            },
            P = function(a, b) {
                this.x = a;
                this.y = b
            },
            Da = function(a, b, c, d, e, f, j, m, k, l, q, L) {
                this.z = a;
                this.A = b;
                this.ea = c;
                this.fa = d;
                this.Ra = new P(this.z, this.A);
                this.Qa = new P(this.ea, this.fa);
                this.R = this.ea - this.z;
                this.S = this.fa - this.A;
                this.length = Math.sqrt(this.R * this.R + this.S * this.S);
                this.P = this.z + this.R * 0.5;
                this.Q = this.A + this.S * 0.5;
                this.W = this.P;
                this.X = this.Q;
                this.Aa = this.za = this.I = this.H = 0;
                this.ga = k;
                this.Da = this.ga / 11;
                this.Ca = this.M = this.F = this.la = 0;
                this.ca = Math.atan2(this.S, this.R);
                this.ba = Math.sin(this.ca);
                this.ma = Math.cos(this.ca);
                a = Math.PI / 2 - this.ca;
                this.Pa = Math.sin(a);
                this.Oa = Math.cos(a);
                this.index = m;
                this.lineWidth = e;
                this.na = f;
                this.Ba = j;
                this.aa = this.na;
                this.color = this.w;
                this.w = Ea(this.na);
                this.da = Ea(this.Ba);
                this.B = this.k = 0;
                this.Z = this.O = this.L = !1;
                this.oa = 1;
                this.i = l;
                this.Y = q;
                this.v = L;
                this.o = (e = this.length > 100) ? 7.5 : 5;
                this.Sa = 0.88 + (0.85 - 0.88) * this.Da;
                this.Ta = 1.4 + 1.5 * this.Da;
                this.$ = 0;
                if (!this.i) this.G = document.createElement("div"),
                this.G.className = "hplogo-str",
                this.G.style.left = this.z + 1 + "px",
                this.G.style.top = this.A - 10 + "px",
                this.G.style.width = this.length,
                this.Ua = e ? -475 : -730,
                this.Y.appendChild(this.G)
            };
            h = Da.prototype;
            h.ya = function() {
                if (this.G) this.Y.removeChild(this.G),
                this.G = g
            };
            h.gb = function() {
                var a, b;
                (this.L || this.Z) && this.H && this.I ? (a = this.H, b = this.I) : (a = this.W, b = this.X);
                var c = a - this.z,
                d = b - this.A,
                e = this.ea - a,
                f = this.fa - b;
                this.i ? (this.i.beginPath(), this.i.lineCap = "round", this.i.strokeStyle = this.aa, this.i.lineWidth = this.lineWidth, this.i.shadowOffsetX = 2, this.i.shadowOffsetY = 3, this.i.shadowBlur = 2, this.i.shadowColor = "rgba(0, 0, 0, 0.35)", c = Math.sqrt(c * c + d * d), f = Math.sqrt(e * e + f * f), e = 0.45 * c * this.ma, c = 0.45 * c * this.ba, d = 0.45 * f * this.ma, f = 0.45 * f * this.ba, this.i.moveTo(this.z, this.A), this.i.bezierCurveTo(a - e, b - c, a + d, b + f, this.ea, this.fa), this.i.stroke(), this.i.closePath()) : this.G.style.backgroundPosition = this.Ua + "px " + -(3 + Math.round(d / 2)) * 20 + "px"
            };
            h.hb = function() {
                this.L ? this.Na() : this.O && this.db()
            };
            h.db = function() {
                if (this.Z) {
                    this.aa = this.Ba;
                    var a = this.za - this.H,
                    b = this.Aa - this.I;
                    this.H += a * 0.8;
                    this.I += b * 0.8;
                    if (Math.abs(a) < 2 && Math.abs(b) < 2) this.$ = 0,
                    this.oa = 1,
                    this.Z = !1,
                    (a >= 0 ? 1 : -1) != (this.ba >= 0 ? 1 : -1) && (this.oa *= -1)
                } else if (this.color = [this.w[0] + (this.da[0] - this.w[0]) * (this.k > this.o * 0.25 ? 1 : this.k / (this.o * 0.25)), this.w[1] + (this.da[1] - this.w[1]) * (this.k > this.o * 0.25 ? 1 : this.k / (this.o * 0.25)), this.w[2] + (this.da[2] - this.w[2]) * (this.k > this.o * 0.25 ? 1 : this.k / (this.o * 0.25)), this.w[3] + (this.da[3] - this.w[3]) * (this.k > this.o * 0.25 ? 1 : this.k / (this.o * 0.25))], this.aa = "rgb(" + Math.round(this.color[0]) + "," + Math.round(this.color[1]) + "," + Math.round(this.color[2]) + ")", this.$ += this.Ta * this.oa, a = Math.sin(this.$), this.k *= this.Sa, this.W = this.P + a * this.ba * this.k, this.X = this.Q - a * this.ma * this.k, this.k <= 0.15) this.k = 0,
                this.O = !1,
                this.color = this.w,
                this.aa = this.na,
                this.v.Va()
            };
            h.Na = function() {
                var a = this.v.T(),
                b = this.v.ia(),
                c = a - this.z,
                d = b - this.A,
                e = this.ca - Math.atan2(d, c),
                c = Math.sqrt(c * c + d * d);
                this.F = c * Math.sin(e);
                this.Ea(Q(c * Math.cos(e) / this.length, 1));
                this.B = Q(Math.abs(this.F) / this.o, 1);
                Math.abs(this.F) > this.la ? this.Wa() : (this.H = a, this.I = b)
            };
            h.Ea = function(a) {
                this.M = a;
                this.Ca = this.M <= 0.5 ? this.M / 0.5 : 1 - (this.M - 0.5) / 0.5;
                this.la = this.o * this.Ca
            };
            h.Ma = function(a, b, c) {
                this.H = a;
                this.I = b;
                var b = this.v.T() - this.z,
                d = this.v.ia() - this.A;
                this.Ea(Q(Math.sqrt(b * b + d * d) / this.length, 1));
                this.F = (1 - (c ? 1 : this.v.ha)) * this.la;
                this.B = c ? 1 : Q(Math.abs(this.F) / this.o, 1);
                if (this.F < 3) this.F = 3;
                this.H += this.F * this.Oa;
                this.I += this.F * this.Pa;
                this.W = this.P;
                this.X = this.Q;
                this.O ? (this.B = Q(this.B / 2 + this.k / this.o, 1), this.k = this.B * this.o) : (this.k = this.B * this.o, this.Ga());
                this.Fa(this.B, this.v.Ha(a))
            };
            h.V = function() {
                this.Ma(this.P, this.Q, !0)
            };
            h.Ya = function(a, b) {
                this.L = !0;
                this.v.U = !0;
                this.H = a;
                this.I = b;
                this.Na()
            };
            h.Wa = function() {
                this.L = !1;
                this.W = this.P;
                this.X = this.Q;
                this.k = this.B * this.o;
                this.Fa(this.B, this.v.Ha(this.v.T()));
                this.Ga()
            };
            h.Ga = function() {
                this.v.U = !0;
                this.za = this.z + this.M * this.R;
                this.Aa = this.A + this.M * this.S;
                this.$ = 0;
                this.Z = this.O = !0
            };
            h.Fa = function(a, b) {
                if (p) try {
                    r.playTrack("guitar-" + (this.ga < 10 ? "0": "") + this.ga, this.ga, 0.4 + (0.6 - 0.4) * a, -0.8 + 1.6 * b)
                } catch(c) {
                    p = !1
                }
                A && A([this.index - 1])
            };
            var Fa = function() {
                if (p) for (var a = 0; a < 12; a++) if (p) try {
                    r.stopChannel(a)
                } catch(b) {
                    p = !1
                }
            },
            Ha = function() {
                t && (Ga("guitar11-sound-player") || Ga("guitar11-sound-player-2"))
            },
            Ga = function(a) {
                return (a = t.getElementById(a)) && a.playTrack ? (r = a, p = !0, Ia(), !0) : !1
            },
            R = function(a, b) {
                if (a < b) return - 1;
                else if (a > b) return 1;
                return 0
            },
            S = function(a) {
                a = a.match(/[\d]+/g);
                a.length = 3;
                return a.join(".")
            },
            Ja = function() {
                var a = !1,
                b = "";
                if (navigator.plugins && navigator.plugins.length) {
                    var c = navigator.plugins["Shockwave Flash"];
                    c && (a = !0, c.description && (b = S(c.description)));
                    navigator.plugins["Shockwave Flash 2.0"] && (a = !0, b = "2.0.0.11")
                } else if (navigator.mimeTypes && navigator.mimeTypes.length)(a = (c = navigator.mimeTypes["application/x-shockwave-flash"]) && c.enabledPlugin) && (b = S(c.enabledPlugin.description));
                else try {
                    c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),
                    a = !0,
                    b = S(c.GetVariable("$version"))
                } catch(d) {
                    try {
                        c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),
                        a = !0,
                        b = "6.0.21"
                    } catch(e) {
                        try {
                            c = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),
                            a = !0,
                            b = S(c.GetVariable("$version"))
                        } catch(f) {}
                    }
                }
                aa = a;
                ba = b
            },
            Ka = function() {
                for (var a = 0, b = String(ba).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), c = String("9.0.0.0").replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), d = Math.max(b.length, c.length), e = 0; a == 0 && e < d; e++) {
                    var f = b[e] || "",
                    j = c[e] || "",
                    m = RegExp("(\\d*)(\\D*)", "g"),
                    k = RegExp("(\\d*)(\\D*)", "g");
                    do {
                        var l = m.exec(f) || ["", "", ""], q = k.exec(j) || ["", "", ""];
                        if (l[0].length == 0 && q[0].length == 0) break;
                        a = R(l[1].length == 0 ? 0 : parseInt(l[1], 10), q[1].length == 0 ? 0 : parseInt(q[1], 10)) || R(l[2].length == 0, q[2].length == 0) || R(l[2], q[2])
                    } while ( a == 0 )
                }
                return a >= 0
            },
            T,
            La = {
                c: 2,
                d: 6,
                e: 3,
                f: 0,
                g: 7,
                a: 1,
                b: 8,
                C: 4,
                D: 9,
                E: 5,
                1 : 2,
                2 : 6,
                3 : 3,
                4 : 0,
                5 : 7,
                6 : 1,
                7 : 8,
                8 : 4,
                9 : 9,
                0 : 5
            },
            Ma = function(a, b) {
                if (! (typeof a != "number" || typeof b != "string")) {
                    T !== void 0 && window.clearInterval(T);
                    var c = Math.floor(6E4 / a);
                    if (! (c < 30) && !(6E4 * (b.replace("[", "").replace("]", "").length / a) > 28E3)) {
                        var d = 0;
                        E(5);
                        T = window.setInterval(function() {
                            d >= b.length && i == 5 && E(4);
                            if (i != 5) window.clearInterval(T);
                            else {
                                var a = b.charAt(d++);
                                if (a != "-") {
                                    var c = [];
                                    if (a == "[") {
                                        for (; d < b.length && b.charAt(d) != "]";) c.push(b.charAt(d++));
                                        d++
                                    } else c.push(a);
                                    for (var a = 0, j; j = c[a++];) La.hasOwnProperty(j) && n.V(La[j])
                                }
                            }
                        },
                        c)
                    }
                }
            },
            U = g,
            V = g,
            Na = function() {
                if (!U) {
                    U = {};
                    V = {};
                    for (var a = 0; a < 65; a++) U[a] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_*".charAt(a),
                    V[U[a]] = a
                }
            },
            X = function(a, b) {
                this.N = a;
                this.duration = Math.max(b, 0);
                var c = 0;
                c += this.N.length == 1 ? 5 : 11;
                c += this.duration < Math.pow(2, 5) ? 6 : 21;
                this.size = c
            };
            X.prototype.play = function() {
                for (var a = 0; a < this.N.length; ++a) n.V(this.N[a])
            };
            var Y = function(a, b) {
                for (var c = [], d = 0; d < b; ++d) c.push( !! (a & 1)),
                a >>= 1;
                return c
            },
            Z = function(a, b, c) {
                if (b + c > a.length) return - 1;
                for (var d = 0, e = 0; e < c; ++e) d *= 2,
                d |= a[b + c - e - 1] ? 1 : 0;
                return d
            },
            Oa = function(a) {
                for (var b = [], c = 0; c < 10; ++c) b.push(!1);
                for (c = 0; c < a.length; ++c) b[a[c]] = !0;
                return b
            };
            X.prototype.xa = function() {
                var a = [];
                this.N.length == 1 ? (a.push(!1), a = a.concat(Y(this.N[0], 4))) : (a.push(!0), a = a.concat(Oa(this.N)));
                this.duration < Math.pow(2, 5) ? (a.push(!1), a = a.concat(Y(this.duration, 5))) : (a.push(!0), a = a.concat(Y(this.duration, 20)));
                return a
            };
            var Pa = function(a, b) {
                var c, d, e = b;
                if (b < 0 || b >= a.length) return g;
                if (a[b]) {
                    c = b + 1;
                    if (c + 10 > a.length) d = g;
                    else {
                        d = [];
                        for (var f = 0; f < 10; ++f) a[c + f] && d.push(f)
                    }
                    if (!d) return g;
                    b += 11
                } else {
                    c = Z(a, b + 1, 4);
                    if (c == -1) return g;
                    d = [c];
                    b += 5
                }
                if (b >= a.length) return g;
                a[b] ? (c = Z(a, b + 1, 20), b += 21) : (c = Z(a, b + 1, 5), b += 6);
                return c < 0 ? g: {
                    s: new X(d, c),
                    n: b - e
                }
            },
            K = function(a) {
                this.u = a || [];
                this.va = g;
                for (var b = this.duration = a = 0; b < this.u.length; ++b) a += this.u[b].size,
                b != 0 && (this.duration += this.u[b].duration * 50);
                this.size = a
            };
            K.prototype.Za = function(a) {
                this.u.push(a);
                this.size += a.size;
                this.u.size > 1 && (this.duration += a.duration * 50)
            };
            K.prototype.$a = function() {
                return (this.size + 4) * 1.37 / 8
            };
            var Qa = g,
            Ra = function() {
                i == 1 && E(2)
            },
            Sa = g,
            Ta = function() { (i == 1 || i == 2) && E(4)
            };
            h = K.prototype;
            h.ib = function() {
                this.wa = 0;
                this.K = [];
                this.cb = !0;
                var a = this;
                this.va = window.setTimeout(function() {
                    a.tick(!0)
                },
                50);
                return function(b) {
                    a.K.push(b)
                }
            };
            h.tick = function(a) {
                this.wa++;
                if (this.K && this.K.length > 0) {
                    var b = this.wa;
                    this.wa = 0;
                    var c;
                    if (this.K.length == 1) c = this.K[0];
                    else {
                        for (var d = [], e = 0; c = this.K[e++];) for (var f = 0; f < c.length; ++f) d[c[f]] = 1;
                        c = [];
                        for (e = 0; e < d.length; ++e) d[e] && c.push(e)
                    }
                    this.K = [];
                    this.Za(new X(c, b));
                    this.u.length == 1 && (window.clearTimeout(Sa), Sa = window.setTimeout(Ta, 28E3), window.clearTimeout(Qa), Qa = window.setTimeout(Ra, 23E3));
                    b = this.$a();
                    if (b >= 1900 || this.duration >= 28E3) {
                        E(4);
                        return
                    } else b >= 1800 && E(2)
                }
                if (a) {
                    var j = this;
                    this.va = window.setTimeout(function() {
                        j.tick(!0)
                    },
                    50)
                }
            };
            h.stop = function() {
                window.clearTimeout(this.va);
                this.tick(!1);
                if (this.u.length > 0) this.u[0].duration = 0;
                this.cb = !1
            };
            h.play = function(a) {
                if (i == 5) if (this.duration > 28E3) i == 5 && E(4);
                else {
                    var b = a || 0;
                    b > 0 && this.u[b - 1].play();
                    if (b >= this.u.length) i == 5 && E(4);
                    else {
                        var c = this;
                        window.setTimeout(function() {
                            c.play(b + 1)
                        },
                        this.u[b].duration * 50)
                    }
                }
            };
            h.xa = function() {
                for (var a = [], b = 0; b < this.u.length; ++b) a = a.concat(this.u[b].xa());
                for (window.bits = a; a.length % 8 != 0;) a.push(!1);
                return a
            };
            h.eb = function() {
                if (this.u.length == 0) return g;
                // modify by Microshaoft
                var a = window.location.toString() + "?"//"lespaul.html?",
                b = Ua(window.location.toString()).hl;
                b && (a += "hl=" + b + "&");
                a += "tune=";
                for (var c = this.xa(), b = [], d = 0; d < c.length; d += 8) {
                    for (var e = 0, f = 0; f < 8; ++f) e *= 2,
                    e |= c[d + f] ? 1 : 0;
                    b.push(e)
                }
                Na();
                c = U;
                d = [];
                for (e = 0; e < b.length; e += 3) {
                    var j = b[e],
                    m = (f = e + 1 < b.length) ? b[e + 1] : 0,
                    k = e + 2 < b.length,
                    l = k ? b[e + 2] : 0,
                    q = j >> 2,
                    j = (j & 3) * 16 | m >> 4,
                    m = (m & 15) * 4 | l >> 6;
                    l &= 63;
                    k || (l = 64, f || (m = 64));
                    d.push(c[q], c[j], c[m], c[l])
                }
                return a + d.join("")
            };
            var Ua = function(a) {
                if (!a) return {};
                for (var a = a.match(/#.*/), a = (a && a.length > 0 ? a[0].substr(1) : "").split("&"), b = {},
                c = 0; c < a.length; ++c) {
                    var d = a[c];
                    d && (d = d.split("="), b[d[0]] = d[1] || "")
                }
                return b
            },
            Ia = function() {
                var a = Ua(window.location.href),
                b = parseInt(a.bpm, 10),
                a = a.tune;
                b && a && Ma(b, unescape(a));
                if (a) {
                    Na();
                    for (var c = V, b = [], d = 0; d < a.length;) {
                        var e = c[a.charAt(d++)],
                        f = d < a.length ? c[a.charAt(d)] : 0; ++d;
                        var j = d < a.length ? c[a.charAt(d)] : 0; ++d;
                        var m = d < a.length ? c[a.charAt(d)] : 0; ++d;
                        if (e == g || f == g || j == g || m == g) throw Error();
                        b.push(e * 4 | f >> 4);
                        j != 64 && (b.push(f * 16 & 240 | j >> 2), m != 64 && b.push(j * 64 & 192 | m))
                    }
                    a = [];
                    for (c = 0; c < b.length; ++c) {
                        d = b[c];
                        for (e = 0; e < 8; ++e) a.push( !! (d & 128)),
                        d *= 2
                    }
                    if (a) {
                        var k;
                        a: {
                            b = [];
                            c = 0;
                            try {
                                for (; a.length - c >= 8;) {
                                    var l = Pa(a, c);
                                    if (l) b.push(l.s),
                                    c += l.n;
                                    else {
                                        k = g;
                                        break a
                                    }
                                }
                            } catch(q) {
                                k = g;
                                break a
                            }
                            k = new K(b)
                        }
                        k && (z = k, E(5), k.play())
                    }
                }
            },
            Va = !0,
            Wa = function() {
                if (google.rein && google.dstr && !google.doodle.jb) google.doodle.jb = !0,
                google.rein.push(Wa),
                google.dstr.push($);
                if (document.getElementById("hplogo")) {
                    $();
                    google.psy && google.psy.q && google.msg && google.msg.listen(22,
                    function() {
                        $();
                        return ! 0
                    });
                    google.doodle.url = na;
                    o = document.getElementById("hplogo-g");
                    u = document.createElement("canvas");
                    u.getContext ? (u.width = 474, u.height = 175, u.hideFocus = !0, ca = u.getContext("2d"), o.appendChild(u)) : u = g;
                    xa();
                    n = new Ca(ca, o);
                    var a;
                    p = !1;
                    Ja();
                    if (!aa || !Ka()) a = !1;
                    else {
                        google.doodle.flashLoaded = Ha;
                        s = document.createElement("iframe");
                        s.name = "doodle-sound";
                        s.style.position = "absolute";
                        s.style.top = "-150px";
                        s.style.border = 0;
                        s.style.width = "100px";
                        s.style.height = "100px";
                        document.getElementById("hplogo").appendChild(s);
                        t = s.contentDocument;
                        if (t == void 0 || t == g) t = s.contentWindow.document;
                        t.open();
                        t.write('<html><head></head><body><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="0" height="0" id="guitar11-sound-player" type="application/x-shockwave-flash"><param name="movie" value="guitar11.swf"><param name="allowScriptAccess" value="always"><object id="guitar11-sound-player-2" type="application/x-shockwave-flash" data="guitar11.swf" width="0" height="0"><param name="allowScriptAccess" value="always"></object></object></body></html>');
                        t.close();
                        a = !0
                    }
                    var b = document.getElementById("hplogot");
                    b && (sa = typeof b.style.opacity != "undefined");
                    za();
                    Xa(); ! a && Va && Ia();
                    Va = !1;
                    ra();
                    if (ea) try {
                        document.execCommand("BackgroundImageCache", !1, !0)
                    } catch(c) {}
                }
            },
            Xa = function() {
                n && (n.kb(), da = window.setTimeout(Xa, 30));
                var a = document.getElementById("hplogo-led");
                if (a && F) a.style.backgroundPosition = -540 - 23 * Math.abs(Math.round(5 * Math.sin(F * Math.PI / 12))) + "px -139px",
                F++
            },
            J = function() {
                var a = document.getElementById("hplogo-led");
                if (a) a.style.backgroundPosition = "1000px 1000px"
            },
            $ = function() {
                try {
                    window.clearTimeout(da);
                    N();
                    Fa();
                    ja();
                    n && (n.ya(), n = g);
                    s && (B(s), s = g, p = !1);
                    u && (B(u), u = g);
                    z && z.stop();
                    A = z = g;
                    E(0);
                    var a = document.getElementById("hplogo-lcd-text");
                    if (a) a.value = "";
                    var b = document.getElementById("hplogo-lcd-screen");
                    if (b) b.style.backgroundPosition = "1000px 1000px";
                    J();
                    google.msg && window.setTimeout(function() {
                        google.msg.unlisten(22, $)
                    },
                    0)
                } catch(c) {}
            };
            google.doodle.cpDestroy = $;
            google.doodle.go = function() {
                google.nav && google.nav.go ? google.nav.go("http://www.google.com/search?q=Les+Paul&ct=lespaul11-hp&oi=ddle") : window.location.href = "http://www.google.com/search?q=Les+Paul&ct=lespaul11-hp&oi=ddle"
            };
            google.x ? google.x("DOODLE", Wa) : Wa()
        } catch(Ya) {
            google.ml(Ya, !1, {
                cause: "DOODLE"
            })
        };
    })();
</script>

posted @ 2011-06-12 00:20  于斯人也  阅读(583)  评论(0编辑  收藏  举报