<script type="text/javascript" src="chat/js/jquery.js"></script>
<script type="text/javascript" src="chat/js/form.js"></script>
<script type="text/javascript" src="chat/js/bbcod.js"></script>
<script type="text/javascript" src="chat/js/chat.js"></script>
<?
include "option.php";
include "css.php";
?>
<div class="dif" align="center" style="width: 99%;border:1px solid #cccccc;border-bottom:0px;">
<font style="font-size:9px;font-family:Verdana, Geneva, sans-serif;"><b>&raquo;
<a href="#" onclick="JavaScript:window.open('chat/histori.php','','width=300,height=400,toolbar=0,resizable=0,scrollbars=1,status=0') " title="История чата">История чата</a>
&laquo;</b></font>
</div>
<div class="dif"  id="chatmess" style="height: 200px; width: 99%; overflow: auto;border:1px solid #cccccc;">
</div>


<div class="dif"  align="center" style="width: 99%;border:1px solid #cccccc;border-top:0px;background-color: #e0e0e0;padding-top:3px;">

<?if(isset($_SESSION["username"]) && isset($_SESSION["password"]))
{?>
<form id="post" method="post">
<table border="0" width="96%">
<tr>
<td align="left" width="50%">
<input class="bbcod" value="B" onclick="insert_text('[b]','[/b]')" type="button">
<input class="bbcod" value="I" onclick="insert_text('[i]','[/i]')" type="button">
<input class="bbcod" value="U" onclick="insert_text('[u]','[/u]')" type="button">
</td>
<td align="right" width="50%">
<input type="submit"  id="otprav" value="Oтправить" class="cnop" >
</td>
<tr>
<td align="center" colspan="2">
<textarea id="message" name="mess" rows=0 class="textur"></textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">

<input style="background: url('chat/smile/2.gif');border:0;height: 23px;width:26px;" onclick="insert_text('',':-8')" type="button">
<input style="background: url('chat/smile/3.gif');border:0;height: 22px;width:24px;" onclick="insert_text('',':-(')" type="button">
<input style="background: url('chat/smile/4.gif');border:0;height: 25px;width:25px;" onclick="insert_text('',':~)')" type="button">
<input style="background: url('chat/smile/5.gif');border:0;height: 20px;width:20px;" onclick="insert_text('',':-9')" type="button">
<input style="background: url('chat/smile/6.gif');border:0;height: 27px;width:20px;" onclick="insert_text('','8-)')" type="button">
<input style="background: url('chat/smile/7.gif');border:0;height: 21px;width:20px;" onclick="insert_text('','-)')" type="button">
</td>
</tr>
</table>
</form>
<?}else{echo "<span align=\"center\" style=\"font-family:Verdana, Geneva, sans-serif;color:#880000;font-size:9px;padding-top:5px;padding-bottom:5px;\">
<center><b>Для общения в Чате, Вам нужно зарегистрироваться</i></b></center>
</span>";}?>
</div>
<script>
$(document).ready(function(){
    showchat();
    setInterval('showchat()',<?=$chsec;?>000);
});
</script>
