<script language="JavaScript" type="text/javascript">
                function tag(text1, text2) {
                if ((document.selection)) {
                document.message.msg.focus();
                document.message.document.selection.createRange().text = text1+document.message.document.selection.createRange().text+text2;
                } else if(document.forms['message'].elements['msg'].selectionStart!=undefined) {
                var element = document.forms['message'].elements['msg'];
                var str = element.value;
                var start = element.selectionStart;
                var length = element.selectionEnd - element.selectionStart;
                element.value = str.substr(0, start) + text1 + str.substr(start, length) + text2 + str.substr(start + length);
				document.forms['message'].elements['msg'].focus();
                } else document.message.msg.value += text1+text2;
				document.forms['message'].elements['msg'].focus();}</script>
<?
echo "<table width='100%'>\n";
echo "<tr>\n";
echo "<td width='100%'>\n";
if (!isset($msg2))$msg2=NULL;
echo $tPanel;
?>
<div style="margin:4px;">
<a href="javascript:tag('[b]', '[/b]')"><img src="/style/value/b.png" alt="b" title="Жирный"/></a>
<a href="javascript:tag('[i]', '[/i]')"><img src="/style/value/i.png" alt="i" title="Наклонный"/></a>
<a href="javascript:tag('[u]', '[/u]')"><img src="/style/value/u.png" alt="u" title="Подчёркнутый"/></a>
<a href="javascript:tag('&#60;?php', '?&#62;')"><img src="/style/value/cod.png" alt="cod" title="Код"/></a>
<a href="javascript:tag('[url=]', '[/url]')"><img src="/style/value/l.png" alt="url" title="Ссылка" /></a>
<a href="javascript:tag('[red]', '[/red]')"><img src="/style/value/re.png" alt="red" title="Красный"/></a>
<a href="javascript:tag('[green]', '[/green]')"><img src="/style/value/gr.png" alt="green" title="Зелёный"/></a>
<a href="javascript:tag('[blue]', '[/blue]')"><img src="/style/value/bl.png" alt="blue" title="Синий"/></a>
</div>
<?
echo '<textarea name="msg" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">'.$otvet.''.$msg2.'</textarea><br />';
echo "</td>\n";

echo "<td>\n";

echo "<div id='smiles_0'>\n";
echo "<table height='150'>\n";
echo "<tr>\n";

echo "<td><a href=\"javascript:smiles('show');\"><img src=\"/style/themes/".$set['set_them']."/smiles_0.png\" border=\"0\" alt='' title='Показать панель смайлов' /></a></td>\n";

echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";

echo "<div id='smiles_1'>\n";
echo "<table width='200' height='150'>\n";

echo "<tr>\n";


echo "<td><a href=\"javascript:emoticon('=)')\"><img src=\"/style/smiles/biggrin2.gif\" border=\"0\" alt=\"\" title=\"=)\" /></a></td>";

echo "<td><a href=\"javascript:emoticon(':(')\"><img src=\"/style/smiles/bad.gif\" border=\"0\" alt=\"\" title=\"Грусть\" /></a></td>";

echo "<td rowspan='4'><a href=\"javascript:smiles('hide');\"><img src=\"/style/themes/".$set['set_them']."/smiles_1.png\" border=\"0\" alt=\"\" title=\"Скрыть панель смайлов\" /></a></td>";

echo "</tr>\n";



echo "<tr>\n";

echo "<td><a href=\"javascript:emoticon('.крут. ')\"><img src=\"/style/smiles/o4ki.gif\" border=\"0\" alt=\"\" title=\"Крут\" /></a></td>";

echo "<td><a href=\"javascript:emoticon('.миг. ')\"><img src=\"/style/smiles/mig.gif\" border=\"0\" alt=\"\" title=\"Подмигнуть\" /></a></td>";

echo "</tr>\n";


echo "<tr>\n";

echo "<td><a href=\"javascript:emoticon('.секрет. ')\"><img src=\"/style/smiles/secret.gif\" border=\"0\" alt=\"\" title=\"секрет\" /></a></td>";

echo "<td><a href=\"javascript:emoticon(':D ')\"><img src=\"/style/smiles/biggrin.gif\" border=\"0\" alt=\"\" title=\"Ржу\" /></a></td>";

echo "</tr>\n";



echo "<tr>\n";

echo "<td><a href=\"javascript:emoticon(':)')\"><img src=\"/style/smiles/smile.gif\" border=\"0\" alt=\"\" title=\"Улыбка\" /></a></td>";

echo "<td><a href=\"javascript:emoticon('.че.')\"><img src=\"/style/smiles/4e.gif\" border=\"0\" alt=\"\" title=\"Че\" /></a></td>";

echo "</tr>\n";


echo "</table>\n";
echo "</div>\n";
echo "<td>\n";
echo "</tr>\n";
echo "</table>\n";

?>