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

<script language="JavaScript">
<!--
function formCheck(form) {
	if (document.form.submit.action != "") {
		document.form.submit.disabled=1;}
}
// -->
</script>
<script language="JavaScript">
<!--
function IS(smile)
{
	if (document.form.message.createTextRange && document.form.message.caretPos)
	{
		var caretPos = document.form.message.caretPos;
		caretPos.smile = caretPos.smile.charAt(caretPos.smile.length - 1)==' '? smile+' ':smile;
		document.form.message.focus();
	}
	else
	{
		document.form.message.value += smile;
		document.form.message.focus();
	}
}
var agt = navigator.userAgent.toLowerCase(); 
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie = ((agt.indexOf('msie') != -1) && (agt.indexOf('opera') == -1));
var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_moz = 0;
var is_win = ((agt.indexOf('win')!=-1) || (agt.indexOf('16bit') != -1));
var is_mac = (agt.indexOf('mac')!=-1);
var SelectedText = '';
function AddCode(open, close)
{
	var txtarea = document.form.message;
	if ((is_major >= 4) && is_ie && is_win) 
	{
		SelectedText = document.selection.createRange().text;
		if (SelectedText=='')
		{
			txtarea.value += open + close;
			txtarea.focus();
			return;
		}
		document.selection.createRange().text = open + SelectedText + close;
		txtarea.focus();
		return;
	}else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)){ 
		mozWrap(txtarea, open, close);
		return;
	}else{ 
		txtarea.value += open + close;
		txtarea.focus();
	}
	storeCaret(txtarea);
}

// -->
</script>

<form action="<?=C_URL?>/comments.php" method="post" name=form OnSubmit="return formCheck(this)">
<input class=input type=hidden name="l" value="<?=LANGUAGE?>">
<input class=input type=hidden name="a" value="a">
<input class=input type=hidden name="cid" value="<?=$cid?>">
<input class=input type=hidden name="reply">
<center><span class=head><?=REPLY?></span>
<br>
	  <Table CellSpacing="<?=C_BORDER?>" CellPadding="0" width="<?=C_WIDTH?>" bgcolor="<?=C_TBCOLOR?>">
  <Tr>
    <Td>
    <Table Border=0 CellSpacing="<?=C_IBORDER?>" CellPadding="<?=C_CELLP?>" width="<?=C_WIDTH?>" class=mes>
    <Tr align="<?=C_ALIGN?>" bgcolor="<?=COLOR1?>">
      <Td>
            <TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
  <Tr align="center" bgcolor="<?=COLOR3?>" class=mes>
              <TD width=70%><?=$csubject?></TD>
              <TD><?=$cdate?></TD>
             </TR>
  <Tr align="center" bgcolor="<?=COLOR3?>" class=mes>
              <TD><?=$ccomment?></TD>
              <TD>
							<?=$cphotos?><br>
							<?=$cnames?>
							</TD>
             </TR>
</table></td></tr></table></TD></TR></TABLE><br><br>		
	  <Table CellSpacing="<?=C_BORDER?>" CellPadding="0" width="<?=C_WIDTH?>" bgcolor="<?=C_TBCOLOR?>">
  <Tr>
    <Td>
    <Table Border=0 CellSpacing="<?=C_IBORDER?>" CellPadding="<?=C_CELLP?>" width="<?=C_WIDTH?>" class=mes>
    <Tr align="<?=C_ALIGN?>" bgcolor="<?=COLOR1?>">
      <Td>
            <TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="3">
  <Tr align="center" bgcolor="<?=COLOR3?>" class=mes>		
    <Td>
    <div align="center" width=200><?$p=0;foreach ($smiles as $k=>$v){$p++;?>
<a href="javascript:IS(' <?=$k?> ',1)"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/forum/smiles/<?=$v?>" border=0 /></a>
<?if(C_SMILES_NUMBER <= $p){?>
<br><a href="javascript:open_win('<?=C_URL?>/forum/smiles_show.php','_blank')"><?=$w[720]?></a><br>
<?break;}?>
<?}?><br>
<a href="javascript:AddCode('[B]','[/B]')"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/images/Bold.gif" border=0 /></a>
<a href="javascript:AddCode('[I]','[/I]')"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/images/Italic.gif" border=0 /></a>
<a href="javascript:AddCode('[U]','[/U]')"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/images/Underline.gif" border=0 /></a>
<a href="javascript:AddCode('[QUOTE]','[/QUOTE]')"><img src="<?=C_URL?>/templates/<?=C_TEMP?>/images/Quote.gif" border=0 /></a></div>
    </td><td align=left><?=MESSAGE?><br>
		
    <textarea class=textarea name=message cols=40 rows=15>
		<?=$creply?>
		</textarea>
    </td>
  </tr>
  <Tr align="<?=C_ALIGN?>" bgcolor="<?=COLOR1?>">
    <Td colspan="2">
    <input class=input1 type=submit value="<?=REPLY?>" name="submit">
    </td>
  </tr>
  </table>
  </td>
</tr>
</table>
     </TD>
    </TR></form>
   </TABLE>