function recoverPassword() {
	$jq('#rp_messages').hide();
	$jq('#curtain').show();
	$jq('#recoverPasswordContainer').show();
}

function rpClose() {
	$jq('#curtain').hide();
	$jq('#recoverPasswordContainer').hide();
}

function rpAccept() {
	if(isEmpty('rp_username')) {
		return error('rp_username', errstr[0]);
	}
	
	$jq('#rpCancel').hide();
	$jq('#rpAccept').hide();
	
	// muestra mensaje de espera...
	var waiting = $jq('#rp_messages_strings').attr('waiting');
	$jq("#rp_messages_strings").html(waiting);
	$jq('#rp_messages').show();
	
	var username = $jq('#rp_username').val();
	var server   = $jq('#prod_server').attr('server');
	
	$jq.getJSON(
		server,
		{
			action:   "sendPassword",
			username: username
		},
		function (result) {
			//alert("JSON Data: " + result);
			
			$jq('#rpCancel').show();
			$jq('#rpAccept').show();
			
			
			
			if (1 == result) {
				var ok = $jq('#rp_messages_strings').attr('ok');
				$jq("#rp_messages_strings").html('<b>'+ok+'</b>');
				setTimeout("rpClose()", 3000);
			} else {
				if (0 == result) {
					var fail = $jq('#rp_messages_strings').attr('fail');
				} else {
					var fail = $jq('#rp_messages_strings').attr('error');
				}
				
				$jq("#rp_messages_strings").html('<b>'+fail+'</b>');
			}
		}
	);
}
