<div class="login_form">
	<h2>{$lang.login.top_header}</h2>
	<!--form action="{$form.login_action}" method="post" name="login_form" style="margin: 0px"-->
		<div>
			<!--Alfira: add changes -->
			<label>{if $settings.use_method_auth eq 0}{$lang.users.nick}{elseif $settings.use_method_auth eq 1}{$lang.users.email}{elseif $settings.use_method_auth eq 2} {$lang.users.nick}&nbsp;/&nbsp;{$lang.users.email}{/if}: </label><div class="requiredbox">*</div>

			<p><input class="inputbox" type="text" size="30" name="login_lg" id="login_lg" value="{if $demo_module eq 1}demo{/if}" onFocus="javascript: this.value='';"></p>
		</div>
		<div style="padding-top: 10px;">
			<label>{$lang.home_page.login_password}: </label><div class="requiredbox">*</div>
			<p>
				<input class="inputbox" type="password" size="30" name="pass_lg" id="pass_lg" value="{if $demo_module eq 1}123456{/if}" onFocus="javascript: this.value='';" onkeypress='javascript:if(event.keyCode == 13) CheckValid();'>
			</p>
		</div>
		<div style="padding: 10px 0 6px;">
			<a href="#" onclick="launchWindow('{$site_root}/{$seo.lost_pass}?ajax=1','',525,530); return false;" >{$lang.home_page.forgot_your_password}</a>
		</div>
		<div>
			<p><input type="checkbox" name="remember_me" id="remember_me" value="1" checked>&nbsp;{$lang.home_page.remember_me}</p>
		</div>
		<dl style="padding-top: 10px; height: 40px;">
			<dt style="width: 150px;">
				<input type="button" onclick="CheckValid();" value="{$lang.home_page.login}"/>
			</dt>
			<dd id="err" style="display: none;">
				<label>{$lang.err.login_bad}</label>
			</dd>
		</dl>
		<div>
			<p><label>{$lang.home_page.reg_text}</label></p>
			<p>
				<a class="imgbox_icon">&nbsp;</a>
				<a href="{$server}/{if $use_seo_url_prefix}{$seo_url_prefix}/{/if}registration.php" >{$lang.home_page.reg_link_text}</a>
				{if $use_vk_connect eq 1}<img src="{$server}{$index_theme_path}{$index_theme_images_path}/vkontakte_login_icon.png" onclick="location.href='http://api.vkontakte.ru/oauth/authorize?client_id={$vk_api_id}&scope=&response_type=code&redirect_uri={$server}/{if $use_seo_url_prefix}{$seo_url_prefix}/{/if}vk_connect.php';" style="cursor:pointer;float:right;padding-left: 10px;margin-top: -3px;">{/if}
				{if $use_facebook_connect eq 1}<img src="{$server}{$index_theme_path}{$index_theme_images_path}/fb_connect_light_medium_short.gif" onclick="location.href='{$site_root}/facebook_connect/index.php';" style="cursor:pointer;float:right;padding-left: 10px;margin-top: -3px;">{/if}
			</p>
		</div>
	<!--/form-->
</div>

{literal}
<script type="text/javascript">

function CheckValid()
{
	/*bp=document.login_form;
	if(bp.login_lg.value=="")
	{
		alert('Wrong login. Possibly inaccessible symbols are used');return;
	}
	if(bp.pass_lg.value=="")
	{
		alert('Wrong password');
		return;
	}*/
	bp_login_lg = $("#login_lg").val();
	bp_pass_lg = $("#pass_lg").val();
	bp_remember_me = $("#remember_me").val();
	if(bp_login_lg=="")
	{
		alert('Wrong login. Possibly inaccessible symbols are used');return;
	}
	if(bp_pass_lg=="")
	{
		alert('Wrong password');
		return;
	}
	$.post(SITE_ROOT+"/index.php", {login_lg:bp_login_lg, pass_lg:bp_pass_lg, remember_me:bp_remember_me},function(data){
	   if(data == "error")
            $("#err").css("display", "block");
       else
            document.location.href = SEO_SITE_ROOT+"/homepage.php";
	});
    //document.login_form.submit();
}
</script>
{/literal}
