﻿// Move an element directly on top of another element (and optionally
// make it the same size)
function cover(bottom, top, ignoreSize) 
{
    var location = Sys.UI.DomElement.getLocation(bottom);
    top.style.position = 'absolute';
    top.style.top = location.y + 'px';
    top.style.left = location.x + 'px';
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
    }
}

function openProgressPopup()
{
    $find("ModalPopupProgressExtender").show();
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(closeProgressPopup);
}

function closeProgressPopup()
{
    Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(closeProgressPopup);
    $find("ModalPopupProgressExtender").hide();
}

function requestModalPopup(commandText)
{
    $get("ctl00_ModalPopupCommandTextBox").value = commandText;
    $find("ModalPopupProgressExtender").show();
    __doPostBack("ctl00_ModalPopupCommandTextBox");
}

function openModalPopup()
{
    Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(openModalPopup);
    $find("ModalPopupProgressExtender").hide();
    $find("ModalPopupExtender").show();
}

function showFilterProgressBar() 
{
    $get("ProgressImage").style.display = "inline";
}

