window.onload = function() {
    var s = document.getElementsByTagName('div'), cur = 0, ti;
    if (!s) return;
    function go(n) {
        cur = n;
        var i = 1e3, e = s[n], t;
        for (var k = 0; k < s.length; k++) s[k].style.display = 'none';
        e.style.display = 'inline';
        e.style.fontSize = i + 'px';
        if (e.firstChild.nodeName === 'IMG') {
            document.body.style.backgroundImage = 'url(' + e.firstChild.src + ')';
            e.firstChild.style.display = 'none';
            e.classList.add('imageText');
        } else {
            document.body.style.backgroundImage = '';
            document.body.style.backgroundColor = e.style.backgroundColor;
        }
        if (ti != undefined) window.clearInterval(ti);
        t = parseInt(e.getAttribute('time-to-next'));
        if (!isNaN(t)) {
            ti = window.setTimeout(function(){
                fwd();
            },(t*1000));
        }
        while (
            e.offsetWidth > window.innerWidth ||
            e.offsetHeight > window.innerHeight) {
            e.style.fontSize = (i -= i * 0.05) + 'px';
            if (i < 0) break;
        }
        e.style.marginTop = ((window.innerHeight - e.offsetHeight) / 2) + 'px';
        if (window.location.hash !== n) window.location.hash = n;
        document.title = e.textContent || e.innerText;
    }
    document.onclick = function() { go(++cur % (s.length)); };
    function fwd() { go(Math.min(s.length - 1, ++cur)); }
    function rev() { go(Math.max(0, --cur)); }
    document.onkeydown = function(e) {
        if (e.which === 39) fwd();
        if (e.which === 37) rev();
    };
    document.ontouchstart = function(e) {
        var x0 = e.changedTouches[0].pageX;
        document.ontouchend = function(e) {
            var x1 = e.changedTouches[0].pageX;
            if (x1 - x0 < 0) fwd();
            if (x1 - x0 > 0) rev();
        };
    };
    function parse_hash() {
        return Math.max(Math.min(
            s.length - 1,
            parseInt(window.location.hash.substring(1), 10)), 0);
    }
    if (window.location.hash) cur = parse_hash() || cur;
    window.onhashchange = function() {
        var c = parse_hash();
        if (c !== cur) go(c);
    };

    go(cur);
};

@@ -805,18 +805,28 @@
 o-next')
+ %7C%7C 0, 10
 );
+ 
 %0A       
@@ -834,17 +834,13 @@
 if (
-!isNaN(t)
+t %3E 0
 ) %7B%0A
@@ -879,55 +879,10 @@
 ut(f
-unction()%7B%0A                fwd();%0A            %7D
+wd
 ,(t*

Improve code legibility