﻿  
    
    //*************** 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';
    }

    //*************** menuToggle ********************
    function menuToggle(blk) {
        var theObj
        theObj = document.getElementById(blk);
        theObj.style.display = (theObj.style.display == "block") ? "none" : "block";

        switch (blk) {
            case "quick": document.links("qGInnerDiv").blur(); break;
        }
    }

    //*************** SearchSubmit ********************
 
    if ('' != '') { document.SearchForm.searcharg.value = ''; }
    function SearchSubmit() {
        var inputfield = document.SearchForm.searcharg;
        inputfield.value = trimAll(inputfield.value);
        if (inputfield.value == 'Enter Keyword or Item #' || inputfield.value == '') { inputfield.focus(); return false; }
        
        return true;
    }

    if ('' != '') { document.SearchForm.searchpostings.value = ''; }
    function SearchSubmit() {
        var inputfield = document.SearchForm.searchpostings;
        inputfield.value = trimAll(inputfield.value);
        if (inputfield.value == 'Search...' || inputfield.value == '') { inputfield.focus(); return false; }

        return true;
    }

    function toggleCardManager(showHideDiv, switchImgTag) {
        var ele = document.getElementById(showHideDiv);
        var imageEle = document.getElementById(switchImgTag);
        if (ele.style.display == "block") {
            ele.style.display = "none";
            //imageEle.innerHTML = '<img src="../App_Themes/xxx/Images/mnu-up.gif">';
        }
        else {
            ele.style.display = "block";
            //imageEle.innerHTML = '<img src="../App_Themes/xxx/Images/mnu-up.gif">';
        }
    }    
