//<!--
var sectionActive = -1;
var sectionCount = -1;
var sectionLinkChange = true;

// Initialise the page links and sections
function initSections(numSections, changeLinkText)
{
  sectionLinkChange = changeLinkText;

  sectionCount = numSections;
  for(var i = 1; i <= sectionCount; i++)
  {
    showSection(false, i);
    // Display link elements
    var link = document.getElementById("sectionLink" + i);
    if(link != null) link.className = "sectionLinkOff";
    link = document.getElementById("sectionLink" + i + "sub");
    if(link != null) link.className = "sectionLinkOn";
  }
}

// Toggle section display
function toggleSection(sectionId)
{
  if(sectionId == sectionActive)
  {
    showSection(false, sectionActive);
    return;
  }
  
  if(sectionActive != -1)
    showSection(false, sectionActive);
  
  showSection(true, sectionId);
}

// Set section display
function showSection(show, sectionId)
{
  var item = document.getElementById("section" + sectionId);
  if(item != null)
  {    
    item.className = show ? "sectionOn" : "sectionOff";   
    sectionActive = show ? sectionId : -1;

    var link = document.getElementById("sectionLink" + sectionId);
    if(link != null)
    {
      link.className = show ? "sectionLinkOn" : "sectionLinkOff";
      // Change the link text    
      if(sectionLinkChange)
        link.innerHTML = show ? "- Hide" : "+ Click to view sponsors&hellip;";
     }
    
  }
}

//-->

