Felgall: thank you I will keep that in mind next time.
On a different note I think I figured out the issue. Apparently you have to be careful when you have multiple "window.onload" functions. I had one before the <script src="..."></script> area and that must have confused the browser. I simplified it to one function and that worked just fine.
Consider this resolved.