
<input type="hidden" name="p_id" value="{$smarty.request.p_id|default:$smarty.request.pid}" />
<input type="hidden" name="action" value="{$smarty.request.action}" />
<input type="hidden" name="num_pages" value="{$smarty.get.num_pages}" />
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="forum_tableborder">
    {if $bbcodes}
    <tr>
        <td valign="top" nowrap="nowrap" class="row_first">{$lang.f_field_format}<span class="td1"> </span></td>
        <td valign="top" class="row_second">{include file="comments/format.tpl"}</td>
    </tr>
    {/if}
    <tr>
        <td  class="row_first" style="width: 20%">{$lang.f_field_subject}</td>
        <td class="row_second"><input class="inputfield"  type="text" name="subject" value="{$message->title|default:$smarty.post.subject}" maxlength="200" size="50" /></td>
    </tr>
    <tr>
        <td valign="top" nowrap="nowrap" class="row_first">
            {if $smilie == 1}
            <fieldset class="fieldset">
                    <legend>{$lang.smilies_t}</legend>
                    {$smilies2}&nbsp;{$listemos}
            </fieldset>
            {/if}
      </td>
        <td  class="row_second">{* {$lang.f_field_message}<br /> *}
            <textarea class="inputfield" style="width: 97%" name="text" rows="15" onfocus="getActiveText(this)" onclick="getActiveText(this)"  onchange="getActiveText(this)">{$message->message|default:$preview_text_form|escape:"html|sslash"}</textarea>
      </td>
    </tr>
	<tr>
        <td class="row_first">{$lang.f_field_options}</td>
        <td class="row_second">
            <input class="noborder" type="checkbox" name="parseurl" value="1" checked="checked">{$lang.f_lbl_urlconvert}</input><br />
            {if $ugroup!=2}
			<input class="noborder" type="checkbox" name="notification" value="1" {if ( $notification==1 ) || ($smarty.request.notification==1) }checked="checked"{/if}>{$lang.f_lbl_notification}</input><br />
           	{/if}
		    <input class="noborder" type="checkbox" name="disablebb" value="1" {if $smarty.request.disablebb==1 }checked="checked"{/if}>{$lang.f_lbl_disablebbcode}</input><br />
            <input class="noborder" type="checkbox" name="disablesmileys" value="1" {if $smarty.request.disablesmileys==1 }checked="checked"{/if}>{$lang.f_lbl_disablesmilies}</input><br />
            {if $ugroup!=2}
			<input class="noborder" type="checkbox" name="usesig" value="1" checked="checked">{$lang.f_lbl_usesig}</input>
			{/if}
        </td>
    </tr>
	{if $permissions.8 == 1}
	<tr>
		<td class="row_first">{$lang.f_field_attachment}:</td>
		<td class="row_second">
		
		{if ($smarty.request.action=='edit') || ($pre_error==1) || ($nooon != 1)}
		{if $h_attachments_only_show }
		{foreach name=attachments from=$h_attachments_only_show item=at}
		{assign var="counter" value=$counter+1}
		{$at}
		{/foreach}
		{/if}
		
		{/if}
		
			{assign var=fileCount value=$smarty.foreach.attachments.total}
			<input type="hidden" id="hidden_count" value="{$counter}" />
			<script language="javascript" type="text/javascript">
			<!--
			function attachment_window(att_count){ldelim}
				var attcount = document.getElementById('hidden_count').value;
				var left = {$maxattachment} - attcount;
				if (attcount >= {$maxattachment}){ldelim}
					alert('Bitte löschen Sie erst einen Anhang');
				{rdelim} else {ldelim}
			{if $smarty.request.toid != ""}
				window.open('index.php?p=misc&do=attachment&toid={$smarty.request.toid}&left='+ left +'&p_id={if $smarty.get.pid != ""}{$smarty.get.pid}{else}-1{/if}', 'moo', 'toolbar=no,scrollbars=yes,resizable=yes,width=450,height=400');
				{else}
				window.open('index.php?p=misc&do=attachment&fid={$smarty.request.fid}&left='+ left +'&p_id={if $smarty.get.pid != ""}{$smarty.get.pid}{else}-1{/if}', 'moo', 'toolbar=no,scrollbars=yes,resizable=yes,width=450,height=400');
				{/if}
				{rdelim}
			{rdelim}
			//-->
			</script>
			<input type="hidden" id="fileCount" name="fileCount" value="{$fileCount}" />
			<div id="attachments"></div>
			<p>
				<input class="button" type="button" onclick="return attachment_window('{$fileCount}');" value="{$lang.f_field_attachment}" />
			</p>
		</td>
	</tr>
	{/if}
</table>
<!-- THREADFORM ENDE -->