
var oFCKeditor=new FCKeditor('CommentContent');function getEditorValue(){var oFCKeditor=FCKeditorAPI.GetInstance('CommentContent');return oFCKeditor.GetXHTML(true);}
function setEditorValue(text){var oFCKeditor=FCKeditorAPI.GetInstance('CommentContent');oFCKeditor.SetHTML(text);oFCKeditor.Focus();}
function initReply(){$("a.reply, a.quote").click(function(){var type=$(this).hasClass('reply')?'reply':'quote';var id=$(this).attr('rel');$('#CommentParentId').val(id);$.get('/comment/'+type+'/'+id,function(data){setEditorValue(data);});$('form#comment_form').scrollTo(1000);return false;});}
function initEditor(){if($('form#comment_form').size()>0){oFCKeditor.BasePath="/js/fckeditor/";oFCKeditor.Config["CustomConfigurationsPath"]="/js/fckeditor/myconfig.js";if($('form#comment_form').hasClass('moderator')){oFCKeditor.ToolbarSet='BasicAdmin';}else{oFCKeditor.ToolbarSet='Basic';}
oFCKeditor.Width=500;oFCKeditor.Height=200;oFCKeditor.ReplaceTextarea();}}
function initComments(){initReply();initEditor();}
$(document).ready(initComments);