﻿// JScript File
/*  
Developed By	: Pooja Verma
Date			: 28 Mar, 2009 
Message			: This js file contain functions to handle ajax feature
*/

    
   function onUpdating(){
        // get the update progress div               
                if($get('hdnChakri').value=="R")
                 {
                var updateProgressDiv = $get('updateProgressDiv'); 
                //$get('divLoader').innerHTML="&nbsp;";
                // make it visible
                updateProgressDiv.style.display = '';

                //  get the ctrl element        
                var ctrl = $get('divLoader');
                ctrl.className="fadin";
                // get the bounds of both the ctrl and the progress div
                var gridViewBounds = Sys.UI.DomElement.getBounds(ctrl);
                var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);
                
                //    do the math to figure out where to position the element (the center of the ctrl)
                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() {
      if($get('hdnChakri').value=="R")
         {
        // get the update progress div
        var updateProgressDiv = $get('updateProgressDiv'); 
        // make it invisible
        updateProgressDiv.style.display = 'none';
         $get('hdnChakri').value="U";
        }
    }


function setchakristatusforcontent()
{
    $get('hdnChakri').value="R";
}
    
function Message()
{
alert('This feature not avaliable at the moment.\r\n We are upgrading our site.\r\n Sorry for all the inconvenience caused.')
return false;
}