/*-----------------------------------------------------------
    Toggles tabs - Closes any open tabs, and then opens current tab
    Input:     1.The number of the current tab
                    2.The number of tabs
                    3.(optional)The number of the tab to leave open
                    4.(optional)Pass in true or false whether or not to animate the open/close of the tabs
    Output: none 
    ---------------------------------------------------------*/

function toggleSpecialsTab(num,numelems)
{
    changeSpecialsHeader(num)
    changeSpecialsStyleBodyText(num,numelems);
}

function toggleTab(num,numelems)
{
    changeHeaderStyle(num,numelems);
    changeStyleBodyText(num,numelems);    
}

function changeSpecialsHeader(num)
{
	if(num == 1)
        {
            window.document.getElementById('header1').className = 'specialsTabActive';
			window.document.getElementById('header2').className = 'pricesTab';
        }
	else
        {
            window.document.getElementById('header1').className = 'specialsTab';
			window.document.getElementById('header2').className = 'pricesTabActive';
        }
}

function changeHeaderStyle(i,listLength)
{
    for(var x=0; x<listLength; x++)
    {
        var headerName = 'tabHeader'+(x+1)
        if(x == i-1)
        {
            window.document.getElementById(headerName).className = 'activeTab';
        }
        else
        {
            window.document.getElementById(headerName).className = 'none';
        }
    }
}

function changeSpecialsStyleBodyText(i,listLength)
{
    for(var x=0; x<listLength; x++)
    {
        var contentID = 'tabContent'+(x+1)
        if(x == i-1)
        {
            window.document.getElementById(contentID).className = 'tabContentActive';
        }
        else
        {
            window.document.getElementById(contentID).className = 'tabContent';
        }
    }
}

function changeStyleBodyText(i,listLength)
{
    for(var x=0; x<listLength; x++)
    {
        var contentID = 'tabMainContent'+(x+1)
        if(x == i-1)
        {
            window.document.getElementById(contentID).className = 'tabMainContentActive';
        }
        else
        {
            window.document.getElementById(contentID).className = 'tabMainContent';
        }
    }
}