jQuery(document).ready( function($) {
  if ( $('#submitdiv').length ) {
    stamp = $('#timestamp').html();
    $('#timestampdiv')
      .before('<p><a class="update-timestamp hide-if-no-js button" href="#update_timestamp">現在の日時</a></p>')
      .prev().click(function(){
        date = new Date();
        var aa = date.getFullYear(), mm = date.getMonth() + 1, jj = date.getDate(), hh = date.getHours(), mn = date.getMinutes();
        mm = '' + mm;
        if(mm.length == 1) mm = '0' + mm;
        $('#aa').val(aa);
        $('#mm').val(mm);
        $('#jj').val(jj);
        $('#hh').val(hh);
        $('#mn').val(mn);
        $('#timestamp').html(
          postL10n.publishOnPast + ' <b>' +
          aa + '年' +
          mm + '月' +
          jj + '日 @ ' +
          hh + ':' +
          mn + '</b> '
        );
	return false;
      });
  }
});
