﻿var flgDblSendStop;

if (window.attachEvent) {  
    //IE
    window.attachEvent("onbeforeunload", BeforeUnloadEventScript);  
} else if (window.addEventListener) {  
    //FireFox
    window.addEventListener("beforeunload", BeforeUnloadEventScript, false);    
} 

function BeforeUnloadEventScript() {
    var screenSend = document.getElementById("ctl00_SendPane");
    
    if (( screenSend != null && flgDblSendStop != "1")) {
        
        var width = document.body.scrollWidth;
        var height = document.body.scrollHeight;
        
        if ( document.body.clientWidth > document.body.scrollWidth ) {
            width = document.body.clientWidth;
        }
        if ( document.body.clientHeight > document.body.scrollHeight ) {
            height = document.body.clientHeight;
        }
        screenSend.style.width = width + document.body.offsetLeft+"px";
        screenSend.style.height = height + document.body.offsetTop+"px";   
        screenSend.style.display = "block";
        
//        if ( event != null ) {  
//            if ( event.type == 'beforeunload' ) {
//                window.focus();
//            }
//            else {
//            screenSend.style.display = "none";
//            }
//        }
    }
}

function SetDblSendStopFlg() 
{
    flgDblSendStop = "1";
}

function ShowHidEventDiv()
{
     var screenSend = document.getElementById("ctl00_SendPane");
     screenSend.style.display="block";
     screenSend.style.visibility="visible";
     screenSend.style.width="0px";
     screenSend.style.height="0px";
}
function HidDivEvent()
{
     var screenSend = document.getElementById("ctl00_SendPane");
     screenSend.style.width="0px";
     screenSend .style.height="0px";
}