Moving element containing an script tag - Inline example with error

The text in the grey box are written with document.write(); in an external js file. The call to the external JavaScript are placed inside the html tag for the grey box.
The grey box are then moved inside the green box by another JavaScript called at the bottom of the page.
This move will cause IE6 and IE7 to ask the server for the external JavaScript called inside the grey box twice. Other browsers, including IE8, will only ask for the external JavaScript once!