function fn_BloquearBotones ()
{
	document.getElementById ("tablaExterior").style.cursor = 'wait';
	
	document.frm_Datos.btn_Confirmar.style.cursor = 'wait';
	document.frm_Datos.btn_Confirmar.disabled = true;

	document.frm_Datos.btn_Volver.style.cursor = 'wait';
	document.frm_Datos.btn_Volver.disabled = true;
}

function fn_HabilitarBotones ()
{
	document.frm_Datos.btn_Confirmar.style.cursor = 'pointer';
	document.frm_Datos.btn_Confirmar.disabled = false;

	document.frm_Datos.btn_Volver.style.cursor = 'pointer';
	document.frm_Datos.btn_Volver.disabled = false;

	document.getElementById ("tablaExterior").style.cursor = 'default';		
}

function fn_ValidarIngreso ()
{
	var formulario = document.frm_Datos;		

	if (trim (formulario.txt_Usuario.value) == "")
	{
		alert ("Debe ingresar su nickname.");
		formulario.txt_Usuario.focus ();
		return false;
	} 
	if (trim (formulario.txt_Email.value) == "")
	{
		alert ("Debe ingresar su e-mail.");
		formulario.txt_Email.focus ();
		return false;
	}		
	if (fn_ValidarEmailValido (formulario.txt_Email.value, false) == false)
	{
		alert ("El e-mail ingresado es inv" + String.fromCharCode (225) + "lido.");
		formulario.txt_Email.focus ();
		return false;
	}		
	
	return true;
}

function fn_Confirmar ()
{
	var formulario = document.frm_Datos;		

	if (fn_ValidarIngreso ())
	{
		fn_BloquearBotones ();

		formulario.txt_HacerConfirmar.value = "-1";
		
		document.body.onbeforeunload = "";
		formulario.action = "recuperar_procesar.php";
		formulario.target = "iframeSubmit";
		formulario.submit ();
	}
}

function fn_KeyPress (evento)
{
	if (!evento)
		var evento = window.event;

	if (evento.keyCode == 13)
		fn_Confirmar ();
}

function fn_RecuperacionOk ()
{
	fn_BloquearBotones ();
	window.location.href = "./recuperar_ok.php?" + document.frm_Datos.txt_QueryString.value;
}

function fn_UsuarioInexistente ()
{
	alert ("No existe ning" + String.fromCharCode (250) + "n usuario registrado con el nickname y el e-mail ingresados.");
	document.frm_Datos.txt_Usuario.focus ();
}

function fn_ErrorEnvioMail ()
{
	alert ("Se produjo un error al enviar su contraseņa por e-mail.");
}

function fn_Volver ()
{
	fn_BloquearBotones ();
	window.location.href = document.frm_Datos.txt_DestinoRetorno.value;
}
