function nuevoAjax(){ 
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
	lo que se puede copiar tal como esta aqui */
	var xmlhttp=false; 
	try{ 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e){ 
		try{ 
			// Creacion del objet AJAX para IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E){
			xmlhttp=false; 
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined'){
		xmlhttp=new XMLHttpRequest(); 
	} 
	return xmlhttp; 
}
function createRequest(){
	var httpRequest = null;
	if(window.XMLHttpRequest){
		httpRequest = new XMLHttpRequest();
		if(httpRequest.overrideMineType){
			httpRequest.overriderMineType('text/xml');
		}
	} else if(window.ActiveXObject){
				try{
					httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
				}catch(e) {
					try{
						httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e) {}
				}
	}
	return httpRequest;
}

function carga_calendario(dia,mes,ano){
	var capa=document.getElementById("apDiv9");
	var ajax=nuevoAjax();
	capa.innerHTML="<img src='images/bigrotation2.gif' alt='Cargando...'>";
	ajax.open("POST", "classes/calendario.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("dia="+dia+"&mes="+mes+"&ano="+ano);
	ajax.onreadystatechange=function(){
		if (ajax.readyState==4){
			// Respuesta recibida. Coloco el texto plano en la capa correspondiente
			capa.innerHTML=ajax.responseText;
		}	
	}
}
function cargaNoticia(pag){
	var capa=document.getElementById("apDiv11");
	var ajax=nuevoAjax();
	capa.innerHTML="<img src='images/bigrotation2.gif' alt='Cargando...'>";
	ajax.open("POST", "index.php", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("pag="+pag);
	ajax.onreadystatechange=function(){
		if (ajax.readyState==4){
			// Respuesta recibida. Coloco el texto plano en la capa correspondiente
			capa.innerHTML=ajax.responseText;
		}	
	}
}