function disable_buttons(noBrowserDisable) {
    var i = 1;
    while (btn = document.getElementById('button' + i)) {
        btn.className = btn.className + ' disabled';
        if (!noBrowserDisable) {
            btn.disabled = true;
        }
        i = i + 1;
        if (!(document.getElementById('button' + i)) && (document.getElementById('button' + (i+1)))) {
            i = i + 1;
        } else if(!(document.getElementById('button' + i)) && document.getElementById('button' + (i+2))) {
            i = i + 2;
        }
    }
}

function enable_buttons(noBrowserDisable) {
    var i = 1;
    while (btn = document.getElementById('button' + i)) {
        btn.className = btn.className.substring(0, btn.className.indexOf(' '));
        if (!noBrowserDisable) {
            btn.disabled = false;
        }
        i = i + 1;
        if (!(document.getElementById('button' + i)) && (document.getElementById('button' + (i+1)))) {
            i = i + 1;
        }
    }
}
