jQuery(function($){
  var m, pos = location.hash;

  $('.my-translation p:has(span), .my-translation h3 span[id]').hide();
  $('.my-translation p:visible, .my-translation h3 span:visible')
      .append($('<em class="show-en" alt="原文表示切り替え">[+en]</em>'));
  
  var emText = { "[+en]":"[-en]", "[-en]":"[+en]" };
  $('em.show-en').click(function() {
          var em = $(this);
          em.text(emText[em.text()]);
          em.parent().prev().toggle();
      });

  if(/^#line-[0-9]+$/.exec(pos)) {
      $(pos).css('background-color', '#FFEE2E')
          .parent().next().children('em.show-en').click();
  }
});

