function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
  try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (err2) {
    try {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (err3) {
      req = false;
    }
  }
}
return req;
}

var http = getXMLHTTPRequest();


function enviarCorreo(){
	var nombre = document.form1.nombre.value;
	var correo = document.form1.correo.value;
	var mensaje = document.form1.mensaje.value;
	var myurl = 'enviarCorreo.php';
	var modurl = myurl+"?nombre="+nombre+"&correo="+correo+"&mensaje="+mensaje;
	http.open("GET", modurl, true);
	http.onreadystatechange = useHttpResponse;
	http.send(null);
}

function formIntranet(opcion){
	var opcion = opcion;
	var myurl = 'varValorados.php';
	myRand = parseInt(Math.random()*99999999999999999);
	var modurl = myurl+"?rand="+myRand+"&opcion="+opcion;
	http.open("GET", modurl, true);
	http.onreadystatechange = useHttpResponse;
	http.send(null);
}

function useHttpResponse() {
   if (http.readyState == 4) {
    if(http.status == 200) {
		
	   var timeValue = http.responseText;
	   document.getElementById('formulario').innerHTML = timeValue;
    	
	}
  } else {
  document.getElementById('formulario').innerHTML = 'Cargando...';
  }
}
function popup(URL,ancho,alto){
var top=(screen.availHeight-alto)/2
var left=(screen.availWidth-ancho)/2
window.open(URL,"Ventana","width="+ancho+",height="+alto+",scrollbars=1,resizable=1,top="+top+",left="+left+"")
}