Discern focus lost to iframe inside window rather than another browser tab
<p>I have an iframe (pulled from a different domain to my site domain so I can't jquery target it) inside the  element of my page.</p>

<p>I want to detect when a user changes browser tabs and although the usual onfocus/onblur methods work ok, they're also triggered when the focus goes to the iframe embed on my page.</p>

<p>I know there a number of ways to do this but the onfocus/onblur seems like the least overhead, max compatibility and if i can identify the iframe, would be the ideal solution.</p>

<p>Is there a way to do something like:</p>

<pre><code>//applied to site 'main' window
window.onblur = function() {
     if (document.activeElement == 'the iframe embed element')//unsure how to identify
     {}//do something
     else {} //do something else
};
</code></pre>
