<!-- Original:  Kathi O'Shea (Kathi.O'Shea@internet.com) -->
<!-- Web Site:  http://www.web-savant.com/users/kathi/asp -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function moveOver()  
{
    var boxLength = document.archiveGroups.choiceBox.length;
    var selectedItem = document.archiveGroups.available.selectedIndex;
    var selectedText = document.archiveGroups.available.options[selectedItem].text;
    var selectedValue = document.archiveGroups.available.options[selectedItem].value;
    var toRemove;
    var i;
    var isNew = true;
    if (boxLength != 0) {
        for (i = 0; i < boxLength; i++) {
            thisitem = document.archiveGroups.choiceBox.options[i].text;
            if (thisitem == selectedText) {
                isNew = false;
                break;
                  }
           }
    } 
    if (isNew) {
        newoption = new Option(selectedText, selectedValue, false, true);
        document.archiveGroups.choiceBox.options[boxLength] = newoption;
        document.archiveGroups.available.options[selectedItem] = null;
    }
    document.archiveGroups.available.selectedIndex=-1;
}
function removeMe() {
    var boxLength = document.archiveGroups.choiceBox.length;
    var availableboxLength = document.archiveGroups.available.length;
    arrSelected = new Array();
    var count = 0;
    for (i = 0; i < boxLength; i++) {
        if (document.archiveGroups.choiceBox.options[i].selected) {
            arrSelected[count] = document.archiveGroups.choiceBox.options[i].value;
        }
        count++;
    }
    var x;
    for (i = 0; i < boxLength; i++) {
        for (x = 0; x < arrSelected.length; x++) {
            if (document.archiveGroups.choiceBox.options[i].value == arrSelected[x]) {
                //Add to the other box
                newoption = new Option(document.archiveGroups.choiceBox.options[i].text, document.archiveGroups.choiceBox.options[i].value, false, true);
                document.archiveGroups.available.options[availableboxLength] = newoption;
                availableboxLength = document.archiveGroups.available.length;
                //END OF ADDING
                document.archiveGroups.choiceBox.options[i] = null;
               }
        }
        boxLength = document.archiveGroups.choiceBox.length;
       }
}
function saveMe() {
    var strValues = "";
    var boxLength = document.archiveGroups.choiceBox.length;
    var count = 0;
    if (boxLength != 0) {
        for (i = 0; i < boxLength; i++) {
            if (count == 0) {
                strValues = document.archiveGroups.choiceBox.options[i].value;
            }
            else {
                strValues = strValues + "," + document.archiveGroups.choiceBox.options[i].value;
            }
            count++;
           }
    }
    if (strValues.length == 0) {
        alert("You have not made any selections");
    }
    else {
        alert("Here are the values you've selected:\r\n" + strValues);
       }
}
function selectAll() {
    var strValues = "";
    var boxLength = document.archiveGroups.choiceBox.length;
    var count = 0;
    if (boxLength != 0) {
        for (i = 0; i < boxLength; i++) {
            if (count == 0) {
                document.archiveGroups.choiceBox.options[i].selected = true;
            }
            else {
                document.archiveGroups.choiceBox.options[i].selected = true;
            }
            count++;
           }
    }
    return true;
}
//  End -->

