/*
 * Name: SES.js
 * Author: Skilfusion Software
 * Note: Functionality for Software Environment Specs: Tab
 */

var currentTab = "engine";

//assumes that name of tab is the same as id of section
function changeTab(elem)
{
    //hide currentTabSection,
    hideCurrentTab();
    
    var id = elem.id;
    
    //change the tab style
    elem.className = "selected";
    
    //change the highliter cell style        
    elem = document.getElementById( 'under' + id);
    elem.style.visibility = "visible";        
    
    //show the corresponding section                
    elem = document.getElementById(id.substr(0, id.length - 3));        
    elem.style.display = "block";
    
    currentTab = elem.id;
}

function hideCurrentTab()
{   
    //change the class of the tab        
    var elem = document.getElementById(currentTab + 'Tab');
    elem.className = "notSelected";
    
    //change the class of the tab highlighter cell
    elem = document.getElementById( 'under' + currentTab + 'Tab');
    elem.style.visibility = "hidden";
            
    //hide the tabSection
    elem = document.getElementById(currentTab);
    elem.style.display = "none";
}
    


