This is a small sample of embedding DYNAPI stuff inside the HTMl flow. Notice that you can do it at load time instead of waiting until the unLoad event is executed. This is not as flexible as we'd all want ( at the time being NS4 fails to resize but, well, it is a start.).
Consider this an alpha. In any case, you can now add layers to the document before the page has finished loading, and those will behave as expected.

Make it bigger
Note: it is IMPOSSIBLE to have NS4 reflow page contents after page load. The text going down to accomodate the layer's new size is a cool trick but it will never work in NS4, so don't bother trying.