Cross-browser state checking

Add a method to check the visibility state via `document.hidden`. Since Chrome doesn't provide this property yet, I had to write a wrapper function `$.pageHidden()`.