	var oFCKeditor
	var sthtml = [];
	function starteditcmt (id){
		if ( document.getElementById( 'body' + id ) ) return
		var mytext = $("#edcmt"+id).html();
		var htmleditor = "<form action='/' method='POST' onsubmit='saveedit("+id+"); return false;'><textarea id='body"+id+"' name='body' style='width:100%; height:60px;'>"+mytext+"</textarea><br /><div style='padding:5px;'><input type='submit' value='Сохранить' />&nbsp;<input type='button' value='Отменить' onclick='stopedit("+id+"); return false;' /></div></form>";
		sthtml[id] = mytext;
		$("#edcmt"+id).html(htmleditor);
		oFCKeditor = new FCKeditor( 'body' + id ) ;
		oFCKeditor.BasePath = "/fckeditor/" ;
		oFCKeditor.ToolbarSet = "cmt" ;
		oFCKeditor.ReplaceTextarea();
	}
				
	function stopedit (id){
		$("#edcmt"+id).html(sthtml[id].replace(/\n/g, "<br />"));
	}
				
	function saveedit (id){
		var newval = FCKeditorAPI.GetInstance('body'+id).GetHTML();
		$.post('/ajax/comment_edit/', {
		body: newval,
		id: id
		}, function (data){
			$("#edcmt"+id).html(data);
		});
	}