// JavaScript Document
function conexion_login()
{
	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 login_ec(f)
{
	var key;
	var usuario='';
	var password='';
	
	if (navigator.appName == "Netscape")//código te tecla netscape
		key=f.which;
	else                                //IE
	key=f.keyCode;
	if (key==13)
	{
		usuario = document.frmLogin.edUsuario.value;
		
			if(usuario=='')
			{
				alert("Captura el usuario");
				document.frmLogin.edUsuario.focus();
				return;
			}
		password = document.frmLogin.edPassword.value;
		
		h = conexion_login();
		h.open("GET","login.php?usuario="+usuario+"&password="+password,true);
		h.onreadystatechange=
		function()
		{
			if (h.readyState==4)
			{
				eval(h.responseText);
			}
		}
		h.send(null);
	}
	
}

function login_ec_2()
{
	usuario = document.frmLogin.edUsuario.value;
	
	if(usuario=='')
	{
		alert("Captura el usuario");
		document.frmLogin.edUsuario.focus();
		return;
	}
	
	password = document.frmLogin.edPassword.value;
	
	h = conexion_login();
	h.open("GET","login.php?usuario="+usuario+"&password="+password,true);
	h.onreadystatechange=
	function()
	{
		if (h.readyState==4)
		{
			eval(h.responseText);
		}
	}
	h.send(null);
}