porezon,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
function insert_comm(num,open, close, no_focus)
{
msgfield = document.querySelectorAll('.clatextarea')[num];
if (document.selection && document.selection.createRange)
{
if (no_focus != '1' ) msgfield.focus();
sel = document.selection.createRange();
sel.text = open + sel.text + close;
if (no_focus != '1' ) msgfield.focus();
}else if (msgfield.selectionStart || msgfield.selectionStart == '0'){
var startPos = msgfield.selectionStart;
var endPos = msgfield.selectionEnd;
msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
document.getElementById('box').style.display='none';
document.getElementById('outbox').style.display='none';
document.getElementById('outbox').innerHTML='';
if (no_focus != '1' ) msgfield.focus();
}else{
msgfield.value += open + close;
if (no_focus != '1' ) msgfield.focus();
}return;}
</script>
</head>
<body>
<form id="comment" name="commentfrm" method="POST" action="">
<div class="obvodka">
<div class="tema" >Ваш комментарий</div>
<table class="forum2">
<tbody>
<tr>
<td colspan="2">
<div class='edit_b'>
<div class="editor_button" onclick="insert_comm(0,'[b]','[/b]');">B</div>
<div class="editor_button" onclick="insert_comm(0,'[i]','[/i]');">I</div>
<div class="editor_button" onclick="insert_comm(0,'[u]','[/u]');">U</div>
<tr>
<td colspan="2">
<textarea cols="40" rows="10" id="comess" name="com_desc" class="clatextarea"></textarea>
</td></tr>
</table>
</form>
<form id="comment" name="commentfrm" method="POST" action="">
<div class="obvodka">
<div class="tema" >Ваш комментарий</div>
<table class="forum2">
<tbody>
<tr>
<td colspan="2">
<div class='edit_b'>
<div class="editor_button" onclick="insert_comm(1,'[b]','[/b]');">B</div>
<div class="editor_button" onclick="insert_comm(1,'[i]','[/i]');">I</div>
<div class="editor_button" onclick="insert_comm(1,'[u]','[/u]');">U</div>
<tr>
<td colspan="2">
<textarea cols="40" rows="10" id="comess" name="com_desc" class="clatextarea"></textarea>
</td></tr>
</table>
</form>
</body>
</html>