var obj;
 
function generaPeticion(url) {
  // objecto nativo
 
  if (window.XMLHttpRequest) {
    // Obtener un nuevo objeto
    obj = new XMLHttpRequest();
    // Indicar la funcion de retorno
    obj.onreadystatechange = procesaRespuesta;
    // Método  GET con la url; "true" para asincronica 
    obj.open("GET", url, true);
    // null for GET with native object
    obj.send(null);
  // IE/Windows ActiveX object
  } else if (window.ActiveXObject) {
    obj = new ActiveXObject("Microsoft.XMLHTTP");
    if (obj) {
      obj.onreadystatechange = procesaRespuesta;
      obj.open("GET", url, true);
      obj.send();
    }
  } else {
    alert("Su navegador no soporta AJAX");
  }
}
 function procesaRespuesta() {
    if (obj.readyState == 4) {
        if (obj.status == 200) {
         // Actualiza el contenido apoyándose en el método innerHTML
          document.getElementById('contenido').innerHTML = obj.responseText;
        } else {
          //  alert("Ha ocurrido un problema en el retorno de datos");
        }
    }
}




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 cargarContenido(){
var t11, t12, contenedor;

contenedor = document.getElementById('contenido2');
name = document.getElementById('name').value;
email = document.getElementById('email').value;
company = document.getElementById('company').value;
country = document.getElementById('country').value;
telephone = document.getElementById('telephone').value;
chose = document.getElementById('chose').value;
comments = document.getElementById('comments').value;
ajax=nuevoAjax();
ajax.open("GET", "contactenos.php?name="+name+"&email="+email+"&company="+company+"&country="+country+"&telephone="+telephone+"&chose="+chose+"&comments="+comments,true);
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
contenedor.innerHTML = ajax.responseText
}
}
ajax.send(null)
} 