if (! (document.aTabPageId /*&& (document.aTabPageId instanceof Array)*/))
{
    document.aTabPageId = new Object();

    var TabCollection = 
    {
        _setTabVisibility: function (p_id, p_visibility)
        {
            var oElement = document.getElementById (p_id);
            var visibility = 'none';
            if (p_visibility.toString().toLowerCase() == 'visible')  
            {
                visibility = 'block';
            }
            if (oElement)  oElement.style.display = visibility;
        },
        selectTab: function (p_collectionId, p_tabNo)
        {
            if (p_collectionId.toString().length && (p_tabNo > 0))
            {
                if (document.aTabPageId 
                && document.aTabPageId[p_collectionId])
                {
                    var tabNo;
                    var pageId;
                    for (var i = 0; i < document.aTabPageId[p_collectionId].length; i++)
                    {
                        tabNo = i + 1;
                        pageId = p_collectionId + '_page' + tabNo;
                        if (tabNo == p_tabNo)
                        {
                            var oTabs = document.getElementById 
                            (
                                p_collectionId + '_tabs'
                            );
                            /*
                             * IE won't let us do an "instanceof" 
                             * against "Object"
                             */
                            if (oTabs)
                            {
                                var aMatch = oTabs.className.match 
                                (
                                    /(^|.*?\s+)(bg|bgFive)[1-5](\s+.*)/
                                );
                                if ((aMatch instanceof Array) 
                                && aMatch.length)
                                {
                                    oTabs.className = aMatch[1] + 
                                                      aMatch[2] + 
                                                      tabNo + 
                                                      aMatch[3];
                                }
                            }
                            TabCollection._setTabVisibility 
                            (
                                pageId, 
                                'visible'
                            );
                        }
                        else
                        {
                            TabCollection._setTabVisibility (pageId, '');
                        }
                    }
                }
            }
        },
        _contentHeight: function (p_oElement)
        {
            var contentHeight = 0;
            if (p_oElement)
            {
                contentHeight = p_oElement.clientHeight - 
                                p_oElement.style.marginTop -
                                p_oElement.style.borderTopWidth -
                                p_oElement.style.paddingTop -
                                p_oElement.style.paddingBottom -
                                p_oElement.style.borderBottomWidth -
                                p_oElement.style.marginBottom;
            }
            return contentHeight;
        },
        equalizeTabHeights: function (p_collectionId)
        {
            if (p_collectionId.toString().length)
            {
                if (document.aTabPageId 
                && document.aTabPageId[p_collectionId])
                {
                    var oPage;
                    var heightMax = 0;
                    /*
                     * First, we need to find out exactly how tall the 
                     * tallest tab page is
                     */
                    for (var i = 0; i < document.aTabPageId[p_collectionId].length; i++)
                    {
                        oPage = document.getElementById 
                        (
                            p_collectionId + '_page' + (i + 1)
                        );
                        if (TabCollection._contentHeight (oPage) > heightMax)
                        {
                            heightMax = TabCollection._contentHeight (oPage);
                        }
                    }
                    /*
                     * Now, make all tabs the same height as the tallest
                     */
                     /*
                      * Removed as requested
                    for (var i = 0; i < document.aTabPageId[p_collectionId].length; i++)
                    {
                        oPage = document.getElementById 
                        (
                            p_collectionId + '_page' + (i + 1)
                        );
                        oPage.style.height = heightMax + 'px';
                    }
                    */
                }
            }
        }
    };
}