Join the Discussion
As you can see, in this example a parameter is being passed to the function that refers to some of the web page content. The whole web page needs to have loaded before this function can run otherwise the part of the page referred to by the parameter may not be accessible.
The onresize() event handler is a another that is attached to the body tag like onload and onunload. This event handler is triggered if the page being viewed is resized (ie. the browser window becomes larger or smaller).
The onscroll() event handler can also be attached to the body tag. This event handler is triggered every time that the page being viewed is scrolled (either horizontally or vertically). This event handler is supported by most modern browsers (Netscape 6 is the most recent browser that does not support this event).
A Better Way
Similar changes can be made to move the other page level event handlers referenced on this page.
Using What You Know
I probably shouldn't be advertising this but you now know enough to take a popup window script and set it to popup automatically when your page finishes loading or when your visitor leaves your page - provided of course that they are not running a popup blocker as popups attached this way are the ones that blockers will definitely block.