/** Sets the visibility of the sidebar.
 * @param visible \c true to make the sidebar visible, otherwise \c false.
 */
function sidebarSetVisible(visible) {
    document.getElementById("sidebar").style.visibility = visible ? "visible" : "hidden";
    document.getElementById("sidebarbutton").style.visibility = !visible ? "visible" : "hidden";
}

function insertSlashdot() {
    var iframe = document.createElement('iframe');
    iframe.setAttribute('src', 'http://slashdot.org/slashdot-it.pl?' + ['url=' + encodeURIComponent(window.location.href), 'style=' + encodeURIComponent('h0'), 'title=' + encodeURIComponent('document.title')].join('&amp;'));
    iframe.setAttribute('height', '25');
    iframe.setAttribute('width', '130');
    iframe.setAttribute('scrolling', 'no');
    iframe.setAttribute('frameborder', '0');
    document.getElementById('slashdot').appendChild(iframe);
}

for (i = 0; i < document.styleSheets.length; i++) {
    size = document.styleSheets.item(i).cssRules.length;
    document.styleSheets.item(i).insertRule("body.multicol div.body { -moz-column-count:3; -moz-column-rule-color:#1e5; -moz-column-rule-style:solid; -moz-column-rule-width:1px; }", size++);
    document.styleSheets.item(i).insertRule("body.twocol div.body { -moz-column-count:2; -moz-column-rule-color:#1e5; -moz-column-rule-style:solid; -moz-column-rule-width:1px; }", size++);
    document.styleSheets.item(i).insertRule("h1, h2, h3, h4, h5, h6 { -moz-column-break-after:avoid; }", size++);
    document.styleSheets.item(i).insertRule("h1 { -moz-column-span:all; }", size++);
}
