﻿SearchLoadingPanelScript = function() {
    this.initialize = function() {
        if (Sys) {
            if (Sys.WebForms) {
                with (Sys.WebForms.PageRequestManager.getInstance()) {
                    add_beginRequest(this.onBeginRequest);
                    add_endRequest(this.onEndRequest);
                }
            }
        }
    },
    this.onBeginRequest = function(sender, args) {
        if ($get('divSearchResults')) $get('divSearchResults').style.visibility = 'hidden';
        if ($get('divSearchLoading')) $get('divSearchLoading').style.display = 'block';
    },
    this.onEndRequest = function(sender, args) {
        if ($get('divSearchResults')) $get('divSearchResults').style.visibility = 'visible';
        if ($get('divSearchLoading')) $get('divSearchLoading').style.display = 'none';
    }
}

function LoadLuterScript() {
    var Load = new SearchLoadingPanelScript();
    Load.initialize();
}

if (Sys) {
    Sys.Application.add_load(function() { LoadLuterScript(); });
    Sys.Application.notifyScriptLoaded();
}

