﻿// JScript File

Type.registerNamespace("ScriptLibrary");
ScriptLibrary.BorderAnimation = function(startColor, endColor, duration) {
    this._startColor = startColor;
    this._endColor = endColor;
    this._duration = duration;
}
ScriptLibrary.BorderAnimation.prototype = {
    animatePanel: function(panelElement) {
        var s = panelElement.style;
        var startColor = this._startColor;
        var endColor = this._endColor;
        s.borderColor = startColor;
        window.setTimeout(
            function() {{ s.borderColor = endColor; }},
            this._duration
        );
    }
}
ScriptLibrary.BorderAnimation.registerClass('ScriptLibrary.BorderAnimation', null);

var panelUpdatedAnimation = new ScriptLibrary.BorderAnimation('blue', 'gray', 5000);
var postbackElement;

Sys.Application.add_load(ApplicationLoadHandler);
function ApplicationLoadHandler() {
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
}

function beginRequest(sender, args) {
    postbackElement = args.get_postBackElement();
    if (typeof(postbackElement) === "undefined") {
        return;
    } 
    //else if (postbackElement.id.toLowerCase().indexOf('animate') > -1) {
        
       var MyElement = document.createElement("<img src='Images/bigrotation2.gif' border=1 width=64 height=64 style= 'BACKGROUND-COLOR: white' >")
       var MyParent =  postbackElement.parentElement;
       MyParent.appendChild(MyElement);
       MyElement.style.display="block"; 
       
       var x = ( document.body.scrollLeft + ( document.body.clientWidth / 2) ) ;
       var y = ( document.body.scrollTop + ( document.body.clientHeight / 2) ) ;
       
       
       MyElement.style.position ="absolute";

       MyElement.style.top = y;
       MyElement.style.left = x;
    

    //}
    
}
function pageLoaded(sender, args) {

}
if(typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();


