1 // Uses CSS to hide toggleables, to avoid any flashing on page load. The
2 // CSS is only emitted after it tests that it's going to be able
3 // to show the toggleables.
4 if (document.getElementById && document.getElementsByTagName && document.createTextNode) {
5 document.write('<style type="text/css">div.toggleable { display: none; }</style>');
6 hook("onload", inittoggle);
9 function inittoggle() {
10 var as = getElementsByClass('toggle');
11 for (var i = 0; i < as.length; i++) {
12 var id = as[i].href.match(/#(\w.+)/)[1];
13 if (document.getElementById(id).className == "toggleable")
14 document.getElementById(id).style.display="none";
15 as[i].onclick = function() {
23 var id = s.href.match(/#(\w.+)/)[1];
24 style = document.getElementById(id).style;
25 if (style.display == "none")
26 style.display = "block";
28 style.display = "none";