function hideElement(element) { document.getElementById(element).style.display = 'none'; } function hideElementAndButtons(element) { hideElement(element); hideElement(element + '-collapser'); hideElement(element + '-expander'); } function showElement(element) { document.getElementById(element).style.display = 'block'; } function hideAllSections() { hideElementAndButtons('readSection'); hideElementAndButtons('listenSection'); hideElementAndButtons('laughSection'); hideElementAndButtons('connectSection'); hideElementAndButtons('consumeSection'); } function collapseAllSections() { hideAllSections(); showElement('readSection-expander'); showElement('listenSection-expander'); showElement('laughSection-expander'); showElement('connectSection-expander'); showElement('consumeSection-expander'); } function loadPage() { collapseAllSections() if (!isMobileDevice()) { expandSection('readSection'); } } function expandSection(section) { collapseAllSections(); showElement(section); hideElement(section + '-expander'); showElement(section + '-collapser'); } function collapseSection(section) { hideElement(section); showElement(section + '-expander'); hideElement(section + '-collapser'); } function isMobileDevice() { return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1); };