function initLostPassword()
{
 jQuery('#lostpassword').submit(
    function()
    {
      jQuery.ajax(
        {
          url: this.action,
          type: 'POST',
          data: $('#lostpassword').serialize(),
          success: function(i){ jQuery('#lostpassword').replaceWith(i);initLostPassword();}
        }
      ); return false;
    });
}

jQuery(document).ready(function(){
  $('#identification_box')
    .prependTo($('#hd'))
    .addClass('jqmWindow')
    .jqm({ zIndex: 9000, trigger: 'a.signin_trigger' })
    .prepend('<a href=\"#\" class=\"jqmClose deconnexion\">&nbsp;</a>');
    $('.signin_trigger').css('display', 'inline');

  $('.forgot-password').click(
    function()
    {
      $.ajax({
        url: this.href,
        success: function(r)
                 {
                   $('#identification_box').html(r);
                   initLostPassword();
                 }
              });
      return false;
  });

  initLostPassword();
});
