﻿    var sections = new Array();
    var menulinks = new Array();

    var Cache = new Object();

    function getElement(id) {
       return (Cache[id]) ? Cache[id] : Cache[id] = document.getElementById(id);
    }

    function getSection(id) {
       if (!sections.length) sections = getElement('sections').getElementsByTagName('div');
       if (!menulinks.length) menulinks = getElement('contents').getElementsByTagName('a');
       dstat = (id == 'all')?'block':'none';
       for (i = 0; i < sections.length; i++) {
           sections[i].style.display = dstat;
           menulinks[i].className = 'contents';
       }
       if (id == 'all') return false;
       getElement(id).style.display = 'block';
       getElement('a'+id).className = 'contents-active';
       return false;
    }