function showTocToggle( number, show, hide ) {
  if ( document.getElementById ) {
    document.write( 
      '<span class=\'toctoggle\'><a style="color:#002aff; display: block;" href="javascript:toggleToc(' + 
      number + ')" class="internal">' +
      '<span id="showlink' + number + '" style="text-decoration: none;"><h2 style="margin-bottom: -10px; margin-top: -10px;">' + show + '</h2></span>' +
      '<span id="hidelink' + number + '"style="display:none; text-decoration: none;"><h2 style="margin-bottom: -10px; margin-top: -10px;">' + hide + '</h2></span></a></span>'
    );
  }
}

function toggleToc( number ) {
// not needed:
//   var tocmain = document.getElementById('toc' + number);
  var tocinside = document.getElementById( 'tocinside' + number );
  var showlink  = document.getElementById( 'showlink'  + number );
  var hidelink  = document.getElementById( 'hidelink'  + number );

  if ( tocinside.style.display == 'none' ) {
    tocinside.style.display = '';
    showlink.style.display  = 'none';
    hidelink.style.display  = '';
// not needed:
//   tocmain.className = '';
	} 

  else {
// not needed:
//   tocWas = tocinside.style.display;
    tocinside.style.display = 'none';
    showlink.style.display  = '';
    hidelink.style.display  = 'none';
// not needed:
//   tocmain.className = 'tochidden';
  }
}