function swap(listIdPrefix,group) {
    collapsedList = document.getElementById(listIdPrefix + "_collapsed");
    expandedList = document.getElementById(listIdPrefix + "_expanded");
    if (collapsedList.style.display == "block") {
        collapsedList.style.display = "none";
        expandedList.style.display = "block";
    } else {
        collapsedList.style.display = "block";
        expandedList.style.display = "none";
    }
    if (group) {
        ensureExclusivity(listIdPrefix,group);
    }
}

function ensureExclusivity(listIdPrefix,group) {

//alert("listIdPrefix is " + listIdPrefix + ", group is " + group);

    for (var i = 0 ; i < group.length ; i++) {
        if (group[i] != listIdPrefix) {
            document.getElementById(group[i] + "_collapsed").style.display = "block";
            document.getElementById(group[i] + "_expanded").style.display = "none";
        }
    }
}

// mutually exclusive lists - Update for layers
var groupA = new Array();
groupA[groupA.length] = "list_a_excl";
groupA[groupA.length] = "list_b_excl";
groupA[groupA.length] = "list_c_excl";
groupA[groupA.length] = "list_d_excl";