function Ajax(){
	//Crear una variable de Bool para comprobar si existe Internet Explorer.
	var xmlhttp = false;
	
	//Comprobar si se está usando IE.
	try {
		//Si la versión de javascript es superior a la 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		//Si no, utilizar el tradicional objeto ActiveX.
		try {
			//Si se está usando Microsoft.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			//En caso contrario no debe estar usándose IE.
			xmlhttp = false;
		}
	}
	
	//Si no estamos usando IE, crear una versión javascript del objeto.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function makerequest(pagina,objID) {
	ajax=Ajax();
	// mostrar mensaje de cargando
	showLoadMsg(objID)
	var obj = document.getElementById(objID);
	ajax.open("GET", pagina);
	ajax.onreadystatechange = function() {
		if (ajax.readyState == 4 && ajax.status == 200) {
			obj.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}

// funcion para mostrar mensaje de cargando
function showLoadMsg(objID){
	var obj = document.getElementById(objID);
	obj.innerHTML="Cargando...";
}
