Reference the window and document object directly

Reference the window and document object directly as the globalDocument variable is not available when the deferUntilReady method is called