/**
* Table Of Contents javascript
*/

/**
* Perform the toggle
*/
function toggleTOC(type) {
  vhide = new makeDom('tochide');	
  vshow = new makeDom('tocshow');	
  vDtl = new makeDom('tocdtl');	
  if (! vDtl.id) return;
  
  if (vDtl.css.display == "none") {
    vDtl.show();
    vshow.hide();
    vhide.show();
  }
  else {
    vDtl.hide();
    vshow.show();
    vhide.hide();
  }
}

/**
* Add onclick event to the toc header, and perform the toggle to hide contents
*/
function tocinit()
{
  o = new makeDom('clsTOChdr');	
  if (! o.id) return;
  addEvent(o.evnt, 'click', toggleTOC); 
  toggleTOC();
}

/**
* Add an onload event
*/
addEvent(window, 'load', tocinit);

