<form method="post" id="postform" action="pm.php?action=send&pmsubmit=yes" onSubmit="return validate(this)">
<!--{if $folder == 'outbox'}-->
	<input type="hidden" name="pmid" value="$pmid">
<!--{/if}-->
<input type="hidden" name="formhash" value="{FORMHASH}">
<div class="spaceborder" style="width: 100%">
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
<tr>
<td width="100%" colspan="2" class="header"><a href="member.php?action=credits&view=pm" target="_blank"><img src="{IMGDIR}/credits.gif" alt="{lang credits_policy_view}" align="right" border="0" /></a>{lang pm_send}</td>
</tr>

<!--{if $seccodecheck}-->
	<tr>
	<td class="altbg1" width="18%"><span class="bold">{lang seccode}</span></td>
	<td class="altbg2"><div id="seccodeimage"></div><input type="text" name="seccodeverify" size="4" maxlength="4"> <span class="smalltxt"><!--{if $seccodedata['animator']}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></span></td>
	</tr>
	<script type="text/javascript">
	<!--{if $attackevasive & 1}-->
		setTimeout("updateseccode($seccodedata['width'], $seccodedata['height'])", 2001);
	<!--{else}-->
		updateseccode($seccodedata['width'], $seccodedata['height'])
	<!--{/if}-->
	</script>
<!--{/if}-->

<!--{if $secqaacheck}-->
	<tr>
	<td class="altbg1" width="18%"><span class="bold">{lang secqaa}</span></td>
	<td class="altbg2"><div id="secquestion"></div><input type="text" name="secanswer" size="25" maxlength="50"></td>
	</tr>
	<script type="text/javascript">
	<!--{if $attackevasive & 1}-->
		<!--{if $seccodecheck}-->
			setTimeout("updatesecqaa()", 4002);
		<!--{else}-->
			setTimeout("updatesecqaa()", 2001);
		<!--{/if}-->
	<!--{else}-->
		updatesecqaa();
	<!--{/if}-->
	</script>
<!--{/if}-->

<tr><td class="altbg1" width="18%"><span class="bold">{lang to}</span></td>
<td class="altbg2" width="82%"><input type="text" name="msgto" size="65" value="$touser"></td></tr>

<!--{if $buddylist}-->
	<tr><td class="altbg1" valign="top" id="buddy"><span class="bold">{lang pm_to_buddy}</span>&nbsp;&nbsp;&nbsp;&nbsp;
	<span class="smalltxt">{lang checkall}</span><input class="checkbox" type="checkbox" name="chkall" onclick="checkall(this.form, 'msgtobuddys')"></td>
	<td class="altbg2">
	<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td>
	<!--{loop $buddylist $key $buddy}-->
		<!--{if $key % 3 == 0}--></td></tr><tr><td width="33%" nowrap><!--{else}--></td><td width="33%" nowrap><!--{/if}-->
		<input class="checkbox" type="checkbox" name="msgtobuddys[]" value="$buddy[buddyid]"> $buddy[buddyname]
	<!--{/loop}-->
	</table>
	</td></tr>
<!--{/if}-->

<tr>
<td class="altbg1"><span class="bold">{lang subject}</span></td>
<td class="altbg2"><input type="text" name="subject" size="65" value="$subject"></td>
</tr>

<tr class="bottom">
<td valign="top" class="altbg1"><span class="bold">{lang message}</span><br><br>
<!--{if $smileyinsert && $_DCACHE['smiliestable']}-->
	<div id="smiliestable"><div id="smtbl_1"><table cellpadding="3" cellspacing="0" width="80%" border="0" align="center">
	<script language="javascript">document.write('$_DCACHE[smiliestable]');</script>
	<!--{if $smmultipage}-->
		<tr><td colspan="$smcols">$smmultipage</td></tr>
	<!--{/if}-->
	</table></div></div>
	<!--{if $smpage > 1}-->
		<script type="text/javascript">
			<!--{if $attackevasive & 1}-->setTimeout('getSmilies()', 2001);<!--{else}-->getSmilies();<!--{/if}-->
		</script>
	<!--{/if}-->
<!--{/if}-->
</td>
<td class="altbg2"><textarea rows="8" cols="10" name="message" style="width: 100%; height:200px; word-break: break-all" onKeyDown="ctlent(event);">
<!--{if $do == 'reply'}-->
	[b]{lang pm_orig_message}:[/b] [url={$boardurl}pm.php?action=view&folder=inbox&pmid={$pm[pmid]}]$pm[subject][/url]{LF}
<!--{elseif $do == 'forward'}-->
	[b]{lang pm_orig_message}[/b] [url={$boardurl}pm.php?action=send&pmid=$pm[pmid]&do=reply]({lang reply})[/url]
	[b]{lang from}:[/b] [url={$boardurl}space.php?uid={$pm[msgfromid]}]$pm[msgfrom][/url]
	[b]{lang to}:[/b] [url={$boardurl}space.php?uid=$discuz_uid]$discuz_user[/url]
	[b]{lang time}:[/b] $pm[dateline]{LF}{LF}
<!--{/if}-->
$message
</textarea><br><span class="smalltxt"><input class="checkbox" type="checkbox" name="saveoutbox" value="1"<!--{if $folder == 'outbox'}--> checked<!--{/if}-->>{lang pm_send_save_outbox}</span>

</td>
</tr>

</table></div><br>
<div class="option" style="width: 100%"><div class="submitbutton"><input class="button" type="submit" name="pmsubmit" id="postsubmit" value="{lang submit}"></div></div>
</form>
<script type="text/javascript">
function validate(theform) {
	if (theform.subject.value == '' || theform.message.value == '') {
		alert("{lang post_subject_or_message_isnull}");
		theform.subject.focus();
		return false;
	} else if (theform.subject.value.length > 75) {
		alert("{lang post_subject_toolong}");
		theform.subject.focus();
		return false;
	}
	theform.message.value = parseurl(theform.message.value, 'bbcode');
	theform.pmsubmit.disabled = true;
	return true;
}
checkFocus();
setCaretAtEnd();
</script>