﻿
function hoverNav(targetId, elementId, show) {
    if (show) {
        $(targetId).style.display = 'none';
        $(elementId).style.display = 'block';
    }
    else {
        $(targetId).style.display = 'block';
        $(elementId).style.display = 'none';
    }
}

function $(id) {
    return document.getElementById(id);
}

var scrollDone = false;

function loadTicker(id, msg) {
    var parEl = null;

    if (!(parEl = $(id)) || typeof msg != "object") {
        return;
    }

    this.respell = function(k, i) {

        parEl.innerHTML = msg[k];

        if (i++ == msg[k].length) {
            i = 0;
            window.setTimeout(function() { this.respell(k, i); }, 3000);
            k = (k + 1) == msg.length ? 0 : k + 1;
        } else
            window.setTimeout(function() { this.respell(k, i); }, 50);
    }

    window.respell = this.respell;
    this.respell(0, 0);
}
