var ta = jQuery("#comment");
jQuery("a.comment-reply-link").click(function() {
  if (ta) {
    var no = jQuery(this).parent().children("span").text();
    var author = jQuery(this).parent().find("strong").text();
    var str = '@' + author + '(' + no + ')\n';
    ta.val(ta.val() + str);
    ta.focus();
  }
  return false;
});
jQuery("a.comment-quote-link").click(function() {
  if (ta) {
    var no = jQuery(this).parent().children("span").text();
    var author = jQuery(this).parent().find("strong").text();
    var comment = jQuery.trim(jQuery(this).parent().next("div.comment-text").html());
    comment = comment.replace(/<([^>]+)>/g, function($0, $1) {
      return '<' + $1.toLowerCase().replace(/^br$/, 'br /') + '>';
    });
    var str = '<blockquote>' + no + ' <strong>' + author + ':</strong> ' + comment + '</blockquote>\n';
    ta.val(ta.val() + str);
    ta.focus();
  }
  return false;
});