title: Detect tab/window activation in JavaScript
body: <p>It seems that Google+ checks for notification updates when I activate the tab in Firefox</p>
  
  <p>It'd show "0" every time I activate it, but change to a number of new notifications in a couple of seconds after that.</p>
  
  <p>What's the mechanism allowing to tap into that event? Is there a specific DOM event for that? Or are they using something like <em>onmouseover</em> handler and just consider any kind of activity to be a sufficient indicator of tab activation?</p>