﻿function LoadPanel(command, div){
Loading(div);
result = PageMethods.GetPanel(command,div, onComplete, onTimeout, onError, onAbort, '', 100, 1);
}

function Loading(panel) {

    $get(panel).innerHTML = "&nbsp;";
    Sys.UI.DomElement.addCssClass($get(panel), 'hpanelloading');
}
         
function onComplete(result, response, context) {
Sys.UI.DomElement.removeCssClass($get(result[0]), 'hpanelloading');
$get(result[0]).innerHTML = result[1];
}   
            
function onTimeout(result, context) {
}

function onError(result, context)  {
alert( "error: " + result);
}

function onAbort(result, context) {
}

function OnCommand(command, arg){
result = PageMethods.OnCommand(command,arg, onCommandComplete, onTimeout, onError, onAbort, '', 100, 1);
}

function onCommandComplete(result, response, context) {

    if (result != null && result.toString().length > 0)
    {
        document.location.href = result;
    }
} 


if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
