{template supesite_header}
<div class="msglist" style="margin-top: 10px;">
	<h3 class="topblock"><a href="$supe[siteurl]?action_mygroup_gid_$thread[sgid]">$circle[groupname]</a> &raquo; <a href="$supe[siteurl]?action_mygroup_gid_$thread[sgid]_op_list_type_bbs">{lang circle_bbs}</a> $navigation &raquo; {lang post_newreply}</h3>
</div>

<script type="text/javascript" src="include/javascript/post.js"></script>
<script type="text/javascript">
var postminchars = parseInt('$minpostsize');
var postmaxchars = parseInt('$maxpostsize');
var disablepostctrl = parseInt('$disablepostctrl');
var bbinsert = parseInt('$bbinsert');
var seccodecheck = parseInt('$seccodecheck');
var secqaacheck = parseInt('$secqaacheck');
function checklength(theform) {
	var message = bbinsert && wysiwyg ? html2bbcode(getEditorContents()) : (!theform.parseurloff.checked ? parseurl(theform.message.value) : theform.message.value);
	var showmessage = postmaxchars != 0 ? '{lang board_allowed}: ' + postminchars + ' {lang lento} ' + postmaxchars + ' {lang bytes}' : '';
	alert('\n{lang post_curlength}: ' + mb_strlen(message) + ' {lang bytes}\n\n' + showmessage);
}
function validate(theform, previewpost) {
	var message = bbinsert && wysiwyg ? html2bbcode(getEditorContents()) : (!theform.parseurloff.checked ? parseurl(theform.message.value) : theform.message.value);
	if(message == "" && theform.subject.value == "") {
		alert("{lang post_subject_and_message_isnull}");
		theform.message.focus();
		return false;
	} else if(mb_strlen(theform.subject.value) > 80) {
		alert("{lang post_subject_toolong}");
		theform.subject.focus();
		return false;
	}
	if(!disablepostctrl && ((postminchars != 0 && mb_strlen(message) < postminchars) || (postmaxchars != 0 && mb_strlen(message) > postmaxchars))) {
		alert("{lang post_message_length_invalid}\n\n{lang post_curlength}: "+mb_strlen(message)+" {lang bytes}\n{lang board_allowed}: "+postminchars+" {lang lento} "+postmaxchars+" {lang bytes}");
		return false;
	}
	theform.message.value = message;
	seccheck(theform, seccodecheck, secqaacheck, previewpost);
	return true;
}
</script>

{template supesite_post_preview}

<form method="post" id="postform" action="post.php?action=reply&fid=$fid&tid=$tid&extra=$extra&replysubmit=yes" $enctype onSubmit="return validate(this)">
<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}">

<div class="block">
	<span class="morelinks"><a href="member.php?action=credits&view=forum_reply&fid=$fid" target="_blank">{lang credits_policy_view}</a></span>
	<h3>{lang post_newreply}</h3>
<table cellspacing="0" cellpadding="0" class="postform">

<!--{if $discuz_uid}-->
	<tr><th>{lang username}</th>
	<td>$discuz_userss <span class="smalltxt">[<a href="$link_logout">{lang member_logout}</a>]</span></td>
	</tr>
<!--{/if}-->

<!--{if $seccodecheck}-->
	<tr><th>{lang seccode}</th>
	<td><div id="seccodeimage"></div><input type="text" name="seccodeverify" id="seccodeverify" size="4" maxlength="4"> <span class="smalltxt">{lang secode_refresh}</span>
	<script type="text/javascript">
	<!--{if $attackevasive & 1}-->
		setTimeout("updateseccode($seccodedata['width'], $seccodedata['height'])", 2001);
	<!--{else}-->
		updateseccode($seccodedata['width'], $seccodedata['height'])
	<!--{/if}-->
	</script></td>
<!--{/if}-->
<!--{if $secqaacheck}-->
	<tr><th>{lang secqaa}</th>
	<td><div id="secquestion"></div><input type="text" name="secanswer" id="secanswer" size="25" maxlength="50">
	<script type="text/javascript">
	<!--{if $attackevasive & 1}-->
		<!--{if $seccodecheck}-->
			setTimeout("updatesecqaa()", 4002);
		<!--{else}-->
			setTimeout("updatesecqaa()", 2001);
		<!--{/if}-->
	<!--{else}-->
		updatesecqaa();
	<!--{/if}-->
	</script></td>
	</tr>
<!--{/if}-->


