Changed document height and width detection to work on desktop browsers.