check if document has focus on load