function nuevoMailAjax(){
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(){
	ay_trans('contentsector','respuestasector');
	clc = document.getElementById('respuestasector');
	//variable=documenet.nombre_del_form.nombre_del_control.value
	nombre=document.email.form_nombre.value;
	empresa=document.email.form_empresa.value;
	cargo=document.email.form_cargo.value;
	telefono=document.email.form_telefono.value;
	email=document.email.form_email.value;
	informacion=document.email.form_informacion.value;

	ajax=nuevoMailAjax();
//	c.innerHTML = '<p style="text-align:center;"><img src="esperando.gif"/></p>'; 
	clc.innerHTML = '<p style="text-align:center;">...</p>'; 
	ajax.open("POST", "ay_enviar.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			clc.innerHTML = ajax.responseText;
		}
		borrarCampos()
	}
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("fnombre="+nombre+"&fempresa="+empresa+"&fcargo="+cargo+"&ftelefono="+telefono+"&femail="+email+"&finformacion="+informacion)
}

function borrarCampos(){
	document.email.form_nombre.value="";
	document.email.form_empresa.value="";
	document.email.form_cargo.value="";
	document.email.form_telefono.value="";
	document.email.form_email.value="";
	document.email.form_informacion.value="";
	document.enviar_email.nombre.focus();
}