﻿/// <reference name="MicrosoftAjax.debug.js" />
/// <reference name="MicrosoftAjaxTimer.debug.js" />
/// <reference name="MicrosoftAjaxWebForms.debug.js" />
/// <reference path="../ExtenderBase/BaseScripts.js" />
/// <reference path="../Common/Common.js" />
/// <reference path="../Compat/Timer/Timer.js" />
/// <reference path="../Animation/Animations.js" />
/// <reference path="../Animation/AnimationBehavior.js" />
/// <reference path="../PopupExtender/PopupBehavior.js" />

var ProgressSet_EventID = 'xxxxxxx';
function ProgressSetEv(EventId) {
    ProgressSet_EventID = EventId;
}
function ProgressUpdating(progrId, areaId) {

    if (areaId != ProgressSet_EventID) {
        return;
    }

    // get the update progress div
    var updateProgressDiv = $get(progrId);
    // make it visible
    updateProgressDiv.style.display = '';
    //  get the gridview element        
    var areaView = $get(areaId);
    // get the bounds of both the gridview and the progress div
    var areaViewBounds = Sys.UI.DomElement.getBounds(areaView);
    var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);

    //	do the math to figure out where to position the element (the center of the gridview)
    var x = areaViewBounds.x + Math.round(areaViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
    var y = areaViewBounds.y + (Math.round(areaViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2));


    //	set the progress element to this position
    Sys.UI.DomElement.setLocation(updateProgressDiv, x, y);
}

function ProgressUpdated(progrId) {

    // get the update progress div
    var updateProgressDiv = $get(progrId);
    // make it invisible
    updateProgressDiv.style.display = 'none';
}

