MediaWiki:Quartz.js

function getElement(psID) { if(document.getElementById) { return document.getElementById(psID); } else if(document.all) { return document.all[psID]; } else { for (iLayer = 1; iLayer < document.layers.length; iLayer++) { if(document.layers[iLayer].id == psID) return document.layers[iLayer]; }         }

return Null; }

function showWidgets(bShow){ var sidebar = getElement('sidebar'); var articleWrapper = getElement('articleWrapper'); var widgets = getElement('sidebar_widgets');

if (!bShow) { widgets.style.display = 'none'; widgets.style.visibility = 'hidden'; sidebar.style.width='25px'; sidebar.style.height='12px'; articleWrapper.style.paddingRight = '10px'; } else { widgets.style.display = 'block'; widgets.style.visibility = 'visible'; sidebar.style.width = '300px'; sidebar.style.height='auto'; articleWrapper.style.paddingRight = '320px'; } }

function toggleWidgets{ var widgets = getElement('sidebar_widgets');

if(widgets.style.display=='block') showWidgets(false); else showWidgets(true); }

function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function { if (oldonload) { oldonload; }     func; } } }

addLoadEvent(function {   var sidebar = getElement('sidebar');     var widgets = getElement('sidebar_widgets');

sidebar.innerHTML = ' ' + sidebar.innerHTML; showWidgets(false); });