<script language="JavaScript" type="text/javascript">
<!--
function chkFormular() {
	if(document.post.message.value == "") {
		alert("You have to enter text!");
		document.post.message.focus();
   		return false;
	}
}

function ChangeFormAction() {
	if(document.post.preview.checked == true) {
		document.post.action = "index.php?site=forum_topic";
	}
	else {
		document.post.action = "forum_topic.php";
	}
	
}
-->
</script>

<form action="forum_topic.php" method="post" name="post" onSubmit="return chkFormular()">
  <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="$border">
    <tr>
      <td class="title" align="center" bgcolor="$bghead">new reply</td>
    </tr>
    <tr>
      <td bgcolor="$pagebg"></td>
    </tr>
    <tr>
      <td bgcolor="$bg1"><br>

        <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="formtable">
          <tr> 
            <td colspan="2">$addbbcode </td>
          </tr>
          <tr> 
            <td colspan="2"> 
              <textarea name="message" rows="10" cols="50" style="width:100%;" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'">$message</textarea></td>
          </tr>
          <tr> 
            <td colspan="2"><b>Options:</b> <span class="small">&#8226; HTML is 
              OFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8226; <a href="javascript:MM_openBrWindow('code.php','BBCode','scrollbars=yes,width=600,height=500')">BBCode</a> 
              is ON &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8226; <a href="javascript:MM_openBrWindow('smileys.php','Smileys','scrollbars=yes,width=340,height=500')">Smilies</a> 
              are ON</span></td>
          </tr>
          <tr> 
            <td> <input class="input" type="checkbox" name="notify" value="1">
              Notify me when a reply is posted <br> <input class="input" type="checkbox" name="preview" value="1" onClick="ChangeFormAction()">
              preview my post $chk_sticky</td>
            <td align="right" valign="bottom"> <input type="hidden" name="userID" value="$userID"> 
              <input type="hidden" name="board" value="$board"> <input type="hidden" name="topic" value="$topic"> 
              <input type="hidden" name="page" value="$page"> <input type="hidden" name="addreply" value="true"> 
              <input name="newreply" type="submit" value="post new reply"></td>
          </tr>
        </table>
        
		</td>
    </tr>
  </table>
</form>
