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');
   
       //variable=documenet.nombre_del_form.nombre_del_control.value
       nom=document.enviar_email.nombre.value;
       empresa=document.enviar_email.empresa.value;
       email=document.enviar_email.email.value;
	   tel=document.enviar_email.telefono.value;
	   cot=document.enviar_email.cotizar.value;

	   anti=document.enviar_email.anti.value;
	   hidden=document.enviar_email.hidden.value;
   
       ajax=nuevoAjax();
       c.innerHTML = '<p style="text-align:center;"><img src="javascript/loader.gif"/></p>'; 
       ajax.open("POST", "envia_mail2.php",true);
       ajax.onreadystatechange=function() {
       if (ajax.readyState==4) {
		   
       c.innerHTML = ajax.responseText
       }
       borrarCampos()
       }
       ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
       ajax.send("nombre="+nom+"&empresa="+empresa+"&email="+email+"&tel="+tel+"&cot="+cot+"&antispam="+anti+"&hidden="+hidden)
}
function borrarCampos(){
      
       document.enviar_email.anti.value="";
       document.enviar_email.anti.focus();
}