// JavaScript Document
function mostrar(capa){
document.getElementById(capa).style.display='';
}


function httprespuesta() { 
    if (http.readyState == 4) { 
       if (http.status == 200) { 
          if (http.responseText.indexOf('invalid') == -1) {
             // Armamos un array, usando la coma para separar elementos
//             results = http.responseText.split(","); 
             results = http.responseText; 
             document.getElementById('submenu_inferior').innerHTML = results;
             enProceso = false;
          }
       }
    }
}


function submenu(idpadre,capa) {
    if (!enProceso && http) {
       var valor1 = idpadre;
	   var valor2 = capa;
       var url = "submenu.asp?idseccionpadre="+ valor1+"&capa="+valor2;
	   //alert(url);
       http.open("GET", url, true);
       http.onreadystatechange = httprespuesta;
       enProceso = true;
       http.send(null);
    }
}


function getHTTPObject() {
    var xmlhttp;
    /*@cc_on
    @if (@_jscript_version >= 5)
       try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
       } catch (e) {
          try {
             xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) { xmlhttp = false; }
       }
    @else
    xmlhttp = false;
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       try {
          xmlhttp = new XMLHttpRequest();
       } catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest
