String.prototype.endswith = function(test)
{
    return this.substring(this.length-test.length, this.length) == test;
}
String.prototype.startswith = function(test)
{
    return this.substring(0, test.length) == test;
}

function show(elid)
{
    var el = document.getElementById(elid);
    if (el) {
        el.style.display = 'block';
        }
}

function hide(elid)
{
    var el = document.getElementById(elid);
    if (el) {
        el.style.display = 'none';
        }
}

function highlight(id)
{
    var el = document.getElementById(id);
    if (el) {
        el.className += ' highlight';
    }
}

function revert(id)
{
    var el = document.getElementById(id);
    if (el) {
        el.className = el.className.substr(0, el.className.length-10);
    }
}

function check_box(box)
{
    if (box.value=='yes') {
        box.value='no';
    } else {
        box.value='yes';
    }
}
