Switched to window.onload