var currentPanel;
//?id=1
var gobeach = 1; beachid = location.href.substring(location.href.indexOf('?id='));
if ( beachid.substring(0,4) == '?id=' ){
 if ( beachid.length == 5 ){ gobeach = beachid.substring(4,5);}
 if ( beachid.length == 6 ){ gobeach = beachid.substring(4,6);}
}
if ( gobeach <= 0 ) gobeach = 1; if ( gobeach >= 23 ) gobeach = 1;

function showPanel(panelNum) {
   //hide visible panel, show selected panel, 
   //set tab
   if ( panelNum == 0 ) panelNum = gobeach;

   if (currentPanel != null) {
      hidePanel();
   }
   document.getElementById 
      ('panel'+panelNum).style.visibility = 'visible';
   document.getElementById 
      ('panel'+panelNum).style.display = 'block';
      currentPanel = panelNum;
      setState(panelNum);
}
   
function hidePanel() {
   //hide visible panel, unhilite tab
   document.getElementById
     ('panel'+currentPanel).style.visibility = 'hidden';
   document.getElementById
     ('panel'+currentPanel).style.display = 'none';
   document.getElementById
     ('tab'+currentPanel).style.backgroundColor = '#fff7ad';
   document.getElementById
     ('tab'+currentPanel).style.color = '#404040';
   document.getElementById
     ('tab'+currentPanel).style.fontWeight = 'normal';
}
   
function setState(tabNum) {
   if (tabNum==currentPanel) {
      document.getElementById
        ('tab'+tabNum).style.backgroundColor = '#efe5b4';
      document.getElementById
        ('tab'+tabNum).style.color = 'black';
      document.getElementById
        ('tab'+tabNum).style.fontWeight = 'bold';
   }
   else {
      document.getElementById
        ('tab'+tabNum).style.backgroundColor = '#fff7ad';
      document.getElementById
        ('tab'+tabNum).style.color = '#404040';
      document.getElementById
        ('tab'+tabNum).style.fontWeight = 'normal';
   }
}
   
function hover(tab) { tab.style.fontWeight = 'bold'; }

if (document.images) {
  tOn = new Image; tOff = new Image; tabOff = new Image;
  tabOff.src = "../images/tab_off.gif"; tOn.src = "../images/ton.gif"; tOff.src = "../images/toff.gif"
}

else {
  tabOff = ""; tOn = ""; tOff = ""; tabOff = "";
  document.yImg = ""; document.tImg = "";
}
