function Cortines_get_xmlhttp() {
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
    try {
     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
     xmlhttp = false;
    }
   }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp
}

function Cortines_enviar(xmlhttp,metodo,url,async,callback) {
 xmlhttp.open(metodo, url,async);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
   callback(xmlhttp)
  }
 }
 xmlhttp.send(null)
}

function Cortines_XMLHttpRequest(Cortines_link) {
	xmlhttp=Cortines_get_xmlhttp()
	Cortines_enviar(xmlhttp,"POST",Cortines_link,true,Cortines_recibirRespuesta);
}

function Cortines_recibirRespuesta(xmlhttp) {
	val=""
	for(i in xmlhttp) {
		try {
		val+="xmlhttp."+i+"="+xmlhttp[i]+"\n"
		} catch(e) {}
	}
	if(xmlhttp.status==404) { alert("Esta pagina no existe")};
	document.getElementById("ai2").innerHTML=xmlhttp.responseText;
}
function Cortines_XMLHttpRequest2(Cortines_link) {
	xmlhttp=Cortines_get_xmlhttp()
	Cortines_enviar(xmlhttp,"POST",Cortines_link,true,Cortines_recibirRespuesta2);
}

function Cortines_recibirRespuesta2(xmlhttp) {
	val=""
	for(i in xmlhttp) {
		try {
		val+="xmlhttp."+i+"="+xmlhttp[i]+"\n"
		} catch(e) {}
	}
	if(xmlhttp.status==404) { alert("Esta pagina no existe")};
	document.getElementById("ai2").innerHTML=xmlhttp.responseText;
}


