<script type="text/javascript" src="{{ scriptLibrary }}/libsuggest.js"></script>
<style>
	.suggestWindow {
		background: #f9f9f9;
		border: 1px solid #efefef;
		width: 316px;
		position: absolute;
		display: block;
		visibility: hidden;
		padding: 0px;
		font: normal 12px tahoma, sans-serif;
		top: 0px;
		margin: 0;
		left: 80px;
		z-index: 100;
	}

	#suggestBlock {
		padding-top: 2px;
		padding-bottom: 2px;
		width: 100%;
		border: 0px;
	}

	#suggestBlock td {
		padding-left: 2px;
	}

	#suggestBlock tr {
		padding: 3px;
		padding-left: 8px;
		background: white;
	}

	#suggestBlock .suggestRowHighlight {
		background: #59a6ec;
		color: white;
		cursor: default;
	}

	#suggestBlock .cleft {
		padding-left: 5px;
	}

	#suggestBlock .cright {
		text-align: right;
		padding-right: 5px;
	}

	.suggestClose {
		display: block;
		text-align: right;
		font: normal 10px verdana, tahoma, sans-serif;
		background: #efefef;
		padding: 5px;
		cursor: pointer;
	}
</style>
<div class="post">
	<div class="postinfotop">
		<h2>{{ lang['pm:pm'] }}</h2>
	</div>
	<div class="accsection">
		<div class="topwrap">
			<form method=post name=form action="{{ php_self }}?action=send" class="form newtopic">
			<table class="table table-striped table-bordered">
				<tr align="center">
					<td colspan="2">
						<a href="{{ pm_inbox_link }}">{{ lang['pm:inbox'] }}</a> | <a href="{{ pm_outbox_link }}">{{ lang['pm:outbox'] }}</a> | <a href="{{ pm_set_link }}">{{ lang['pm:set'] }}</a>
					</td>
				</tr>
				<tr>
					<td width="30%">{{ lang['pm:subject'] }}</td>
					<td width="70%"><input class="form-control" type="text" name="title" tabindex="2"/></td>
				</tr>
				<tr>
					<td width="30%">{{ lang['pm:too'] }}<br/><small>{{ lang['pm:to'] }}</small></td>
					<td width="70%"><input class="form-control" type="text" name="to_username" id="to_username" tabindex="3" autocomplete="off" value="{{ username }}"/><span id="suggestLoader" style="width: 20px; visibility: hidden;"><img src="{{ tpl_url }}/images/loading.gif"/></span></td>
				</tr>
				<tr>
					<td width="100%" colspan="2">
						<div>
							<div class="bb-editor">
								{{ quicktags }}
								<textarea name="content" id="pm_content" class="form-control"/></textarea>
							</div>
						</div>
					</td>
				</tr>
			</table>
			<div class="postinfobot">
				<div class="notechbox pull-left">
					<input name="saveoutbox" type="checkbox" class="form-control" />
				</div>
				<div class="pull-left lblfch">
					<label>{{ lang['pm:saveoutbox'] }}</label>
				</div>
				<div class="pull-right postreply">
					<div class="pull-left">
						<button class="btn btn-primary" type="submit">{{ lang['pm:send'] }}</button></form>
					</div>
					<div class="clearfix"></div>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
</div>
<script language="javascript" type="text/javascript">
	function systemInit() {
		new ngSuggest('to_username',
			{
				'iMinLen': 1,
				'stCols': 1,
				'stColsClass': ['cleft'],
				'lId': 'suggestLoader',
				'hlr': 'true',
				'stColsHLR': [true],
				'reqMethodName': 'pm_get_username',
			}
		);
	}
	if (document.body.attachEvent) {
		document.body.onload = systemInit;
	} else {
		systemInit();
	}
</script>