function $(name) {
    return document.getElementById(name);
}

Array.prototype.leftpop = function() {
    if (this.length == 0) return undefined;
    var retval = this[0];
    for (var j = 1; j < this.length; j++)
        this[j - 1] = this[j];
    this.length = this.length-1;
    return retval;
}
