if ((document.all) && (!document.getElementById))
    document.getElementById = function(id)
    {
        return document.all[id];
    };
      

function showItem(id, show)
{
    var itemExpand = document.getElementById("expand"+id);
    var itemClose  = document.getElementById("close"+id);
    var item = document.getElementById("item"+id);
    
    if ((!itemExpand) || (!itemClose) || (!item)) return false;
    
    if (show) {
        itemExpand.className = " open";
        itemClose.className  = "collapse";
        item.className = "item-content";
    } else {
        itemExpand.className = "";
        itemClose.className  = "collapse hide";
        item.className = "hide";
    }
    
    return true;
}


function closeAllItems()
{
    var id = 1;
    while (true) {
        if (!showItem(id, false)) return;
        id++;
    }
    
}


function openAllItems()
{
    var id = 1;
    while (true) {
        if (!showItem(id, true)) return;
        id++;
    }
}


function openItem(id)
{
    showItem(id, true);
}

function closeItem(id)
{
    showItem(id, false);
}
