function ticker_bolsa() {
	if (!enProceso2 && http) {
	   var aleat = Math.round(Math.random()*1000);
	   
       var url = "/include/ticker_bolsa.asp?aleat=" + aleat;
	   
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse2;
       enProceso2 = true;
       http.send(null);
    }
	return false;
}

function handleHttpResponse2() { 
	if (http.readyState == 4) { 
		if (http.status == 200) { 
			if (http.responseText.indexOf('invalid') == -1) {
            	results = http.responseText; 
            	document.getElementById("ticker_bolsa_ajax").innerHTML = results;
            	enProceso = false;
          	}
       	}
    }
}


function getHTTPObject2(){
	var xmlhttp=false; 
/* Compatibilidad con FireFox, Opera y cualquier otro BUEN navegador */
	if(typeof(XMLHttpRequest) != 'undefined'){
    	try{
      		var xmlhttp = new XMLHttpRequest();
    	}
    	catch(e){ }
  	}else{
    /* Compatibilidad para el navegador más ASQUEROSO del planeta [ IE ] */
    	try{
      		var xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
    	}
    	catch(e){
      		var xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
    	}
  	}
  	return xmlhttp;
}



var enProceso2 = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject2(); // Creamos el objeto XMLHttpRequest
