// This file contains methods that can be used in changing the cursor to indicate that some 
// Processing is going on and to prevent re submission of process that has already been submitted.

/*Flag to indicate that some processing is going on*/

var processing = 0 ;

 
function isProcessing() {
   /*Check to see if the form has been submitted previously*/
   if (processing != 0) {
      //alert("Processing, please wait.") ;
      return true ;
   }
   return false ;
}

function setProcessingOn() {
   if (isProcessing()) return false ;
   processing = 1 ;
   setPointer() ;
   return true;
}

function setProcessingOff() {
   processing = 0 ;
   resetPointer() ;
   return true;
}

function setPointer() { 
   if (window.frames.length > 0) {
      for (var i=0;i < window.frames.length; i++) {
         if (window.frames[i].document.all) {     
            for (var j=0;j < window.frames[i].document.all.length; j++) {    
               window.frames[i].document.all(j).style.cursor = 'wait'; 
            }
         }
      }
   }
}

function resetPointer() { 
   if (window.frames.length > 0) {
      for (var i=0;i < window.frames.length; i++) {
         if (window.frames[i].document.all) {     
            for (var j=0;j < window.frames[i].document.all.length; j++) {    
               window.frames[i].document.all(j).style.cursor = 'auto'; 
            }
         }
      }
   }
}