<tr>
<th>{lang subject}</th>
<td><input type="text" name="subject" id="subject" size="45" value="$subject" tabindex="3">&nbsp; <span class="smalltxt">({lang optional})</span></td>
</tr>

<tr>
<th>
{template post_sminsert}
<input class="checkbox" type="checkbox" name="parseurloff" id="parseurloff" value="1" $urloffcheck> {lang disable} {lang post_parseurl}<br>
<input class="checkbox" type="checkbox" name="smileyoff" id="smileyoff" value="1" $smileyoffcheck> {lang disable} {faq smilies}<br>
<input class="checkbox" type="checkbox" name="bbcodeoff" id="bbcodeoff" value="1" $codeoffcheck> {lang disable} {faq discuzcode}<br>
<!--{if $allowhtml}--><input class="checkbox" type="checkbox" name="htmlon" id="htmlon" value="1" $htmloncheck> {lang enable} {lang post_html}<br><!--{/if}-->
<!--{if $allowanonymous}--><input class="checkbox" type="checkbox" name="isanonymous" value="1"> {lang post_anonymous}<br><!--{/if}-->
<input class="checkbox" type="checkbox" name="usesig" value="1" $usesigcheck> {lang post_show_sig}<br>
<input class="checkbox" type="checkbox" name="emailnotify" value="1" $emailcheck> {lang post_email_notify}
</th>

<td>
<div id="$editorid">
{template supesite_post_bbinsert}
<div class="editor_text"><textarea name="message" rows="10" cols="60" style="width:100%; height:350px;" tabindex="100" id="{$editorid}_textarea" onSelect="javascript: storeCaret(this);" onClick="javascript: storeCaret(this);" onKeyUp="javascript:storeCaret(this);" onKeyDown="ctlent(event);">$message</textarea></div>
<table width="100%" cellpadding="{TABLESPACE}" cellspacing="0" class="editor_button"><tr><td>
<div class="editor_textexpand"><img src="images/common/bb_contract.gif" width="11" height="21" title="{lang post_discuzcode_contract}" alt="{lang post_discuzcode_contract}" onclick="resizeEditor(-100)" /><img src="images/common/bb_expand.gif" width="11" height="21" title="{lang post_discuzcode_expand}" alt="{lang post_discuzcode_expand}" onclick="resizeEditor(100)" /></div>
</td><td align="right">
<input type="button" class="lightbutton" value="{lang post_check_length}" onclick="checklength($('postform'))">
<input type="button" class="lightbutton" name="previewbutton" id="previewbutton" value="{lang post_previewpost}" tabindex="102" onclick="previewpost()">
<input type="button" class="lightbutton" name="restoredata" id="restoredata" value="{lang post_autosave_restore}" tabindex="103" title="{lang post_autosave_last_restore}" onclick="loadData()">
<input type="button" class="lightbutton" value=" {lang post_topicreset} " tabindex="104" onclick="clearcontent()">
</td></table>
</div>

<!--{if $allowpostattach}-->
	{template post_attachments}
<!--{/if}-->

<div class="postsubmit">
<input class="button" type="submit" name="replysubmit" id="postsubmit" value="{lang post_newreply}" tabindex="101">
<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode">
<input type="hidden" name="fid" id="fid" value="$fid">
{lang post_submit_hotkey}
</div>

</td></tr></table></div>

</form>

<div class="msglist"><h3 class="topblock">{lang post_thread_review}</h3>
<!--{if $thread['replies'] > $ppp}-->
	<div class="threadinfo">{lang post_replies_toolong}</div></div>
<!--{else}-->
	</div>
	<table cellspacing="0" cellpadding="0" class="viewthread">
	<!--{loop $postlist $post}-->
	<tbody>
		<tr>
			<th><strong><!--{if $post['author'] && !$post['anonymous']}-->$post[author]<!--{else}-->{lang anonymous}<!--{/if}--></strong></th>
			<td>
				<p class="postlinks">{lang poston} $post[dateline]</p>
				<div class="postcontent">$post[message]</div>
			</td>
		</tr>
	</tbody>
	<!--{/loop}-->
	</table>
<!--{/if}-->


<script type="text/javascript">
	var textobj = $(editorid + '_textarea');
	<!--{if $bbinsert}-->newEditor(wysiwyg);<!--{/if}-->
	checkFocus();
	setCaretAtEnd();
	if(!(is_ie >= 5 || is_moz >= 2)) {
		$('restoredata').style.display = 'none';
	}
</script>

{template supesite_footer}