fix cross-browser visible api

- test type of document.hidden