function elfoco1() {
    _objRutt = document.getElementById("ctl00_Cphlogin_txt_Cuenta");
    _objRutt.focus();
}

function validar_acceso() {

    _objRut = document.getElementById("ctl00_Cphlogin_txt_Cuenta");
    _objclave = document.getElementById("ctl00$Cphlogin$txtpassword");

    _objHdRut = document.getElementById("hdfRut");

   // _objHdRut = document.getElementById("ctl00_hdfRut");
   
    _objHdRut.value = _objRut.value;
    
     return true;
}

function validar_acceso_enter()
{
 if (event.keyCode == 13)
 { 
	if (document.frmFormulario1.txt_Cuenta.value == "" || document.frmFormulario1.txt_Cuenta.value.length <= 0)
		{
		alert("Debe ingresar su cuenta");
		document.frmFormulario1.txt_Cuenta.focus();
		return false;
		}
	if (document.frmFormulario1.txt_pwd.value == "" || document.frmFormulario1.txt_pwd.value.length <= 0)
		{
		alert("Debe ingresar su contraseņa");
		document.frmFormulario1.txt_pwd.focus();
		return false;
		}
		idcliente = document.frmFormulario1.txt_Cuenta;
		password  = document.frmFormulario1.txt_pwd;
		ajax_valida_acceso(idcliente,password)
 }	
//document.frmFormulario1.submit();

}

// ---------------------------------------------------------------------------------------------
function recupera_password()
{
	var rut, pagina
	var Estado = 0;

	if  (document.frmFormulario1.txt_Cuenta.value == "" && Estado == 0) {	
		alert("Debe ingresar su usuario");
	    document.frmFormulario1.txt_Cuenta.focus();
		Estado = 1;
        }	
	
	if (Estado == 0) {
		RespuestaDigitada = '';
		idcliente = document.frmFormulario1.txt_Cuenta;
		ajax_recupera_datos_acceso(idcliente)
			
	}
}

function valida_respuesta()
{
	objRespuesta = document.frmFormulario.txtRespuestaSecreta;
	objCampo	 = document.frmFormulario.txtCampo;
	if  (objRespuesta.value == "") {	
		alert("Debe ingresar su respuesta.");
	    objRespuesta.focus();
		return;
        }	
	
	if (objRespuesta.value != objCampo.value) {
		alert("La respuesta es incorrecta.");
	    objRespuesta.focus();
		return;
	}

	if (objRespuesta.value = objCampo.value) {
		//alert("La respuesta es correcta.");
		document.frmFormulario.submit();
	}
}




    




