Don't try to resize the map before it's loaded.
window.onload -> window.onDOMContentLoaded
Style fixes/tweaks.