<script type="text/javascript" src="{{ scriptLibrary }}/libsuggest.js"></script>
<style>
.suggestWindow {
	background: #ffffff;
	border: 1px solid #4A6473;
	width: 160px;
	position: absolute;
	display: block;
	visibility: hidden;
	padding: 0px;
	font: normal 12px  tahoma, sans-serif;
	top: 0px;
	margin: 0;
	left: 80px;
	z-index: 99999;
}
#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: #3A5260;
	padding: 5px;
	cursor: pointer;
}
</style>
<form method=post name=form action="{{ php_self }}?action=send">
<div class="pm-page">
	<header class="sub-title"><h1>{{ lang['pm:pm'] }}</h1></header>
	<ul class="pm-menu">
		<li><a href="{{ pm_inbox_link }}">{{ lang['pm:inbox'] }}</a></li>
		<li><a href="{{ pm_outbox_link }}">{{ lang['pm:outbox'] }}</a></li>
		<li><a href="{{ pm_set_link }}">{{ lang['pm:set'] }}</a></li>
	</ul>
	<div class="form-wrap">
		<div class="form-item clearfix imp">
			<label>{{ lang['pm:too'] }}:</label>
			<input type="text" name="to_username" id="to_username" autocomplete="off" value="{{ username }}" placeholder="Кому" required />
		</div>
		<div class="form-item clearfix imp">
			<label>{{ lang['pm:subject'] }}:</label>
			<input type="text" name="title" placeholder="Тема" />
		</div>
		<div class="form-textarea">
			<div class="bb-editor">{{ quicktags }}<textarea onkeypress="if(event.keyCode==10 || (event.ctrlKey && event.keyCode==13)) {add_comment();}" name="content" id="pm_content"></textarea></div>
		</div>
		<div class="form-checks">
			<input name="saveoutbox" type="checkbox"/> 
			<label>{{ lang['pm:saveoutbox'] }}</label>
		</div>
	</div>
	<div class="form-submit" style="margin-top:10px;">
		<button type="submit">{{ lang['pm:send'] }}</button></form>
	</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>