var url = "base"; // The server-side script
var url2="info";
function cargando(carga) {

	if (carga) {

		//document.getElementById('center').innerHTML = "Cargando...";

	} else {

		//document.getElementById('center').innerHTML = "";

	}

}

var isWorking = false;

function news(idBase){

	if (!isWorking && http) {

		http.open("GET", url + escape(idBase)+".php", true);

		http.onreadystatechange = function() {

			if (http.readyState == 1) {

				cargando(true);

			} else if (http.readyState == 4) {

				if (http.responseText.indexOf('invalid') == -1) {

					var xmlDocument = http.responseXML;

					var contenido = xmlDocument.getElementsByTagName('seccion').item(0).firstChild.data;

					document.getElementById('center').innerHTML = contenido;

					cargando(false);

					isWorking = false;

				}

			}

		}

		cargando(true);

		isWorking = true;

		http.send(null);

		}

}


function info(idBase){

	if (!isWorking && http) {

		http.open("GET", url2 + escape(idBase)+".php", true);

		http.onreadystatechange = function() {

			if (http.readyState == 1) {

				cargando(true);

			} else if (http.readyState == 4) {

				if (http.responseText.indexOf('invalid') == -1) {

					var xmlDocument = http.responseXML;

					var contenido = xmlDocument.getElementsByTagName('seccion').item(0).firstChild.data;

					document.getElementById('center').innerHTML = contenido;

					cargando(false);

					isWorking = false;

				}

			}

		}

		cargando(true);

		isWorking = true;

		http.send(null);

		}

}


function getHTTPObject() {

var httprequest=false

if (window.XMLHttpRequest){ // if Mozilla, Safari etc

httprequest=new XMLHttpRequest()

if (httprequest.overrideMimeType)

httprequest.overrideMimeType('text/xml')

}

else if (window.ActiveXObject){ // if IE

try {

httprequest=new ActiveXObject("Msxml2.XMLHTTP");

} 

catch (e){

try{

httprequest=new ActiveXObject("Microsoft.XMLHTTP");

}

catch (e){}

}

}

return httprequest



 

}





var http = getHTTPObject(); // We create the HTTP Object

