function getRequestObject() {
	var	thing;
	if (typeof XMLHttpRequest != "undefined") {
		try {
			thing = new XMLHttpRequest();
		} catch (e) {
// alert("error from new XMLHttpRequest: " + e)
			thing = false;
		}
	} else {
		try {
			thing = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				thing = new ActiveXObject('MSXML2.XMLHTTP.3.0');
			} catch (E) {
				thing = false;
			}
		}
	}
	return thing;
}


var div_to_load;

function handleReadyStateChange() {
	if (req.readyState == 4) {
		if (div_to_load) {
//			alert("writing new content to " + div_to_load + "...");
			if (req.status == 200) {
				txt=unescape(req.responseText);
				txt2=txt.replace(/\+/gi," ");
				document.getElementById(div_to_load).innerHTML = txt2;
			} else {
				alert("error loading content: status=" + req.status + " : " + req.statusText);
			}
		} else {
			alert("no id in div_to_load");
		}
	}
}

var req = getRequestObject();

function loadDivContent(divid, url) {
//	alert("try to load content into div " + divid + " for " + url);
	if (req) {
		//alert("do it dynamically and stuff");
		div_to_load = divid;
		req.open("post", url );
		req.onreadystatechange = handleReadyStateChange;
		req.send(null);
	} else {
		//alert("reload browser like in olden days");
		window.location = url ;
	}
}

// old - make this go away
function loadNewContent(url) {
	loadDivContent('contenedor_cuerpo', url);
}

