function nuevoAjax(){
var xmlhttp=false;
 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 enviar(){
	c = document.getElementById('denuncia');
	den=document.formulario.den.value;
	dir=document.formulario.dir.value;
	
	ajax=nuevoAjax();
	c.innerHTML = 'Enviado...';
	ajax.open("POST", "proceso_denuncias.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			c.innerHTML = ajax.responseText
		}
		clearCampos()
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("den="+den+"&dir="+dir)
}

function clearCampos(){
	document.formulario.den.value="";
	document.formulario.dir.value="";
	document.formulario.den.focus();
}
