function calendario(mes,anho) {
	if (!enProceso && http) {
	   var rr = Math.round(Math.random()*1000);
	   
       var url = "/portada/include/calendario.asp?mes="+ mes +"&anho="+ anho +"&rr=" + rr;
	   
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
	return false;
}

function handleHttpResponse() { 
	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; 
            	document.getElementById("calendario").innerHTML = results;
            	enProceso = false;
          	}
       	}
    }
}


function getHTTPObject(){
	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 enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest

