/* Name:            clientFunctions.js
   Programmer:      Dave Moore (dave@altsrc.net)
   Inception Date:  6-24-2002
   Description:     Provides all the client script functions
   
*/

// variable for the current tab
var sCurrentTab = "";


// initialize function for page load
function init(){
  // inittabs();
  // pageOnload();
  
}

// pageOnload(); overwrite in each page to have js included in the onload event

function pageOnload(){

}
// used for the div/tabs
// quick and dirty, should handle it differently because this cycles through
// every <div>.. so no embedding <div>'s atm.

function clearTabs(){
   var tabs = document.getElementById("tabBar").cells
   var tabs2 = document.getElementById("tabBar2").cells
   
   for (var i = 0; i < tabs.length; i++)
   {
         tabs[i].className = "inactiveTab"
   }
   
   for (var i = 0; i < tabs2.length; i++)
   {
         tabs2[i].className = "inactiveTab"
   }
   
   
   
   var contentDivs = document.getElementById('contentArea').getElementsByTagName("DIV");
   for (var i = 0; i < contentDivs.length; i++)
   {
      if (contentDivs[i].style.display = "none") {
      }
      contentDivs[i].style.display = "none"
   }
}

function showPanel(selectedTab){
   clearTabs();
   var tabEl = document.getElementById(selectedTab);
   tabEl.className = "activeTab";
   var con = tabEl.getAttribute('CONNECT');
   var panel = document.getElementById(con);
   panel.style.visibility = "visible";
   panel.style.display = "block";
   document.getElementById('hiddenTabId').value = selectedTab;

}

function callPanel(selectedTab){
   clearTabs();
   var tabEl = document.getElementById(selectedTab);
   tabEl.className = "activeTab";
   var con = tabEl.getAttribute('CONNECT');
   var panel = document.getElementById(con);
   panel.style.visibility = "visible";
   panel.style.display = "block";
   document.getElementById('hiddenTabId').value = selectedTab;

}


function inittabs(){
   var sCurrentTab = sCurrentTab;
   if (sCurrentTab.length > 0) {
      callPanel(sCurrentTab);
   }

}


