If this code was on the page from the beginning, the event call to the function works fine. When this HTML is added to the page after it's loaded it appears the function call from the event fails.
IE Error (from the bottom left "! Done" in the status bar):
Error: Object expected
Further frustration - it works fine in Firefox.