<script type="text/javascript">
function validate_form() {
 var f = document.getElementById('profileForm');

 // ICQ
 var icq = f.editicq.value;
 if ((icq.length > 0)&&(! icq.match(/^\d{4,10}$/))) { 
 	alert("{{ lang.uprofile['wrong_icq'] }}"); 
 	return false; 
 }

 // Email
 var email = f.editmail.value;
 if ((email.length > 0) && (! emailCheck(email))) {
 	alert("{{ lang.uprofile['wrong_email'] }}");
 	return false;
 }

 // About
 var about = f.editabout.value;
 if (({{ about_sizelimit }} > 0) && (about.length > {{ about_sizelimit }})) {
 	alert("{{ about_sizelimit_text }}");
 	return false;	
 }
 return true;
}
</script>
<form id="profileForm" method="post" action="{{ form_action }}" enctype="multipart/form-data">
<input type="hidden" name="token" value="{{ token }}"/>
<div class="s-block">
	<div class="title-block">
		Редактирование профиля
	</div>
	<div class="s-block-content" style="min-height: 0px;">	
		<div class="user-info-table">
			<div class="user-left-col-block">
				<span>E-mail адрес:</span><br>
				<input type="text" name="editmail" value="{{ user.email }}" /><br><br>
				<span>Сайт:</span><br>
				<input type="text" name="editsite" value="{{ user.site }}" /><br><br>
				<span>Номер ICQ:</span><br>
				<input type="text" name="editicq" value="{{ user.icq }}" /><br><br>
				<span>Место жительства:</span><br>
				<input type="text" name="editfrom" value="{{ user.from }}" /><br><br>
				<span>Новый пароль:</span><br>
				<input type="password" name="editpassword" /><br><br>
				<span>Ваш текущий пароль:</span><br>
				<input type="password" name="oldpass" value="" /><br><br>
				{% if pluginIsActive('xfields') %}{{ plugin_xfields_1 }}{% endif %}
			</div>
			<div class="user-right-col-block">
				<span>О себе:</span><br>
				<textarea style="width:320px; height:70px" name="editabout">{{ user.about }}</textarea><br><br>
				{% if (flags.photoAllowed) %}
				<span>Фотография:</span><br>
				<input type="file" name="newphoto" /><br />{% if (user.flags.hasPhoto) %}<a href="{{ user.photo }}" target="_blank"><img src="{{ user.photo_thumb }}" style="margin: 5px; border: 0px; alt=""/></a><br/><input type="checkbox" name="delphoto" id="delphoto" />&nbsp;<label for="delphoto">{{ lang.uprofile['delete'] }}</label>{% endif %}<br><br>
				{% else %}{{ lang.uprofile['photos_denied'] }}{% endif %}
				{% if (flags.avatarAllowed) %}
				<span>Аватар:</span><br>
				<input type="file" name="newavatar" /><br />{% if (user.flags.hasAvatar) %}<img src="{{ user.avatar }}" style="margin: 5px; border: 0px; alt=""/><br/><input type="checkbox" name="delavatar" id="delavatar" />&nbsp;<label for="delavatar">{{ lang.uprofile['delete'] }}</label>{% endif %}<br><br>
				{% else %}{{ lang.uprofile['avatars_denied'] }}{% endif %}
				{% if pluginIsActive('xfields') %}{{ plugin_xfields_0 }}{% endif %}
				<div style="padding-top:2px; padding-left:0px;">
					<input type="image" src="{{ tpl_url }}/images/otprav.png" name="submit" alt="Отправить" style="border: 0;"><br>
					<input type="hidden" name="plugin_cmd" value="apply" />
				</div>
				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
</div>
</form>