There wasn't a plain javascript forums so I figured this to be the most appropriate place for this thread.

I have a page that runs a script on the window.onload event. My problem is that when the page is viewed in IE (6,7 & 8, have not checked other versions) a javascript error is thrown due to an element on the page not being loaded yet... and also... this does not happen when the page is first loaded but only on post backs and any time the page is loaded (after the very first load) unless you refresh (navigating back to the page without refresh throws the javascript error).

This same problem does not occure in firefox.

You can see the page yourself here:
http://www.enterprisesofcbg.com/erp/template.aspx

When you first load the page in IE it will load correctly. If you click on the URL and then press Enter to reload the page w/o refreshing, you will see the error I'm talking about. You can also see the error by pressing the "Post Back" button on the page.

You can scroll to line 341 on the page to see the window.onload script that calls each function. The error is occuring within the InitWorkArea() function called by InitApp(). Both of these functions are contained within the script file @ http://www.enterprisesofcbg.com/erp/scripts/globals.js. If you try to call the function manually by typing "javascript:InitWorkArea();" into the URL bar once the page has loaded it runs completely fine!?!?!

I hope this is all clear. I am pretty familure w/ client/server systems as I have been developing them since 2001.

I hope someone has some ideas because I am running out.