// JavaScript Document

var url = "php/enviar_contacta.php?";  
var http = getXmlHttpObject(); 

function handleHttpResponse(){ 
    if (http.readyState == 1){ 
        document.getElementById('texto').innerHTML = "Enviando Mensaje..."; 
    } 
    if (http.readyState == 4){ 
        results = http.responseText; 
        document.getElementById('texto').innerHTML = results; 
    } 
} 


function sendQuerystring(){ 
//    alert(url+document.getElementById('Empresa').value+"&PersonaContacto="+document.getElementById('PersonaContacto').value+"&Direccion="+document.getElementById('Direccion').value+"&Poblacion="+document.getElementById('Poblacion').value+"&Telefono="+document.getElementById('Telefono').value+"&Fax="+document.getElementById('Fax').value+"&Email="+document.getElementById('Email').value+"&Consulta="+document.getElementById('Consulta').value);
    http.open("GET", url+"PersonaContacto="+document.getElementById('Personacontacto').value+"&Referencia="+document.getElementById('Referencia').value+"&Direccion="+document.getElementById('Direccion').value+"&Poblacion="+document.getElementById('Poblacion').value+"&Telefono="+document.getElementById('Telefono').value+"&Fax="+document.getElementById('Fax').value+"&Email="+document.getElementById('Email').value+"&Consulta="+document.getElementById('Consulta').value, true); 
    http.onreadystatechange = handleHttpResponse; 
    http.send(null); 
} 

function getXmlHttpObject(){ 
    var xmlhttp; 

    /*@cc_on 
    @if (@_jscript_version >= 5) 
    try{ 
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } 
    catch (e){ 
    try{ 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } 
    catch (e){ 
    xmlhttp = false; 
    } 
    } 
    @else 
    xmlhttp = false; 
    @end @*/ 

    if (!xmlhttp && typeof XMLHttpRequest != 'undefined'){ 
        try{ 
            xmlhttp = new XMLHttpRequest(); 
        } 
        catch (e){ 
            xmlhttp = false; 
        } 
    } 
    return xmlhttp; 
} 
