function replyComment(strCommentId) {
    strNickName = $.trim($('#nick_'+strCommentId).text());
    
    if($.trim($('#commbody').text()) == ""){
        $('#commbody').text('[@'+strNickName+':]('+window.location.protocol+'//'+window.location.hostname+window.location.pathname+'#c'+strCommentId+') ');
    }
    else {
        $('#commbody').append('\n\n[@'+strNickName+':]('+window.location.protocol+'//'+window.location.hostname+window.location.pathname+'#c'+strCommentId+') ');
    }
    
    iTextareaStringLength = $('#commbody').text().length

    $($('#commbody')).setCursorPosition(iTextareaStringLength);
    $('#commbody').focus();

}

new function($) {
  $.fn.setCursorPosition = function(pos) {
    if ($(this).get(0).setSelectionRange) {
      $(this).get(0).setSelectionRange(pos, pos);
    } else if ($(this).get(0).createTextRange) {
      var range = $(this).get(0).createTextRange();
      range.collapse(true);
      range.moveEnd('character', pos);
      range.moveStart('character', pos);
      range.select();
    }
  }
}(jQuery);