<html dir="{$_CONF['info_row']['content_dir']}" xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$_CONF['info_row']['content_language']}" lang="{$_CONF['info_row']['content_language']}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$_CONF['info_row']['charset']}" />
<meta name="generator" content="PowerBB" />
<link rel="stylesheet" href="{$style_path}" type="text/css" />
<title>{$lang['add_chat_message']} -
{if {$_CONF['info_row']['allowed_powered']} == 1}
{$lang['powered']}
{/if}</title>

<script>
//<!--
function storeCaret(text){
if (typeof(text.createTextRange) != "undefined")
text.caretPos = document.selection.createRange().duplicate();
}

function AddSmileyIcon(text){
textarea=document.forms.chat.text;
//textarea.dir="ltr";
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange){
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
caretPos.select();
}
else if (typeof(textarea.selectionStart) != "undefined")
{
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;
textarea.value = begin + text + end;
if (textarea.setSelectionRange){
textarea.focus();
textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
}
textarea.scrollTop = scrollPos;
}
else{
textarea.value += text;
textarea.focus(textarea.value.length - 1);}}
//-->
</script>
</head>
<body>
<form method="post" action="index.php?page=chat_message&start=1" name="chat">
	<div align="center">
		<table border="0" cellspacing="1" width="98%" class="border">
		{if {$_CONF['member_permission']}}
		{if {$num_mem_posts}}
					<tr>
				<td class="tbar_writer_info" colspan="2" align="center">
{$lang['chat_num_mem_posts']}
				 </td>
			</tr>
		   {else}
			<tr>
				<td class="tbar" colspan="2" align="center">{$lang['add_chat_message']}</td>
			</tr>
			{if {$_CONF['info_row']['chat_hide_country']} == 1}
			<tr>
				<td class="tbar_writer_info" align="center">{$lang['chat_country']}</td>
				<td class="tbar_writer_info" align="center">
				<input name="country" type="text" /></td>
			</tr>
			{/if}
			<tr>
<td class="tbar_writer_info" colspan="2" align="center">
				{$lang['chat_num_characters']}<br />

<textarea name="text" id="box_text" style="display:block;width:300px; height:100px;" class="inputbox" tabindex="3" rows="7" cols="20" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this)"></textarea>
				</td>
			</tr>
			<tr>
				<td class="tbar_writer_info" colspan="2" align="center">
				{Des::while}{SmileRows}
				<img src="{$SmileRows['smile_path']}" OnClick="AddSmileyIcon(' {$SmileRows['smile_short']} ');" alt="{$SmileRows['smile_path']}" border="0" cellspacing="1" />
			{/Des::while}
				</td>
			</tr>
			<tr>
				<td class="tbar_writer_info" colspan="2" align="center">
				<input name="insert" type="submit" value="{$lang['insert_chat_message']}" />
				 </td>
			</tr>
			{/if}
			{else}
				<tr>
				<td class="tbar_writer_info" colspan="2" align="center">
<b>(المعذره .. غير مسموح للزوار بإضافة الإهداءات, الرجاء <a target="_blank" href="index.php?page=register&index=1">التسجيل</a> في المنتدى)</b>
				 </td>
			</tr>
			{/if}
		</table>
	</div>
</form>
      <br />
		<div class="copyright">
		 {$lang['copyright_chat']}
		</div>
</body>
</html>