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

<form action="forum_topic.php?board=$board&topic=$topic" 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">edit topic</td>
    </tr>
    <tr> 
      <td bgcolor="$pagebg"></td>
    </tr>
    <tr> 
      <td bgcolor="$bg1">
				<table width="100%" align="center" cellpadding="2" cellspacing="0" class="formtable">
          <tr>
            <td colspan="2">
							<table width="100%" cellpadding="0" cellspacing="0">
                <tr> 
                  <td colspan="15"><b>topic-icon:</b></td>
                </tr>
                <tr> 
                  <td colspan="8"></td>
                </tr>
								$iconlist
              </table>
						</td>
          </tr>
          <tr>
            <td colspan="2"><b>subject:</b><br></td>
          </tr>
          <tr>
            <td colspan="2"><input name="topicname" type="text" class="form_off" id="topicname" style="width:100%;" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$topicname" size="45"></td>
          </tr>
          <tr>
            <td colspan="2">$addbbcode</td>
          </tr>
          <tr>
            <td colspan="2"><textarea name="message" rows="10" cols="35" 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>
							$notify
$chk_sticky
            </td>
            <td align="right" valign="bottom">
							<input type="hidden" name="post" value="$post">
							<input type="hidden" name="saveedittopic" value="true">
							<input name="updatetopic" type="submit" value="update topic">
						</td>
          </tr>
        </table>
			</td>
    </tr>
  </table>
</form>