problem in box #1: when the <script> is executed, the <div> element is not yet closed. (<div/> only works in XHTML served as XHTML, which is not supported in IE)
problem in box #2: the event is named "onload" (not sure if IE is case-insensitive here) and attachEvent() wants a function reference to be given, not the return value of the function (that means that the function runs before page load). use an anonymous function wrapper.
The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
André Behrens, NY Times Software Developer