﻿function JSHandleClose() 
{
    var top=self.screenTop;
    var newURL = document.URL;
    var isLoggedIn = document.getElementById('ctl00_isLoggedInHidden').value;
    if (top>9000) 
    {
        parent.opener=''; 
        window.opener = top; 
        alert('window was closed');  
        mywindow = window.open("AbandonSession.aspx","popup","toolbar=no,location=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=25,height=25");
        mywindow.moveTo(0,0);
    } 
    if ((window.event.clientY < 0 && window.event.clientY < -80) && isLoggedIn == "True") 
    {
        var my_string = confirm("Do you want to end the current session?");
        if(my_string)
        {     
            parent.opener=''; 
            window.opener = top; 
            mywindow = window.open("AbandonSession.aspx","popup","toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=25,height=25", true);
            mywindow.moveTo(0,0);
        } 
        else { //window.location = newURL; 
        }
    }        
}

