I remember seing the same problem in IE some time ago, though I don't exactly know what was the cause. However, your way is not the recommended way to setup the menu because DynarchMenu.setup needs to modify the document in order to generate menus. Trying to do this before the document has finished loading can generate a bunch of errors, depending on browser and connection speed.
For instance, the hmenu.js file may not have finished loading, which will generate an error like “Undefined is null or not an object™