// JavaScript Document

<!--

var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->

// Evento de inicio de petición de AJAX
  function InitializeRequest(sender, args) 
  {
    try
    {
    	alert('empieza');
        document.body.style.cursor = 'wait';
        var element = $get(args._postBackElement.id);
        if (element != null)
            element.disabled = true;
        //$get('Container').style.cursor = 'wait'; 
        
        // Problemática con fieldset, modificamos style.cursor de fieldset explicitamente
        elementos=document.getElementsByTagName('fieldset');
        if (elementos != null)
        {
            for (i=0; i<elementos.length;i++)
                elementos[i].style.cursor= 'wait';
        }
    }
    catch(err)
    {
        alert("Error InitializeRequest: " + err.description);
    } 
  }
  
  
  // Evento de fin de petición de AJAX
  function EndRequest(sender, args) 
  {
    try
    {
    alert('termina');
        document.body.style.cursor = 'auto';
        var element = $get(sender._postBackSettings.sourceElement.id);
        if (element != null)
            element.disabled = false;
        //$get('Container').style.cursor = 'auto';
        
        // Problemática con fieldset, modificamos style.cursor de fieldset explicitamente
        elementos=document.getElementsByTagName('fieldset');
        if (elementos != null)
        {
            for (i=0; i<elementos.length;i++)
                elementos[i].style.cursor= 'auto';
        }
    }
    catch(e){}
  }
