currentSection = ""; arSections = Array(); function registerSections(sectionsCSV) { arSections = sectionsCSV.split(","); } function disableSections(omitSection) { for(i in arSections) { if(arSections[i] != omitSection) { if(el = document.getElementById(arSections[i])) { el.style.display = "none"; } } } } function clickSection(sectionName) { if(currentSection == sectionName) return; disableSections(sectionName); if(el = document.getElementById(sectionName)) { el.style.display = ""; currentSection = sectionName; } }