!function(e){e.fn.iframeTracker=function(r){var t=this.get();if(null===r||r===!1)e.iframeTracker.untrack(t);else{if("object"!=typeof r)throw new Error("Wrong handler type (must be an object, or null|false to untrack)");e.iframeTracker.track(t,r)}},e.iframeTracker={focusRetriever:null,focusRetrieved:!1,handlersList:[],isIE8AndOlder:!1,init:function(){try{1==e.browser.msie&&e.browser.version<9&&(this.isIE8AndOlder=!0)}catch(r){try{var t=navigator.userAgent.match(/(msie) ([\w.]+)/i);t[2]<9&&(this.isIE8AndOlder=!0)}catch(i){}}if(e(window).focus(),e(window).blur(function(r){e.iframeTracker.windowLoseFocus(r)}),e("body").append('
'),this.focusRetriever=e("#focus_retriever"),this.focusRetrieved=!1,e(document).mousemove(function(r){document.activeElement&&"IFRAME"==document.activeElement.tagName&&(e.iframeTracker.focusRetriever.focus(),e.iframeTracker.focusRetrieved=!0)}),this.isIE8AndOlder){this.focusRetriever.blur(function(r){r.stopPropagation(),r.preventDefault(),e.iframeTracker.windowLoseFocus(r)}),e("body").click(function(r){e(window).focus()}),e("form").click(function(e){e.stopPropagation()});try{e("body").on("click","form",function(e){e.stopPropagation()})}catch(r){console.log("[iframeTracker] Please update jQuery to 1.7 or newer. (exception: "+r.message+")")}}},track:function(r,t){t.target=r,e.iframeTracker.handlersList.push(t),e(r).bind("mouseover",{handler:t},e.iframeTracker.mouseoverListener).bind("mouseout",{handler:t},e.iframeTracker.mouseoutListener)},untrack:function(r){if("function"!=typeof Array.prototype.filter)return void console.log("Your browser doesn't support Array filter, untrack disabled");e(r).each(function(r){e(this).unbind("mouseover",e.iframeTracker.mouseoverListener).unbind("mouseout",e.iframeTracker.mouseoutListener)});var t=function(e){return null===e?!1:!0};for(var i in this.handlersList){for(var o in this.handlersList[i].target)-1!==e.inArray(this.handlersList[i].target[o],r)&&(this.handlersList[i].target[o]=null);this.handlersList[i].target=this.handlersList[i].target.filter(t),0==this.handlersList[i].target.length&&(this.handlersList[i]=null)}this.handlersList=this.handlersList.filter(t)},mouseoverListener:function(e){e.data.handler.over=!0;try{e.data.handler.overCallback(this)}catch(r){}},mouseoutListener:function(r){r.data.handler.over=!1,e.iframeTracker.focusRetriever.focus();try{r.data.handler.outCallback(this)}catch(t){}},windowLoseFocus:function(e){for(var r in this.handlersList)if(1==this.handlersList[r].over)try{this.handlersList[r].blurCallback()}catch(t){}}},e(document).ready(function(){e.iframeTracker.init()})}(jQuery);