/*
   Desc.: Script with misc. functions and execution.
   
   Pre-cond: Prototype lib must have been loaded.
*/

/*
   Desc.: For Ajax loading icon.
   
   Usage: In template file, put the following:
      <div id="idSystemWorking" style="display:none; text-align:center" >
      <?php echo image_tag('ajax-loader.gif') ?>
      </div>
   
*/

var csIdLoadIconJq = "#idSystemWorking"; 

var myGlobalHandlers = {
   onCreate: function(){
      jQuery(csIdDivBg_g).slideUp("fast");
      jQuery(csIdLoadIconJq).slideDown("fast");
      
   },

   onComplete: function() {
      if(Ajax.activeRequestCount == 0){
         jQuery(csIdLoadIconJq).slideUp("fast");
         jQuery(csIdDivBg_g).slideDown("fast");
      }
   }
};

Ajax.Responders.register(myGlobalHandlers);