return
"<table border=\"0\" bgcolor=\"#8888aa\" cellpadding=\"0\" cellspacing=\"1\"><tr><td>\n" .
"<table border=\"0\" bgcolor=\"#f3f3ff\" CELLPADDING=5><tr><td>\n".
- "<b>".wfMsg("toc")."</b><p>\n".
+ "<b>".wfMsg("toc")."</b>" .
+ " <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" .
+ "</td></tr><tr id='tocinside'><td>\n".
$toc."</td></tr></table></td></tr></table><P>\n";
}
// in [-][H]H format...
// won't yet work with non-even tzs
function fetchTimezone() {
+ // FIXME: work around Safari bug
var localclock = new Date();
// returns negative offset from GMT in minutes
var tzRaw = localclock.getTimezoneOffset();
function guessTimezone(box) {
document.preferences.wpHourDiff.value = fetchTimezone();
}
+
+var tocShow, tocHide;
+function showTocToggle(show,hide) {
+ if(document.getElementById) {
+ document.writeln('<small>[<a href="javascript:toggleToc()" id="toctoggle">' +
+ hide + '/' + show + '</a>]</small>');
+ tocShow = show;
+ tocHide = hide;
+ }
+}
+
+function toggleToc() {
+ var toc = document.getElementById('tocinside');
+ var tog = document.getElementById('toctoggle');
+ if(toc.style.display == 'none') {
+ toc.style.display = tocWas;
+ // tog.innerHtml = tocHide;
+ } else {
+ tocWas = toc.style.display;
+ toc.style.display = 'none';
+ // tog.innerHtml = tocShow;
+ }
+}
+