function loaddynamic()
{
  /* Nav */
  if (document.all&&document.getElementById)
  {

    var navs = new Array("a-nav", "b-nav", "c-nav", "d-nav", "e-nav");

    for(i=0;i<navs.length;i++)
    {
      var node = document.getElementById(navs[i]);
      
      if(node)
      {
        node.onmouseover=function() 
        {
          if(this.className != "current selected")
            this.className="selected";
        }
        node.onmouseout=function()
        {
          if(this.className == "selected")
            this.className="";
        }
      }


    }
  }
  
  /* Tabs */
  var nodes = document.getElementsByTagName("ul");
  for(i=0;i<nodes.length;i++)
  { 
    if(nodes[i].className == "tabs")
    {
      var tabs = nodes[i].getElementsByTagName("a");

      for(j=0;j<tabs.length;j++)
      {
        // Move href link (for javascript-off state) int select-tab attribute
        var href = tabs[j].getAttribute("href");
        href = href.substring(href.indexOf('#'), href.length);
        tabs[j].setAttribute("select-tab", href.replace("#",""));
        //tabs[j].removeAttribute("href");
        tabs[j].setAttribute("href", "javascript:void(0);");
      
        // Tab mousedown handler
        tabs[j].onmousedown=function()
        {
          // Deselect other tabs
          others = this.parentNode.parentNode.getElementsByTagName("li");
          for(k=0;k<others.length;k++)
          {
            others[k].className="";
          }         

          // Set clicked tab as current
          
          this.parentNode.className="current";

          // Set associated tab page as current
          others = this.parentNode.parentNode.parentNode.getElementsByTagName("div");

          for(k=0;k<others.length;k++)
          {

            if(others[k].className.indexOf("page-module ") != -1 )
            { 
              others[k].className = others[k].className.replace("current ","");
            }
            
          } 
          
          page = document.getElementById(this.getAttribute("select-tab"));
          
          page.className = "current " + page.className

        }

        
      }
    }
  }
  

    

}



//DOM-ready watcher
function domReady()
{
  //start or increment the counter
  this.n = typeof this.n == 'undefined' ? 0 : this.n + 1;
  
  //if DOM methods are supported, and the body element exists
  //(using a double-check including document.body, for the benefit of older moz builds [eg ns7.1] 
  //in which getElementsByTagName('body')[0] is undefined, unless this script is in the body section)
  //>>> and any elements the script is going to manipulate exist
  if
  (
    typeof document.getElementsByTagName != 'undefined' 
    && (document.getElementsByTagName('body')[0] != null || document.body != null)
      && document.getElementById('b-nav') != null 
  )
  {
  //>>>-- DOM SCRIPTING GOES HERE --<<<
  
  
    loaddynamic();


  //>>>-----------------------------<<<
  }

  //otherwise if we haven't reached 60 (so timeout after 15 seconds)
  //in practise, I've never seen this take longer than 7 iterations [in kde 3.2.2 
  //in second place was IE6, which takes 2 or 3 iterations roughly 5% of the time]
  else if(this.n < 60)
  {
    //restart the watcher
    //using the syntax ('domReady()', n) rather than (domReady, n)
    //because the latter doesn't work in Safari 1.0
    setTimeout('domReady()', 250);
  }
};
//start the watcher
domReady();



