<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();}
				
			function emoticon(text) {
	var txtarea = document.message.msg;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}	
				
				</script>


				<?				








if (!isset($msg2))$msg2=NULL;


echo "<div id='comments' class='tpanel'><div class='tmenu'><a href='/plugins/smiles/'>Смайлы</a></div><div class='tmenu'><a href='/plugins/rules/bb-code.php'>Теги</a></div></div>";
echo '<textarea name="msg" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">'.$otvet.''.$msg2.'</textarea><br />';


?>




<a href="javascript:tag('[b]', '[/b]')"><img src="/style/value/b.png" alt="b" title="Жирный"/></a>
<a href="javascript:tag('&#60;?php', '?&#62;')"><img src="/style/value/cod.png" alt="cod" title="Код"/></a>
<a href="javascript:tag('[cit]', '[/cit]')"><img src="/style/icons/forum.png" alt="red" title="Цитата"/></a>
<a href="javascript:tag('[url=]', '[/url]')"><img src="/style/value/l.png" alt="url" title="Ссылка" /></a>
<a href="javascript:tag('[img]', '[/img]')"><img src="/style/value/img.png" alt="u" title="Картинка"/></a>
<a href="javascript:tag('[color=#]', '[/color]')"><img src="/style/icons/color.gif" alt="color" title="Цвет текста"/></a>
<a href="javascript:tag('[fon=#]', '[/fon]')"><img src="/style/icons/color_bg.gif" alt="color" title="Цвет фона"/></a><br>


<a href="javascript:emoticon(':)')"><img src="/style/smiles/smile.gif" border="0" alt="" title="Улыбка" /></a>
<a href="javascript:emoticon(':(')"><img src="/style/smiles/bad.gif" border="0" alt="" title="Грусть" /></a>
<a href="javascript:emoticon('.че.')"><img src="/style/smiles/4e.gif" border="0" alt="" title="Че" /></a>
<a href="javascript:emoticon('.миг.')"><img src="/style/smiles/mig.gif" border="0" alt="" title="Миг" /></a>
<a href="javascript:emoticon(':D')"><img src="/style/smiles/biggrin.gif" border="0" alt="" title="Ха-ха" /></a>
<a href="javascript:emoticon('.секрет.')"><img src="/style/smiles/secret.gif" border="0" alt="" title="Секрет" /></a>


<?





?>  <script>    $.fx.speeds._default = 1000;    $( "#dialog" ).dialog({      autoOpen: false,      show: "blind",      hide: "explode"    });	    $( "#opener" ).click(function(){      $( "#dialog" ).dialog( "open" );	  showContent2('/ajax/php/smiles.php');      return false;    });  </script>