<script type="text/javascript">
<!--
function checkForm() {
	spanError = document.getElementById('error');
	var checkRegExp = new RegExp("^[ \t]*$");
	var checkRegExpMail = new RegExp("^\\w[\\w+\.\-]*@[\\w\-]+\.\\w[\\w+\.\-]*\\w$", "gi");
	if (document.user.users_login.value.length == 0
		|| checkRegExp.test(document.user.users_login.value)) {
		spanError.innerHTML = "<?php echo T_('Login empty.'); ?>";
		spanError.className = "usvn_error";
		return false;
	}
	<?php if (!isset($this->user)) : ?>
		if ((!document.user.users_password.value.length || !document.user.users_password2.value.length)) {
			spanError.innerHTML = "<?php echo T_('Password empty.');?>";
			spanError.className = "usvn_error";
			return false;
		}
		if (document.user.users_password.value.length < 8 && (!document.user.users_id ||
			document.user.users_password.value.length >= 1)) {
			spanError.innerHTML = "<?php echo T_('Password incorrect (need more 8 characters).');?>";
			spanError.className = "usvn_error";
			return false;
		}
		if (document.user.users_password.value != document.user.users_password2.value) {
			spanError.innerHTML = "<?php echo T_('Password incorrect (not the same).');?>";
			spanError.className = "usvn_error";
			return false;
		}
	<?php endif; ?>
	if (document.user.users_email.value.length != 0
		&& !checkRegExpMail.test(document.user.users_email.value)) {
		spanError.innerHTML = "<?php echo T_('Email incorrect.');?>";
		spanError.className = "usvn_error";
		return false;
	}
	spanError.innerHTML = '';
	spanError.className = "";
	return true;
}
-->
</script>
