//PURPOSE OF FILE:- This file has two function cursor_wait() and cursor_default()
//                  This two functions are used to change the cusror style and 
//                  enable/disable all the controls in the page
 
 
 
/***********************************************************************************************************/
//DESCRIPTION:-It changes the cursor style to wait and disables all the controls
/***********************************************************************************************************/
var browserName=navigator.appName;
function cursor_wait()
    {
        if (document.all) for (var i=0;i < document.all.length; i++) document.all(i).style.cursor = 'wait';

         document.body.style.cursor="wait";      
        if (browserName == 'Microsoft Internet Explorer')
        {

 
            //Disables all the INPUT Controls
            for(i=0;i<document.all.tags('INPUT').length;i++)
            {          
                 var io = document.all.tags('INPUT')[i];      
                 //Make sure you are not working with hidden INPUTS
                 if(io.type != 'hidden')
                 {
                      io.disabled=true;
                      io.style.cursor ="wait";
                 }
           }
          for(i=0;i<document.all.tags('SELECT').length;i++)
          {          
                 var select = document.all.tags('SELECT')[i];        
                 //Make sure you are not working with hidden INPUTS
                 if(select.type != 'hidden')
                 {
                      select.disabled=true;
                      select.style.cursor ="wait";
                 }
 
           }
 
            //Disables all the HyperLink Controls
            for(i=0;i<document.all.tags('a').length;i++)
            {          
 
                 var io = document.all.tags('a')[i]; 
                 //Make sure you are not working with hidden Links
 
                 if(io.type != 'hidden')
                 {
                       io.disabled=true;
                       io.style.cursor ="wait";
                 }
 
              }
          }    
              
}
  
 
function cursor_default()
    {
        if (document.all) for (var i=0;i < document.all.length; i++) document.all(i).style.cursor = 'default';
 document.body.style.cursor="default"; 
 
   if (browserName == 'Microsoft Internet Explorer')
        {
         
     
            for(i=0;i<document.all.tags('INPUT').length;i++)
                {          
                     var io = document.all.tags('INPUT')[i];      
                     //Make sure you are not working with hidden INPUTS
                     if(io.type != 'hidden')
                     {
                          io.disabled=false;
                          io.style.cursor ="text";
                     }
                    if (io.type=='submit')
                   {
                        io.style.cursor ="default";
                    }
               }
              for(i=0;i<document.all.tags('SELECT').length;i++)
              {          
                     var select = document.all.tags('SELECT')[i];        
                     //Make sure you are not working with hidden INPUTS
                     if(select.type != 'hidden')
                     {
                          select.disabled=false;
                          select.style.cursor ="default";
                     }
     
               }
     
                //Disables all the HyperLink Controls
                for(i=0;i<document.all.tags('a').length;i++)
                {          
     
                     var io = document.all.tags('a')[i]; 
                     //Make sure you are not working with hidden Links
     
                     if(io.type != 'hidden')
                     {
                           io.disabled=false;
                           io.style.cursor ="hand";
                     }
     
                  }
             }     
 
    }
