{template header}

<div id="nav"><a href="$indexname">$bbname</a> $navigation &raquo; {lang post_newthread_trade}</div>

<script type="text/javascript">
var postminchars = parseInt('$minpostsize');
var postmaxchars = parseInt('$maxpostsize');
var disablepostctrl = parseInt('$disablepostctrl');
var typerequired = parseInt('$forum[threadtypes][required]');
var bbinsert = parseInt('$bbinsert');
var seccodecheck = parseInt('$seccodecheck');
var secqaacheck = parseInt('$secqaacheck');
var special = 2;
var tradepost = 1;
var isfirstpost = 1;
var allowposttrade = parseInt('$allowposttrade');
var allowpostreward = parseInt('$allowpostreward');
var allowpostactivity = parseInt('$allowpostactivity');
lang['board_allowed'] = '{lang board_allowed}';
lang['lento'] = '{lang lento}';
lang['bytes'] = '{lang bytes}';
lang['post_curlength'] = '{lang post_curlength}';
lang['post_subject_and_message_isnull'] = '{lang post_subject_and_message_isnull}';
lang['post_subject_toolong'] = '{lang post_subject_toolong}';
lang['post_message_length_invalid'] = '{lang post_message_length_invalid}';
lang['post_type_isnull'] = '{lang post_type_isnull}';
lang['post_trade_alipay_null'] = '{lang post_trade_alipay_null}';
lang['post_trade_goodsname_null'] = '{lang post_trade_goodsname_null}';
lang['post_trade_price_null'] = '{lang post_trade_price_null}';
lang['post_trade_addr_null'] = '{lang post_trade_addr_null}';
</script>

{template post_preview}

<form method="post" id="postform" action="post.php?action=newtrade&fid=$fid&extra=$extra&topicsubmit=yes" $enctype>
	<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
	<input type="hidden" name="isblog" value="$isblog" />
	<input type="hidden" name="frombbs" value="1" />
	<input type="hidden" name="special" value="2" />

	<div class="mainbox formbox">
		<span class="headactions"><a href="member.php?action=credits&view=forum_post&fid=$fid" target="_blank">{lang credits_policy_view}</a></span>
		<h1>{lang post_newthread_trade}</h1>
		<table summary="post" cellspacing="0" cellpadding="0">
			<thead>
				<tr>
					<th>{lang username}</th>
					<td>
						<!--{if $discuz_uid}-->
							$discuz_userss [<a href="$link_logout">{lang member_logout}</a>]
						<!--{else}-->
							{lang guest} [<a href="$link_login">{lang member_login}</a>]
						<!--{/if}-->
					</td>
				</tr>
			</thead>

		<!--{if $seccodecheck}-->
			<tr>
				<th><label for="seccodeverify">{lang seccode}</label></th>
				<td>
					<div id="seccodeimage"></div>
					<input type="text" onfocus="updateseccode();this.onfocus = null" id="seccodeverify" name="seccodeverify" size="8" maxlength="4" />
					<em class="tips"><strong>{lang seccode_click}</strong> <!--{if $seccodedata['type'] == 2}-->{lang seccode_animator_flashrefresh}<!--{elseif $seccodedata['animator'] == 1}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></em></td>
					<script type="text/javascript">
						var seccodedata = [{$seccodedata['width']}, {$seccodedata['height']}, {$seccodedata['type']}];
					</script>
			</tr>
		<!--{/if}-->

		<!--{if $secqaacheck}-->
			<tr><th><label for="secanswer">{lang secqaa}</label></th>
			<td><div id="secquestion"></div><input type="text" name="secanswer" id="secanswer" size="25" maxlength="50" />
			<script type="text/javascript">
			<!--{if ($attackevasive & 1) && $seccodecheck}-->
				setTimeout("ajaxget('ajax.php?action=updatesecqaa&inajax=1', 'secquestion')", 2001);
			<!--{else}-->
				ajaxget('ajax.php?action=updatesecqaa&inajax=1', 'secquestion');
			<!--{/if}-->
			</script></td>
			</tr>
		<!--{/if}-->

		<tr>
			<th><label for="subject">{lang subject}</label></th>
			<td>
				<!--{if $iscircle && $mycircles}-->
					<select name='sgid'>
						<option value="0">{lang circle_select_please}</option>
						<!--{loop $mycircles $id $name}-->
						<option value="$id">$name</option>
						<!--{/loop}-->
					</select>
				<!--{else}-->
					$typeselect
				<!--{/if}-->
				<input type="text" name="subject" id="subject" size="45" value="$subject" tabindex="3" />
			</td>
		</tr>

		<thead>
			<tr>
				<th>{lang post_trade_counterinfo}</th>
				<td>&nbsp;</td>
			</tr>
		</thead>

		<tr>
		<th><label for="threaddesc">{lang post_trade_counterdesc}</label></th>
		<td><textarea name="counterdesc" id="counterdesc" rows="10" cols="20" style="width:99%; height:60px" tabindex="4"></textarea></td>
		</tr>

		<tr>
		<th><label for="aboutthread">{lang post_trade_aboutcounter}</label></th>
		<td><textarea name="aboutcounter" id="aboutcounter" rows="10" cols="20" style="width:99%; height:60px" tabindex="5"></textarea></td>
		</tr>

		<thead>
			<tr>
				<th>{lang post_goodsinfo}</th>
				<td>&nbsp;</td>
			</tr>
		</thead>

		{template post_trade}

		<thead>
			<tr>
				<th>&nbsp;</th>
				<td><label><input id="advshow" class="checkbox" type="checkbox" onclick="showadv()" tabindex="201" />{lang post_otherinfo}</label></td>
			</tr>
		</thead>
		<tbody id="adv" style="display: none">

			<!--{if $allowsetreadperm}-->
				<tr>
					<th><label for="readperm">{lang readperm_thread}</label></th>
					<td><input type="text" name="readperm" id="readperm" size="6" value="$readperm" tabindex="202" /> <em class="tips">({lang post_zero_is_nopermission})</em></td>
				</tr>
			<!--{/if}-->

			</tbody>
			<tr class="btns">
				<th>&nbsp;</th>
				<td>
					<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />
					<button type="submit" name="topicsubmit" id="postsubmit" value="true" tabindex="300">{lang post_newthread_trade}</button>
					<em>{lang post_submit_hotkey}</em>&nbsp;&nbsp;
					&nbsp;<a href="###" id="restoredata" onclick="loadData()" title="{lang post_autosave_last_restore}">{lang post_autosave_restore}</a>
				</td>
			</tr>
		</table>
	</div>
<br />

</form>

<script type="text/javascript">
	function showadv() {
		if($("advshow").checked == true) {
			$("adv").style.display = "";
		} else {
			$("adv").style.display = "none";
		}
	}
</script>

{template post_js}

{template footer}