<script type="text/javascript">


<?php

?>




if($('#user_password').val() != ''){
  $('#user_password').val('<?php echo $user->getOpenPassword();?>');
  //$('#user_password').prop('placeholder', 'Скрыт');
}

var check_email = function(){
  $('#_send_password_id').css('visibility', ($('#user_email').val().indexOf('@') != -1 ? 'visible' : 'hidden'));
}
check_email();

$('#_send_password_id input').click(function(){
  $('.lui_form_layer form').append('<input type="hidden" name="_send_password" value="1" />');
});

$('#user_email').keyup(function(){
  check_email();
});

var gen_pass_btn = $('<button style="position:relative;left:5px;top:-1px;">Сгенерировать</button>');

$('#user_password').after(gen_pass_btn);

gen_pass_btn.click(function(){
  $('#user_password').val(PassGenJS.getPassword({letters: 0, lettersUpper: 0, numbers: 6}));
  return false;
});
</script>