// A tab group class.
function TabGroup(prefix, suffixes)
{
    this.prefix = prefix;
    this.suffixes = suffixes;

    // Show the specified tab.
    this.show = function (suffix, hideOthers)
    {
        if (! hideOthers)
            this.hideAll();
        try {
            document.getElementById(this.prefix + suffix).style.display = '';
        } catch (e) {}
    }

    // Hide the specified tab.
    this.hide = function (suffix)
    {
        try {
            document.getElementById(this.prefix + suffix).style.display = 'none';
        } catch (e) {}
    }

    // Hide all tabs of this group.
    this.hideAll = function ()
    {
        for (var i in this.suffixes)
            this.hide(this.suffixes[i]);
    }
}
