var xmlhttp;
var elementId;

function cedulas(id, id2)
{
elementId=id;
loadProcessing(id2);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="db/cedulas_para_entregar.php";
//url=url+"?fecha_nacimiento="+document.getElementById('fechanaci_act').value;
url=url+"?cedula="+document.getElementById('cedula_act').value;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
// wait 3 seconds
setTimeout(function(){xmlhttp.send(null);},2000);
//xmlhttp.send(null)
clearSection(id2);
}



function stateChanged()
{
if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
{
//	alert(elementId);
	document.getElementById (elementId).innerHTML=xmlhttp.responseText;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

function clearSection(element){
	document.getElementById (element).innerHTML="";
}

function loadProcessing(id2){
	document.getElementById (elementId).innerHTML="<p align=\"center\"><img src=\"images/ajax-loading-graphics/globe64.gif\" width=\"64\" height=\"64\" /><br />Procesando. . .</p>";
}
