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 enviarMail(){
	c = document.getElementById('resultado_mensaje');
	
	//aca seteo el email destino
	mailto=document.enviar_email.mail.value;
	nombre=document.enviar_email.nombre.value;
	msj=document.enviar_email.mensaje.value;

	
	ajax=nuevoAjax();
	c.innerHTML = '<img src="/_img/ajax_mail/waiting.gif" alt="" />'; 
	ajax.open("POST", "_includes/send_contactmail.php?token=e09f6a7593f8ae3994ea57e1117f67ec",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			c.innerHTML = ajax.responseText
		}
		borrarCampos()
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//mando por POST el mailto o sea el EMAIL 
	ajax.send("mail="+mailto+"&nombre="+nombre+"&mensaje="+msj)
}

function borrarCampos(){

//	document.enviar_email.mail.value="";
}
