﻿

function onUpdating() {
    // get the update progress div
    var pnlPopup = $get('ctrlAdvancedSearch_pnlPopup');

    //  get the gridview element
    var gridView = $get('searchTable');

    // make it visible
    pnlPopup.style.display = '';

    // 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 = 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);
}

function onUpdated() {
    // get the update progress div
    var pnlPopup = $get('ctrlAdvancedSearch_pnlPopup');
    // make it invisible
    pnlPopup.style.display = 'none';
} 
