check window.document