function form_user_login( form_email, form_remember ) {
var the_result =
'<form action="/user/login-action.php" method="post" onsubmit="return site_check_login_form( this );" name="the_login_form" id="the_login_form">' +
'<table border="0" cellspacing="0" cellpadding="0" class="formula">' +
'<tr><td class="formlabel">Email</td><td class="formfield-first"><input class="text" type="text" name="the_email" id="the_email" value="' + form_email + '" size="20" maxlength="30"><span class="aster">*</span></td></tr>' +
'<tr><td class="formlabel">Пароль</td><td class="formfield"><input class="text" type="password" name="the_password" id="the_password" value="" size="20" maxlength="30"><span class="aster">*</span></td></tr>' +
'<tr><td class="formlabel">&nbsp;</td><td class="formfield-last"><input type="checkbox" name="the_remember" id="the_remember" value="1"' + ( form_remember ? ' checked' : '' ) +'>запомнить меня<input type="hidden" name="the_lars" id="the_lars" value=""><br><input class="button" type="submit" id="the_submit_button" value="Войти" style="margin-top: 5px"></td></tr>' +
'</table></form>';

document.write(the_result);
}



function site_check_login_form( the_form ) {
	var the_submit_button = the_form.the_submit_button;
	
	var the_email_field = the_form.the_email;
	var the_password_field = the_form.the_password;
	var the_remember_field = the_form.the_remember;
	
	the_email_field.value = trim_string(the_email_field.value);
	the_password_field.value = trim_string(the_password_field.value);
	
	if ( the_email_field.value == '' ) {
		alert( 'Не заполнено обязательное поле "email"!' );
		the_email_field.focus();
		return false;
	}
	if ( !site_good_form_data( 'email', the_email_field.value ) ) {
		alert( 'Неверный формат поля "email"!\nДопустимые символы: латинские буквы, цифры, "дефис"\nМаксимальная длина: 30' );
		the_email_field.focus();
		return false;
	}
	if ( the_password_field.value == '' ) {
		alert( 'Не заполнено обязательное поле "пароль"!' );
		the_password_field.focus();
		return false;
	}
	if ( !site_good_form_data( 'password', the_password_field.value ) ) {
		alert( 'Неверный формат поля "пароль"!\nДопустимые символы: латинские буквы, цифры, "дефис"\nМаксимальная длина: 30' );
		the_password_field.focus();
		return false;
	}
	
	the_submit_button.disabled = true;
	return true;
}

