﻿  
    
    //*************** Loading Animation ********************
    function onUpdating(myControl, myDiv){
        // get the update progress div
        //var updateProgressDiv = $get('updateProgressDiv'); 
        var updateProgressDiv = $get(myDiv); 

        //  get the gridview element        
        //var gridView = $get('<%= this.GridViewWithPager1.ClientID %>');
        var gridView = $get('<%= this.' + myControl + '.ClientID %>');
        
        // make it visible
        updateProgressDiv.style.display = '';        
        
        // get the bounds of both the gridview and the progress div
        var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
        var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);
        
        //  center of gridview
        var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
        var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);        

        //    set the progress element to this position
        //Sys.UI.DomElement.setLocation (updateProgressDiv, x, y);           
    }

    function onUpdated() {
        // get the update progress div
        var updateProgressDiv = $get(myDiv); 
        // make it invisible
        updateProgressDiv.style.display = 'none';
    }
    
    //*************** Collapse ******************** 
    //toggle images

    img = new Array;
    img[1] = new Image(); img[1].src = "/App_Themes/General/Images/mnu-up.png";
    img[2] = new Image(); img[2].src = "/App_Themes/General/Images/mnu-down.png";

    function swapPic(t) {

        if (t!=null){
            var imgx = eval("document." + t);	
            if (imgx.src == img[1].src) {imgx.src = img[2].src;}
            else {imgx.src = img[1].src;}
        }
    }

    // toggle menu
    function menuToggle(blk)
    {
        var theObj
        theObj = document.getElementById(blk);		
        theObj.style.display = (theObj.style.display == "block") ? "none" : "block";
    }

    //*************** Hide Status Bar ******************** 
    // 
    
    function hidestatus(){
        window.status=''
        return true
        }

        if (document.layers)
        document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

        document.onmouseover=hidestatus
        document.onmouseout=hidestatus