﻿// JScript File
Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args)
{
    if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
    {
      Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(InitializeRequest);
    }
}
function InitializeRequest(sender, args)
{
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(endRequestAll);        
        prm.add_beginRequest(beginRequestAll);
              
}
function beginRequestAll(sender, args) 
       {        
                var id= sender._postBackSettings.panelID.split('|')[0];               
                id = id.replace(/\$/gi,'_');
                if (id.indexOf("pnlInner")<0 && id.indexOf("ScriptManager1")<0)
                {                
                $get('dvLoading').style.display='block'
                Cover($get(id),$get('dvLoading'),false);                                                                
                }
                
        }
function endRequestAll(sender, args) 
{
    try
    {   
        if($get('dvLoading'))           
        $get('dvLoading').style.display='none';
         var dv= $get('ctl00_pnlLoad')
         dv.style.display='none'
    }
    catch (err)
    {
          $get('dvLoading').style.display='none'
    }
                     
}
       
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 registerLink(href,rel,type) {
        var link = document.createElement('link');
        link.href = href;
        link.rel = rel;
        link.type = type;
        document.getElementsByTagName('head')[0].appendChild(link);
    }
    Sys.Application.notifyScriptLoaded();

