<?php if(!defined("C_URL")) die('Can`t access file directly!'); ?>

<script language="JavaScript">
<!--
function ins(prop,type)
{
	var input = window.opener.document.forms['form'].message;
	var mysel;var text;
	if (window.opener.getSelection) mysel = window.opener.getSelection();
	else if (window.opener.document.selection) mysel = window.opener.document.selection.createRange().text;
	else if (window.opener.document.getSelection)	mysel = window.opener.document.getSelection();
	b = (type == 0) ? '['+prop+']' : prop;
	e = (type == 0) ? '[/'+prop+']' : '';
  if (input.createTextRange)
  {
	  var text;
    input.focus(input.caretPos);
    input.caretPos = window.opener.document.selection.createRange().duplicate();
    input.caretPos.text = (input.caretPos.text.length>0) ? b + input.caretPos.text + e : b + mysel + e;
   }
   else input.value += b + mysel + e;
}
// -->
</script>
<br>

<Table CellSpacing="<?=C_BORDER?>" CellPadding="0" width="<?=C_SWIDTH?>" bgcolor="<?=C_TBCOLOR?>" align=center>
<Tr>
  <Td width="<?=C_SWIDTH?>" bgcolor="<?=COLOR1?>" valign="top">
  <Table Border=0 CellSpacing="<?=C_IBORDER?>" CellPadding="<?=C_CELLP?>" width="<?=C_SWIDTH?>" class=mes>
  <Tr align="<?=C_ALIGN?>" bgcolor="<?=COLOR1?>">
    <Td width="100%" rowspan="2" valign="top" align="center">    
 <Table Border=0 width="<?=C_SWIDTH?>"><Tr align="left" bgcolor="<?=COLORH?>"><Td>
 <?foreach ($smiles as $k=>$v){?>
<a href="javascript:ins(' <?=$k?> ',1)"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/forum/smiles/<?=$v?>" border=0 /></a>
<?}?>
    </Td>
  </Tr>
  </Table>
  </Td>
</Tr>
</Table>
<br>
</form>