// JavaScript Document


var active_element; 
var bIsMSIE; 
function initiateSelfClosing() 
{    
        if (navigator.appName == "Microsoft Internet Explorer") { 
                active_element = document.activeElement;        
                document.onfocusout = closeWnd;        
                bIsMSIE = true; 
        }    
        else { window.onblur = closeWnd; } 
} 
function closeWnd() 
{       
        if (window.opener != null) {        
                if (bIsMSIE && (active_element != document.activeElement)) { 
                        active_element = document.activeElement; 
                }        
                else { 
                        window.close(); 
                }    
        } 
} 

