﻿var  m_showClientDelay;
 var _loadTimeout;
//////////////////////////////////////////////////////////////////////////
function ClientLoad() {
	var infoPanel = document.getElementById("JsInfoPanel");
    infoPanel.style['display'] = 'none';

    var screenLoadPanel = document.getElementById("ScreenLoadPanel");
    screenLoadPanel.style['display'] = 'block';

    _loadTimeout = setTimeout("ShowClient();", 3000);
}

function ShowClient()
{
    try
    {        
        m_showClientDelay = window.clearTimeout(m_showClientDelay);
        var _screenMainPanel = document.getElementById("ScreenMainPanel");
        _screenMainPanel.style['display'] = 'block';
        var _screenLoadPanel = document.getElementById("ScreenLoadPanel");
        _screenLoadPanel.style['display'] = 'none';
		
		_loadTimeout = window.clearTimeout(_loadTimeout);
    }
    catch(e)
    {
        alert("Operation is temporary unavailable.");
    }        
}

function doUnload()
{
   try { g_Registration.close(); } 
    catch(e) {}   
    
    try { g_Help.close(); } 
    catch(e) {}   
    
    try { g_View_DocImage.close(); }  
    catch(e) {}   
    
    try { g_View_Certivicate.close(); } 
    catch(e) {}   
    
    try { g_View_Encumbrance.close(); } 
    catch(e) {}   
    
    try { g_DownloadWizard.close(); } 
    catch(e) {}   
    
    try { g_PrintWizard.close(); } 
    catch(e) {}   

    try { g_ResourceProvider.close(); } 
    catch(e) {}   
    
    try { g_PublicDownload.close(); } 
    catch(e) {}   
}

function ShowPopupTest() {
    try {
        var testWin = window.open('popuptest.html', 'PopupTest', 'width=1,height=1,left=' + 300 + ',top=' + 300 + ',scrollbars=no,toolbar=no,menubars=no,location=no,status=no,titlebar=no');
        if (!CheckPopupBlocked(testWin)) {
            if (testWin)
                testWin.close();
            alert("Popup blockers are disabled.");
        }
        if (testWin && !testWin.closed)
            testWin.close();
    } catch (exception) {
        CheckPopupBlocked(null);
    }
}
