   var currentPanel;
   
   function showPanel(panelNum) {
      //hide visible panel, show selected panel, 
      //set tab
      if (currentPanel != null) {
         hidePanel();
      }
      document.getElementById 
         ('panel'+panelNum).style.visibility = 'visible';
         currentPanel = panelNum;
         setState(panelNum);
   }
   
   function hidePanel() {
      //hide visible panel, unhilite tab
      document.getElementById
        ('panel'+currentPanel).style.visibility = 
         'hidden';
      document.getElementById
        ('tab'+currentPanel).style.backgroundColor = 
        '#aaaaaa';
      document.getElementById
        ('tab'+currentPanel).style.color = 'black';
   }
   
   function setState(tabNum) {
      if (tabNum==currentPanel) {
         document.getElementById 
           ('tab'+tabNum).style.backgroundColor = 
           '#ddddff';
         document.getElementById
           ('tab'+tabNum).style.color = 'red';
      }
      else {
         document.getElementById
           ('tab'+tabNum).style.backgroundColor = 
           '#aaaaaa';
         document.getElementById
           ('tab'+tabNum).style.color = 'black';
      }
   }
   
   function hover(tab) {
      tab.style.backgroundColor = 'ddddff';
   }

