<div class="xhnewbb">
<h1<{if $mode == "edit"}> class="attention"<{/if}>><{$formtitle}></h1>
<div class="breadcrumbs"><a href="<{$xoops_url}>/modules/xhnewbb/index.php"><{$forum_index_title}></a>&nbsp;-&nbsp;<a href="<{$mod_url}>/viewallforum.php"><{$lang_alltopicsindex}></a></div>

<p><{$smarty.const._MD_XHNEWBB_ABOUTPOST}>: <{$message_about_post}></p>

<{if $mode == "reply"}>
<div id="forum_reference" class="outer">
	<div class="head"><{$reference_subject}></div>
	<div class="even"><{$smarty.const._MD_XHNEWBB_BY}> <{$reference_name}> <{$smarty.const._MD_XHNEWBB_ON}> <{$reference_date}></div>
	<div class="odd"><{$reference_message}></div>
</div>
<{/if}>

<{if $ispreview}>
<div id="forum_preview" class="outer">
	<div class="head"><{$preview_subject}></div>
	<div class="odd"><{$preview_message}></div>
</div>
<{/if}>

<form name="forumform" id="forumform" action="post.php?viewmode=<{$viewmode}>&order=<{$order}>" method="post" onsubmit="return xoopsFormValidate_forumform();">

	<input type="hidden" name="pid" id="pid" value="<{$pid}>" />
	<input type="hidden" name="post_id" id="post_id" value="<{$post_id}>" />
	<input type="hidden" name="topic_id" id="topic_id" value="<{$topic_id}>" />
	<input type="hidden" name="forum" id="forum" value="<{$forum}>" />
	<input type="hidden" name="reference_quote" id="reference_quote" value="<{$reference_quote}>" />

	<table width="100%" class="outer" cellspacing="1">
		<tr valign="top" align="left">
			<td class="head"><label for="subject"><{$smarty.const._MD_XHNEWBB_SUBJECTC}></label></td>
			<td class="even">
				<input type="text" name="subject" id="subject" size="60" maxlength="255" value="<{$subject}>" />
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><{if $uid == false}><label for="guestname"><{/if}><{$smarty.const._MD_XHNEWBB_UNAMEC}><{if $uid == false}></label><{/if}></td>
			<td class="even">
				<{if $uid}>
					<{$uname|string_format:$smarty.const._MD_XHNEWBB_FMT_UNAME}>
				<{else}>
					<input type="text" name="guestname" id="guestname" value="<{$uname}>" size="30" maxlength="100" />
				<{/if}>
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><{$smarty.const._MD_XHNEWBB_MESSAGEICON}></td>
			<td class="even">
				<{foreach from=$icons key=icon_file item=icon_alt}>
					<input type="radio" name="icon" id="icon_<{$icon_file}>" value="<{$icon_file}>" <{if $icon_selected == $icon_file}>checked="checked"<{/if}> /><label for="icon_<{$icon_file}>"><img src="<{$xoops_url}>/modules/xhnewbb/images/<{$icon_file}>" alt="<{$icon_alt}>" /></label>
				<{/foreach}>
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><label for="message"><{$smarty.const._MD_XHNEWBB_MESSAGEC}></label></td>
			<td class="even">
				<{xoopsdhtmltarea name=message cols=60 rows=15 value=$message}>
				<br />
				<{if $reference_quote}>
				<input type="button" name="quote" id="quote" onclick="xhnewbb_quote_message();" value="<{$smarty.const._MD_XHNEWBB_QUOTE}>" />
				<{/if}>
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><{$smarty.const._MD_XHNEWBB_OPTIONS}></td>
			<td class="even">

				<!-- solve or not -->
				<{if $can_change_solved}>
				<input type="checkbox" name="solved" id="solved" value="1" <{$solved_checked}> /><label for="solved"><{$smarty.const._MD_XHNEWBB_SOLVEDYES}></label>
				<br />
				<{/if}>

				<!-- mark -->
				<{if $allow_mark}>
				<input type="checkbox" name="u2t_marked" id="u2t_marked" value="1" <{$u2t_marked_checked}> /><label for="u2t_marked"><{$smarty.const._MD_XHNEWBB_MARK_TURNON}></label>
				<br />
				<{/if}>

				<!-- smiley -->
				<input type="checkbox" name="nosmiley" id="nosmiley" value="1" <{$nosmiley_checked}> /><label for="nosmiley"><{$smarty.const._MD_XHNEWBB_DISABLESMILEY}></label>
				<br />

				<!-- html -->
				<{if $allow_html}>
				<input type="checkbox" name="nohtml" id="nohtml" value="1" <{$nohtml_checked}> /><label for="nohtml"><{$smarty.const._MD_XHNEWBB_DISABLEHTML}></label>
				<br />
				<{/if}>

				<!-- signature -->
				<{if $allow_sig}>
				<input type="checkbox" name="attachsig" id="attachsig" value="1" <{$attachsig_checked}> /><label for="attachsig"><{$smarty.const._MD_XHNEWBB_ATTACHSIG}></label>
				<br />
				<{/if}>

				<!-- notification thread-new_post -->
				<{if $allow_notify}>
				<input type="checkbox" name="notify" id="notify" value="1" <{$notify_checked}> /><label for="notify"><{$smarty.const._MD_XHNEWBB_NEWPOSTNOTIFY}></label>
				<{/if}>
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"></td>
			<td class="even">
				<input type="submit" class="formButton" name="contents_preview"  id="contents_preview" value="<{$smarty.const._PREVIEW}>" />
				<input type="submit" class="formButton" name="contents_submit"  id="contents_submit" value="<{$smarty.const._SUBMIT}>" />
			</td>
		</tr>
	</table>
</form>
</div>

<!-- Start Form Vaidation JavaScript //-->
<script type="text/javascript">
<!--//
function xoopsFormValidate_forumform() {
	myform = window.document.forumform;
	if ( myform.subject.value == "" ) { window.alert("<{$smarty.const._MD_XHNEWBB_SUBJECTC|string_format:$smarty.const._FORM_ENTER}>"); myform.subject.focus(); return false; }
	return true;
}
function xhnewbb_quote_message() {
	xoopsGetElementById("message").value = xoopsGetElementById("message").value + xoopsGetElementById("reference_quote").value ;
}


//--></script>
<!-- End Form Vaidation JavaScript //-->
