// This is an addition to the ASP.NET AJAX Extensions that allows the Animation Extenders to see if a panel with Conditional Updates is actually updating or not, 
// and trigger/not trigger the animation accordingly.

Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(isUpdatePanelUpdating_HandleInitializeRequest);
var isUpdatePanelUpdating_currentPostbackElement;
function isUpdatePanelUpdating_HandleInitializeRequest(sender, args) 
{
    isUpdatePanelUpdating_currentPostbackElement = args.get_postBackElement();
}

function isUpdatePanelUpdating(panelId)
{
   var prm = Sys.WebForms.PageRequestManager.getInstance();
   var curElem = isUpdatePanelUpdating_currentPostbackElement;
   var result = !panelId; 
   while (!result && curElem) 
   {      
        if (curElem.id.toString().indexOf(panelId) > -1) 
        {                   
            result = true;                          
        }
        curElem = curElem.parentNode;
   }
 
   return result;
}

