var peticion = false; 
var  testPasado = false; 
try { 
  peticion = new XMLHttpRequest(); 
  } catch (trymicrosoft) { 
  try { 
  peticion = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (othermicrosoft) { 
  try { 
  peticion = new ActiveXObject("Microsoft.XMLHTTP"); 
  } catch (failed) { 
  peticion = false; 
  } 
  } 
} 
if (!peticion) 
alert("ERROR AL INICIALIZAR!"); 
  
function validarlogin (url, usuario, pass, element_id) { 
    var element =  document.getElementById(element_id); 
    var valordepende = document.getElementById(usuario) 
    var valordependepass = document.getElementById(pass) 
	var x = valordepende.value 
    var y = valordependepass.value
	var fragment_url = url+'?usuario='+x+'&pass='+y;
//alert(fragment_url = url+'?usuario='+x+'&pass='+y);
element.innerHTML = '<div align="center"><img src="imagenes/loading.gif" /></div>'; 
    peticion.open("GET", fragment_url); 
    peticion.onreadystatechange = function() { 
        if (peticion.readyState == 4) { 

element.innerHTML = peticion.responseText; 
        } 
    } 
   peticion.send(null); 
} 
