var xmlHttp;
if (window.XMLHttpRequest) {
	xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} else { alert("XMLHttpRequest ERROR");
}
function AjaxLoad(ITEM,URL,EXEC) {
	document.getElementById(ITEM).innerHTML="";
	document.getElementById(ITEM).className="AjaxLoading";
	xmlHttp.open("GET",URL);
	xmlHttp.onreadystatechange = function() {
//		alert(xmlHttp.status); // activar para debugging
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			document.getElementById(ITEM).innerHTML=xmlHttp.responseText;
			document.getElementById(ITEM).className=null;
			// esto permite ejecutar javascript después de la carga de Ajax
			if(EXEC>0) {
				ExecCode=document.getElementById("AjaxExecJS").innerHTML;
				ExecCode=ExecCode.replace(/&lt;/g,"<");
				ExecCode=ExecCode.replace(/&gt;/g,">");
				setTimeout(ExecCode,EXEC*100);
			}
		}
	}
	xmlHttp.send(null);
}

