//Function to set the selected tab in the top navigation
//sets all other tabs to be unselected
function setTab(tabname, state)
{
  $(document).ready(function()
  {
    //remove all of the classes from the tab_nav elements
    $('#tab_nav').children(['a']).removeClass();

    //if the tab isn't already inactive add the desired state to it
    if (!$('#' + tabname).hasClass('inactive'))
    {
      $('#' + tabname).children(['a']).addClass(state);
    }
  });

}

//function to set a single tab that doesn't reset all the others
function setSingleTab(tabname, state)
{
  $(document).ready(function()
  {
    //add the desired state to the tab
    $('#' + tabname).children(['a']).addClass(state);

    //if we're setting it to inactive remove the link
    if (state === 'inactive')
    {
      $('#' + tabname).children(['a']).attr('href', '#');
    }
  });
}

