

function getDataServer(url, vars){
		 var xml = null;
		 try{
			 xml = new ActiveXObject("Microsoft.XMLHTTP");
		 }catch(expeption){
			 xml = new XMLHttpRequest();
		 }
		 xml.open("GET",url + vars, false);
		 xml.send(null);
		 if(xml.status == 404) alert("Url no valida");
			 
		 return xml.responseText;
	}

    function comprobar2(form)
    {  

	   if (form.username.value=="")
	   {
		   alert("Debe introducir nombre de usuario");
		   form.username.focus();
		   return 0;
	   }

	   if (form.password.value=="")
	   {
			alert("Debe introducir contraseña");
			form.password.focus();
			return 0;
	   }
//       if (form.comunidad.selectedIndex==0){ 
//	       alert("Debe seleccionar su comunidad autónoma de procedencia.") 
//	  	   form.comunidad.focus();
  //         return 0; 
	//   } 


     //   var urldestino = getDataServer("./redir_fecyt.php","?comunidad="+form.comunidad.options[form.comunidad.selectedIndex].value+"&username="+form.username.value+"&password="+form.password.value);
      var urldestino = getDataServer("./redir_fecyt.php","?username="+form.username.value+"&password="+form.password.value);

       form.action=urldestino;
	   form.submit();
    } 
