{subtemplate header}

<div id="nav"><a href="$indexname">$bbname</a> $navigation &raquo; <!--{if $isfirstpost}-->{lang video_edit_thread}<!--{else}-->{lang post_editpost}<!--{/if}--></div>
<script type="text/javascript" src="include/javascript/video.js"></script>
<script type="text/javascript">
var postminchars = parseInt('$minpostsize');
var postmaxchars = parseInt('$maxpostsize');
var disablepostctrl = parseInt('$disablepostctrl');
var typerequired = parseInt('$forum[threadtypes][required]');
var tagrequired = parseInt('$forum[allowtag]');
var attachments = new Array();
var bbinsert = parseInt('$bbinsert');
var attachimgurl = new Array();
var isfirstpost = parseInt('$isfirstpost');
var special = parseInt('$special');
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_tag_isnull'] = '{lang post_tag_isnull}';
lang['post_activity_sort_null'] = '{lang post_activity_sort_null}';
lang['post_activity_fromtime_null'] = '{lang post_activity_fromtime_null}';
lang['post_activity_addr_null'] = '{lang post_activity_addr_null}';
</script>

{template post_preview}
<form method="post" id="postform" action="post.php?action=edit&extra=$extra&editsubmit=yes&mod=$mod" $enctype onSubmit="return validate(this)">
	<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
	<input type="hidden" name="page" value="$page" />

	<div class="mainbox formbox">
	<h1><!--{if $isfirstpost}-->{lang video_edit_thread}<!--{else}-->{lang post_editpost}<!--{/if}--></h1>
	<table summary="" 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>

		<tr>
			<th><label for="subject">{lang video_subject}</label></th>
			<td>
				$typeselect
				<input type="text" name="subject" id="subject" size="45" value="$postinfo[subject]" tabindex="3" />
				<input type="hidden" name="origsubject" value="$postinfo[subject]" />
				<input type="hidden" name="activity" value="yes" />
			</td>
		</tr>
		<thead>
			<tr>
				<th>{lang video_upload}</th>
				<td>&nbsp;</td>
			</tr>
		</thead>
		<tr>
			<th valign="top"><label for="subject">{lang video_title}</label></th>
			<td style="border-bottom: 0">
				<script type="text/javascript">
					function v_onComplete(vid, vlength) {
						document.getElementById('vid').value = vid;
						document.getElementById('vlength').value = vlength;
					}
				</script>
				$vtypeselect &nbsp; <input type="text" name="vsubject" size="41">&nbsp;&nbsp;<input type="checkbox" name="vautoplay" value="1">{lang video_auto}
				<input type="checkbox" name="vshare" value="1" checked>{lang video_share}
				<input type="hidden" name="vid" id="vid" value="">
				<input type="hidden" name="vlength" id="vlength" value="">
			</td>
		</tr>
		<tr>
			<th valign="top">{lang video_tag}</th>
			<td valign="top">
				<p><input type="text" name="vtag" size="53">&nbsp;&nbsp;{lang video_tag_tips}</p>
			</td>
		</tr>
		<tr>
			<th valign="top">{lang video_upload}</th>
			<td valign="top"><!--{if $videoupload}-->$videoupload<!--{else}-->{lang video_key_invalid}<!--{/if}--></td>
		</tr>		
		<tr>
			<th><label for="subject">{lang video_list}</label></th>
			<td>
				<table cellspacing="0" cellpadding="0" summary="Video Edit">
					<thead class="separation">
						<tr><td class="selector">{lang delete_check}</td><td>{lang video_displayorder}</td><td>{lang video_title}</td><td class="selector">{lang delete_check}</td><td>{lang video_displayorder}</td><td>{lang video_title}</td></tr>
					</thead>
					<tbody>
						<!--{loop $videolist $key $video}-->
							<!--{if $key && $key % 2 == 0}-->
								</tr><tr>
							<!--{/if}-->
							<td><input type="checkbox" name="deletevideo[]" value="$video[vid]"></td>
							<td><input name="displayorder[{$video[vid]}]" value="$video[displayorder]" size="1"></td>
							<td><input name="vtitle[{$video[vid]}]" value="$video[vtitle]" size="40"></td>
						<!--{/loop}-->
						</tr>
					</tbody>
				</table>
			</td>
		</tr>

		<tr>{template post_editor}</tr>

		<!--{if $isfirstpost && $tagstatus}-->
			<tr>
				<th><label for="tags">{lang post_tag}</label></th>
				<td>
					<input size="45" type="input" id="tags" name="tags" value="$threadtags" tabindex="200" />&nbsp;
					<button onclick="relatekw();return false">{lang searchtags}</button><span id="tagselect"></span>
					<em class="tips">{lang tag_comment}</em>
				</td>
			</tr>
		<!--{/if}-->

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

		<!--{if $allowsetreadperm && $isfirstpost}-->
			<tr>
			<th>{lang readperm_thread}</th>
			<td><input type="text" name="readperm" size="6" value="$thread[readperm]" tabindex="206" /> <span class="smalltxt">({lang post_zero_is_nopermission})</span></td>
			</tr>
		<!--{/if}-->
		<tr class="btns">
			<th>&nbsp;</th>
			<td>
				<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode">
				<input type="hidden" name="fid" id="fid" value="$fid">
				<input type="hidden" name="tid" value="$tid">
				<input type="hidden" name="pid" value="$pid">
				<input type="hidden" name="postsubject" value="$postinfo[subject]">
				<button type="submit" class="submit" name="editsubmit" id="postsubmit" tabindex="300">{lang video_edit_thread}</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>
	{template post_editpost_attachlist}
</form>

{template post_js}

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

{subtemplate footer}