<div class="login_page">
	<div class="login-page">
		<div class="login-form">
			<h4>{{LANG sign_up}}</h4>
			<form action="{{LINK register}}" method="POST">
				<div class="errors form-group">{{ERRORS}}</div>
				<div class="errors success form-group">{{SUCCESS}}</div>
				<div class="pp_mat_input">
					<input type="text" name="username" id="username" placeholder="{{LANG username}}" required value="{{USERNAME}}" autofocus>
					<label for="username">{{LANG username}}</label>
				</div>
				<div class="pp_mat_input">
					<input type="email" name="email" id="email" placeholder="{{LANG email_address}}" required value="{{EMAIL}}">
					<label for="email">{{LANG email_address}}</label>
				</div>
				<div class="pp_mat_input">
					<input type="password" name="password" id="password" placeholder="{{LANG password}}" required>
					<label for="password">{{LANG password}}</label>
				</div>
				<div class="pp_mat_input">
					<input type="password" name="c_password"  id="c_password" placeholder="{{LANG confirm_password}}" required>
					<label for="c_password">{{LANG confirm_password}}</label>
				</div>
				<div class="pp_mat_input">
					<select name="gender" id="gender" required>
						<option value="male">{{LANG male}}</option>
						<option value="female">{{LANG female}}</option>
					</select>
				</div>
				{{CUSTOM_FIELDS}}
				<div class="recaptcha">{{RECAPTCHA}}</div>
				<div class="login_signup_combo">
					<input type="submit" class="btn btn-main button" value="{{LANG sign_up}}">
				</div>
				<div class="terms">
					<label for="accept_terms">
						<input type="checkbox" name="accept_terms" id="accept_terms">{{LANG terms_agreement}}
						<a href="{{LINK terms/terms}}">{{LANG terms_of_use}}</a> & <a href="{{LINK terms/privacy-policy}}">{{LANG privacy_policy}}</a>
					</label>
					<div class="clear"></div>
				</div>
				<hr>
				<div class="signup__">
					{{LANG already_have_account}} <a class="dec" href="{{LINK login}}">{{LANG login_}}</a>
				</div>
				<input type="hidden" id="checked" value="off" name="terms">
				<?php if (isset($_GET['invite'])): ?>
					<input type="text" class="hidden" value="<?php echo $_GET['invite']; ?>" name="invited">
				<?php endif; ?>
			</form>
		</div>    
	</div>
</div>
<script>
$(function() {
	$("#accept_terms").change(function() {
	    if(this.checked) {
	        $('#checked').val('on');
	    } else {
	    	$('#checked').val('off');
	    }
	});
	$('.button').on('click', function () {
		if ($('#username').val() && $('#password').val() && $('#email').val() && $('#gender').val() && $('#c_password').val()) {
			$(this).val("{{LANG please_wait}}");
		}
	});
});
</script>