title: Javascript to detect if user changes tab
body: <p><br>I am writing a webpage for online quiz. The basic requirement I have is that it must fire an event(stopping the quiz) if the user changes tabs or opens a news window even without minimizing their browser, i.e if the person is attempting to see the answer from some other window/tab. How can I do that?<br></p>
  <p><strong>Note :</strong> Try to avoid including a bleeding edge HTML5 feature in your answer because I want the feature to be supported by all major browsers currently.</p>