var httpRequest; 

/*************************************
procesa la informecion recibida
*/
function ajax_updateHTML(data,idFORM,appPHP) 
{ 
     document.getElementById(idFORM).innerHTML = data;
     moreAJAX(appPHP,idFORM);

}

/****************************************
accede al site
*/
function ajax_processRequest(appPHP,idFORM) 
{ 

    if (httpRequest.readyState == 4) 
    { 
        if(httpRequest.status == 200) 
        { 
             ajax_updateHTML(httpRequest.responseText,idFORM,appPHP);
        } 
        else 
        { 
            alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText); 
        } 
    }         
} 


/*****************************************
Define objec httpRequest
*/
function ajax_BVSDE(appPHP,idFORM)
{

    try {
            httpRequest = new XMLHttpRequest();
         } catch (trymicrosoft) {
             try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
              } catch (othermicrosoft) {
                try {
                    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (failed) {
                        httpRequest = false;
              }
            }
          }

    if (!httpRequest)
       alert("Error initializing XMLHttpRequest!");
    else {
        httpRequest.open("GET", appPHP, true);     
        httpRequest.onreadystatechange = function() {ajax_processRequest(appPHP,idFORM); } ; 
        httpRequest.send(null);       
    }
    
}

