﻿function onUpdating(e)
{
alert(e);
    var pnlPopup = $get('<%= this.p.ClientID %>'); 
    var listView = $get('<%= this.l.ClientID %>');
    
    pnlPopup.style.display = '';        
    
    var listViewBounds = Sys.UI.DomElement.getBounds(listView);
    var pnlPopupBounds = Sys.UI.DomElement.getBounds(pnlPopup);
    
    var x = listViewBounds.x + Math.round(listViewBounds.width / 2) - Math.round(pnlPopupBounds.width / 2);
    var y = listViewBounds.y + Math.round(listViewBounds.height / 2) - Math.round(pnlPopupBounds.height / 2);        

    Sys.UI.DomElement.setLocation(pnlPopup, x, y);           
}

function onUpdated() {
    var pnlPopup = $get('<%= this.e.ClientID %>'); 
    pnlPopup.style.display = 'none';
} 

function ConfirmDelete(moduleName)
{
    return confirm("Are you sure that you want to delete this " + moduleName + "?\t");
} 

function ChangeLanguage()
{
    var request = new Sys.Net.WebRequest();
    request.set_httpVerb("GET");
    request.set_url('../ChangeLanguage.aspx');
    request.add_completed( function( executor )
    {
        if (executor.get_responseAvailable()) 
        {
            var languageDiv = $get('LanguageDiv');
            var languageLink = $get('LanguageLink');
            
            var languageLinkBounds = Sys.UI.DomElement.getBounds(languageLink);
            
            languageDiv.style.top = (languageLinkBounds.y + languageLinkBounds.height) + "px";
            
            var content = executor.get_responseData();
            languageDiv.innerHTML = content;
            languageDiv.style.display = "block";                       
        }
    });
    
    var executor = new Sys.Net.XMLHttpExecutor();
    request.set_executor(executor); 
    executor.executeRequest();
}