User:Topaz/sectionsplitter.js

topaz.sectionsplitter = new Object; topaz.sectionsplitter.oldonload = window.onload; window.onload = function { if (typeof topaz.sectionsplitter.oldonload == "function") topaz.sectionsplitter.oldonload;

var bc = topaz.util.getobj("bodyContent"); var bcn = topaz.util.getobj("bodyContent").childNodes; var bcnl = bcn.length; var curdiv = topaz.util.add(bc, "div", {className:"tz-primarySection"}); for(var i=0;i<bcnl;i++) { if (bcn[0].nodeName == "H2") { curdiv = topaz.util.add(bc, "div", {className:"tz-primarySection"}); }   curdiv.appendChild(bcn[0]); } }