function selectboxAdd(sel1, sel2) {
    sel1 = document.getElementById(sel1);
    sel2 = document.getElementById(sel2);
    for (var i = 0; i < sel1.length; ++i) {
        if (sel1[i].selected) {
            var opt = sel1[i];
            if (!optionExists(sel2, opt)) {
                sel2[sel2.length] = new Option(opt.text, opt.value);
            }
        }
    }
    function optionExists(sel, opt) {
        for (var i = 0; i < sel.length; ++i) {
            if (sel[i].text == opt.text && sel[i].value == opt.value) {
                return true;
            }
        }
        return false;
    }
}
function selectboxRemove(sel2) {
    sel2 = document.getElementById(sel2);
    for (var i = sel2.length - 1; i >= 0; --i) {
        if (sel2[i].selected) {
            sel2[i] = null;
        }
    }
}
function selectboxSubmit(sel2) {
    sel2 = document.getElementById(sel2);
    for (var i = 0; i < sel2.length; ++i) {
        sel2[i].selected = true;
    }
}
