$(document).ready(function(){
  // Set Forgotten Password event handler
  $('#link-action-forgot').click(toggleForgottenPassword);
  // If using Forgotten Password feature then display form
  if(document.location.href.indexOf('action=forgot') != -1 && $('div.error').length){
    toggleForgottenPassword();
  }
});

function toggleForgottenPassword(){
  $(this).blur();
  $form = $("#frm-forgot-password");
  if($form.length){
    $form.slideFadeToggle();
    $form.find('input:first').focus();
  }
  return false;
}