//function toggleItem(titleId, blockId) {
//    var contentTitle = document.getElementById(titleId);
//    var contentBlock = document.getElementById(blockId);
//    contentTitle.className = (contentTitle.className == 'titleExpanded') ? 'titleCollapsed' : 'titleExpanded';
//    contentBlock.className = (contentBlock.className == 'containerExpandedShow') ? 'containerExpandedHide' : 'containerExpandedShow';
//}


function showHideDiv(expCont, titleID, containerID) {
    var titleDiv = document.getElementById(titleID);
    var containerDiv = document.getElementById(containerID);
    var alreadyOpen = false;
    if (titleDiv.className == "titleExpanded") alreadyOpen = true;
    if (containerDiv.className == "containerExpandedShow") alreadyOpen = true;
    
    var kids = document.getElementById(expCont).childNodes;
    for (i = 0; i < kids.length; i++) {
        if (kids[i].tagName == undefined) continue;
        grandKids = kids[i].childNodes;
        for (j = 0; j < grandKids.length; j++) {
            if (grandKids[j].tagName != "DIV") continue;
            if (grandKids[j].className == "titleExpanded") grandKids[j].className = "titleCollapsed";
            if (grandKids[j].className == "containerExpandedShow") grandKids[j].className = "containerExpandedHide";
        }
    }
    if (!alreadyOpen) titleDiv.className = "titleExpanded";
    if (!alreadyOpen) containerDiv.className = "containerExpandedShow";
}
