$(document).ready(function() {
  $('.account_input').focus(function() {
    var $el = $(this);
    if ($el.hasClass('no_value')) {
      $.data(this, 'oldValue', $el.val());
      $el.val('').removeClass('no_value');
      if ($el.attr('id') == 'passwd') {
        var $newEl = $el.clone(true);
        $newEl.attr('type', 'password');
        $el.replaceWith($newEl);
        $newEl.focus();
      }
    }
  }).blur(function() {
    var $el = $(this);
    if ($el.val() == '') {
      $el.val($.data(this, 'oldValue'));
      $el.addClass('no_value');
      if ($el.attr('id') == 'passwd') {
        var $newEl = $el.clone(true);
        $newEl.attr('type', 'text');
        $el.replaceWith($newEl);
        $newEl.blur();
      }
    }
  });
});
