`window.` missing.

Also, I think you should add `,0` to both `setTimeout()` calls to be explicit.