﻿//<summary>
//Function used to initiate display of a processing message
//</summary>
function onUpdating(controlToCenterOnClientId) 
{    
    // get the update progress div
    var pnlPopup = document.getElementById(g_pnlPopupClientID);

    // get the gridview element
    var gridView = document.getElementById(controlToCenterOnClientId);

    // make it visible
    pnlPopup.style.display = '';
    pnlPopup.style.zIndex = 50;

    // get the bounds of both the gridview and the progress div
    var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
    var pnlPopupBounds = Sys.UI.DomElement.getBounds(pnlPopup);

    // center of gridview
    var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(pnlPopupBounds.width / 2);
    var y = 150; //gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(pnlPopupBounds.height / 2);

    // set the progress element to this position
    Sys.UI.DomElement.setLocation(pnlPopup, x, y);
}

//<summary>
//Function used to end display of a processing message
//</summary>
function onUpdated() 
{   // get the update progress div
    var displayNone = 'none';
    var pnlPopup = document.getElementById(g_pnlPopupClientID);

    if (pnlPopup) 
    {
        // make it invisible
        if (pnlPopup.style.display != displayNone)
            pnlPopup.style.display = displayNone;
    }

    initializeRequiredScripts();    
}