var http_request = false;
var codigo_proceso=0;


    function makeRequest(url,cmd) {
	codigo_proceso=cmd    
	//http_request = objetus();
	
	http_request =nuevoAjax()
	
        if (!http_request) {
            alert('Falla :( No es posible crear una instancia XMLHTTP');
            return false;
        }
       
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, true);
        http_request.send(null);

    }


function objetus() {
         try {
                 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         } catch ( e) {
                 try { 
                         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
                 } catch (E) {xmlhttp = false;} 
         }
         
        if (! objetus && typeof XMLHttpRequest!= 'undefined') {
                 xmlhttp = new XMLHttpRequest(); 
        } 
        return xmlhttp 
}


function nuevoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}


    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
               ajax_recibe(http_request);
               
            } else {
                alert('Hubo problemas con la petición.');
            }
        }

    }
