<script type="text/javascript">
	document.ready=function()
    {
        var sizelimit = {about_sizelimit};
        if(sizelimit <= 0 ) { document.getElementById('sizelimit_text').style.display = "none"; }
    }
	function validate_form() {
		var f = document.getElementById('profileForm');
		// 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("{{ info_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="box_in dark_top userinfo_top">
	<h2 class="section_name" style="margin-bottom: 0px;">{{ lang.uprofile['profile_of'] }} {{ user.name }}</h2>
</div>
<article class="box_content">
	<div class="box_in">
		<div class="tab-content">
			<div class="addform">
				<ul class="ui-form">
					{% if pluginIsActive('xfields') %}{{ plugin_xfields_1 }}{% endif %}
					<li class="form-group">
						<label>{{ lang.uprofile['email'] }}</label>
						<input type="email" name="editmail" value="{{ user.email }}" class="wide" required>
					</li>
					<li class="form-group">
						<label>{{ lang.uprofile['from'] }}</label>
						<input type="text" name="editfrom" value="{{ user.from }}" class="wide"/>
					</li>
					<li class="form-group form-sep"></li>
					<li class="form-group">
						<label>{{ lang.uprofile['about'] }}</label>
						<textarea name="editabout" rows="5" class="wide">{{ user.info }}</textarea>
					</li>
					<li class="form-group form-sep"></li>
					<li class="form-group">
						<label>{{ lang.uprofile['new_pass'] }}</label>
						<input type="password" name="editpassword" value="" class="wide">
					</li>
					<li class="form-group">
						<label>{{ lang.uprofile['oldpass'] }}</label>
						<input type="password" name="oldpass" value="" class="wide">
					</li>
					<li class="form-group form-sep"></li>
					{% if (flags.avatarAllowed) %}
						<li class="form-group">
							<label>{{ lang.uprofile['avatar'] }}</label>
							<input type="file" name="newavatar" class="wide" />
						</li>
						{% if (user.flags.hasAvatar) %}
							<li class="form-group">
								<img src="{{ user.avatar }}" style="margin: 5px; border: 0px; max-width: 80px; max-height: 80px;" alt=""/>
								<div class="checkbox"><input type="checkbox" name="delavatar" id="delavatar" /> <label>{{ lang.uprofile['delete'] }}</label></div>
							</li>
						{% endif %}
					{% else %}
						<li class="form-group">
							<label>{{ lang.uprofile['avatar'] }}</label>
							{{ lang.uprofile['avatars_denied'] }}
						</li>
					{% endif %}
					{% if pluginIsActive('xfields') %}{{ plugin_xfields_0 }}{% endif %}
				</ul>
				<div class="form_submit">
					<button class="btn btn-big swipe_effect" type="submit"><b>{{ lang.uprofile['save'] }}</b></button>
				</div>
			</div>
		</div>
	</div>
</article>
</form>