<%@ Control Language="C#" AutoEventWireup="true" CodeFile="template.ascx.cs" Inherits="bitrix_components_bitrix_system_login_templates_web20_template" %>

<%@ Reference Control="~/bitrix/components/bitrix/system.login/component.ascx" %>

<div id="formTypeLogin" runat="server">
	<div id="login-form-window">
	<asp:Panel runat="server" ID="DefaultButtonWrapper" DefaultButton="LoginButton" >
		<a href="" onclick="return CloseLoginForm()" style="float:right;"><%= GetMessage("Close") %></a>

		<bx:BXValidationSummary ID="errorMessage" runat="server" BorderColor="Red"
			BorderStyle="Solid" BorderWidth="1px" CssClass="errorSummary" HeaderText="<%$ Loc:AuthorizationError %>"
			ValidationGroup="vgLoginForm11" ShowMessageBox="true" ShowSummary="false" />

		<table width="95%">
			<tr>
				<td colspan="2">
					<%= GetMessage("Legend.Login") %><br />
					<asp:TextBox ID="LoginField" runat="server" ValidationGroup="vgLoginForm11"></asp:TextBox>
					<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
						ControlToValidate="LoginField" Display="Dynamic" 
						ErrorMessage="<%$ Loc:Message.LoginIsRequired %>" 
						ValidationGroup="vgLoginForm11">*</asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<%= GetMessage("Legend.Password") %><br />
					<asp:TextBox ID="PasswordField" runat="server" TextMode="Password" 
						ValidationGroup="vgLoginForm11"></asp:TextBox><asp:RequiredFieldValidator 
						ID="RequiredFieldValidator4" runat="server" ControlToValidate="PasswordField"
						Display="Dynamic" ErrorMessage="<%$ Loc:Message.PasswordIsRequired %>"
						ValidationGroup="vgLoginForm11">*</asp:RequiredFieldValidator>
				</td>
			</tr>
			<tr>
				<td valign="top" colspan="2">
					<asp:CheckBox ID="CheckBoxRemember" runat="server" 
						Text="<%$ Loc:CheckBoxText.RememberMe %>" ValidationGroup="vgLoginForm11" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<asp:Button ID="LoginButton" runat="server" Text="<%$ Loc:ButtonText.Login %>" 
						ValidationGroup="vgLoginForm11" OnClick="LoginButton_Click" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<asp:HyperLink ID="hlForgotPassword" runat="server"><%= GetMessage("DoYouForgetYourRassword") %></asp:HyperLink>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<asp:HyperLink ID="hlRegister" runat="server"><%= GetMessage("Registration") %></asp:HyperLink>
					<br />
				</td>
			</tr>
		</table>	
		</asp:Panel>
	</div>
	

	<asp:Image ID="imgLogin" Width="10" Height="11" BorderWidth="0" runat="server" />&nbsp;&nbsp;<a href="" onclick="return ShowLoginForm();"><%= GetMessage("ButtonText.Login") %></a>&nbsp;&nbsp;&nbsp;&nbsp;<asp:Image ID="imgRegister" Width="8" Height="11" BorderWidth="0" runat="server" />&nbsp;&nbsp;<asp:HyperLink ID="hlRegister1" runat="server"><%= GetMessage("Registration") %></asp:HyperLink>

</div>


<div id="formTypeNonLogin" runat="server">

	<%= HttpUtility.HtmlEncode((HttpContext.Current.User.Identity as Bitrix.Security.BXIdentity).User.FirstName) %> <%= HttpUtility.HtmlEncode((HttpContext.Current.User.Identity as Bitrix.Security.BXIdentity).User.LastName) %> [<a href="<%= Component.ProfilePath %>" class="profile-link" title="<%= GetMessage("Profile") %>"><%= HttpUtility.HtmlEncode((HttpContext.Current.User.Identity as Bitrix.Security.BXIdentity).Name) %></a>]
	<asp:ImageButton ID="ibLogout" runat="server" AlternateText="<%$ Loc:Kernel.TopPanel.Logout %>" OnClick="ibLogout_Click" />

</div>