<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:strip-space elements="*"/>
	<xsl:output method="html" indent="yes" encoding="utf-8"/>
	
	<xsl:template match="PANEL[@TYPE='LOGIN']">		
		<script type="text/javascript" src="/js/Login.js?{$version}.{$build}"/>
		
		<form name="loginForm" method="post" id="loginForm" onsubmit="javascript:return validateForm();">
			<xsl:attribute name="action"><xsl:value-of select="@ACTION"/></xsl:attribute>

			<input type="hidden" name="byChangeLocale"/>
			<table width="100%" border="0">
				<tr>
					<td align="center" style="padding-top: 40px" >
						<table cellspacing="0" cellpadding="0" border="0" class="sb-logintable">
							<tr><td class="sb-logintitle" colspan="2"><xsl:value-of select="@TITLE"/></td></tr>
							<xsl:if test="../../STATUS">
								<tr>
									<td>
										<xsl:apply-templates select="../../STATUS" mode="admin">
											<xsl:with-param name="controlStyle">padding: 10px 10px 0px 10px;</xsl:with-param>
										</xsl:apply-templates>
									</td>
								</tr>
							</xsl:if>
							<tr>
								<td style="padding: 10px 10px 10px 10px;">
									<table width="100%" border="0">
										<tr>
											<td colspan="2" class="sb-login-description"><xsl:value-of select="@DESCRIPTION"/></td>
										</tr> 
										<tr>
											<td class="sb-login-control-title"><xsl:value-of select="CONTROL[@NAME='username']/@TITLE"/><span id="username_asterix" class="sb-asterix"> *</span></td>
											
											<td>
												<xsl:apply-templates select="CONTROL[@NAME='username']" mode="TITLE-NONE">
													<xsl:with-param name="controlClass">sb-login-control</xsl:with-param>
													<xsl:with-param name="tabindex">1</xsl:with-param>
													<xsl:with-param name="controlStyle">width:145px;</xsl:with-param>
												</xsl:apply-templates>
												
											</td>
										</tr> 
										<tr>
											<td class="sb-login-control-title"><xsl:value-of select="CONTROL[@NAME='password']/@TITLE"/><span id="password_asterix" class="sb-asterix"> *</span></td>
											<td>
												<xsl:apply-templates select="CONTROL[@NAME='password']" mode="TITLE-NONE">
													<xsl:with-param name="controlClass">sb-login-control</xsl:with-param>
													<xsl:with-param name="type">password</xsl:with-param>
													<xsl:with-param name="controlStyle">width:145px;</xsl:with-param>
												</xsl:apply-templates>
											</td>
										</tr>
										<tr>
											<td class="sb-login-control-title"><xsl:value-of select="CONTROL[@TYPE='COMBO-BOX']/@TITLE"/></td>
											<td>
												<xsl:apply-templates select="CONTROL[@TYPE='COMBO-BOX']">
													<xsl:with-param name="controlClass">sb-login-control</xsl:with-param>
													<xsl:with-param name="controlStyle">width:145px;</xsl:with-param>
													<xsl:with-param name="onChange">chLocale();</xsl:with-param>
												</xsl:apply-templates>
											</td>
										</tr>
<!--										<tr> -->
<!--											<td valign="middle" colspan="2">
												<input type='checkbox'>
													<xsl:attribute name='name'><xsl:value-of select="REMEMBER-ME/@NAME"/></xsl:attribute>
													<xsl:attribute name='id'><xsl:value-of select="REMEMBER-ME/@NAME"/></xsl:attribute>
													<xsl:attribute name='value'><xsl:value-of select="REMEMBER-ME/@VALUE"/></xsl:attribute>
												</input>
												&#160;
												<label>
													<xsl:attribute name='for'>
														<xsl:value-of select="REMEMBER-ME/@NAME"/>
													</xsl:attribute>
													<xsl:value-of select="REMEMBER-ME/@TITLE"/>
												</label>
											</td> -->
<!--											<td class="sb-login-control-title"><xsl:value-of select="REMEMBER-ME/@TITLE"/></td> -->
<!--										</tr>  -->
										<tr>
											<td>
												<a class="sb-login-description">
													<xsl:attribute name='href'><xsl:value-of select="$baseUrl"/>/ForgetPassword</xsl:attribute>
													<xsl:value-of select="FORGOT-PASSWORD/@TITLE"/>
												</a>
											</td>
											
											<td align="right">
											
												<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 5px;">
													<tr>
														<td align="left">
															<xsl:if test="VZ[@VALUE='1']">
																<img border="0" src="{$skinPath}/images/powered_by_virtuozzo.gif" alt=""/>
															</xsl:if>
														</td>
														<td align="right">
															<xsl:apply-templates select="CONTROL[@TYPE='BUTTON']">
																<xsl:with-param name="class">sb-login-control-button</xsl:with-param>
																<xsl:with-param name="action">javascript:validateForm();</xsl:with-param>
															</xsl:apply-templates>
														</td>
													</tr>
												</table>
												
												<!-- input image needed for work default submit via Enter -->
												<input type="image" style="border-width: 0px; height: 0px; width: 0px;"/>
											</td>
										</tr>
										
										<tr>
											<td colspan="2" class="sb-login-description">
												<xsl:call-template name="REQUIRED-FIELDS"/>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table> 
					</td>
				</tr>
			</table>
		</form>
		<script language="javascript">
			function chLocale() {
				if (0 != document.forms.loginForm.interfaceLanguage.value) {
					document.forms.loginForm.byChangeLocale.value=1;
					document.forms.loginForm.submit();
				}
			}
		</script>
	</xsl:template>

	<xsl:template match="SITEBUILDER-PAGE">
		<table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 100%">
			<tr>
				<td class="sb-adminpanel-header">
					<xsl:if test="NAVIGATION">
						<xsl:attribute name="colspan">2</xsl:attribute>
					</xsl:if>
					<table class="sb-adminpanel-header-inner" border="0" width="100%">
						<tr>
							<td valign="middle" style="padding-left:20;">
								<xsl:call-template name="HEADER-LOGO"/>
							</td>
                        	<td align="right" class="sb-header-copyright" style="padding-right: 15px;"><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/COPYRIGHT"/><br/><xsl:value-of select="/SITEBUILDER-PAGE/LOCALE/ALL-RIGHTS-RESERVED"/></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr><td valign="top" class="sb-page"><xsl:apply-templates select="VIEW-CONTENT/PANEL"/></td></tr>
		</table>
		
		<script language="javascript">
			RegisterOnloadAction('elem = document.getElementById(\'username\');if(elem) elem.focus();');
		</script>
	</xsl:template>


	<xsl:template name="MAIN-PAGE-CONTENT">
		<tr>
			<td valign="top">
				<xsl:apply-templates select="VIEW-CONTENT"/>
			</td>
		</tr>
	</xsl:template>
	
	<xsl:template name="MAIN-PAGE-FOOTER">
		<!-- Nothing to do in PAGE-FOOTER -->
	</xsl:template>
    
</xsl:stylesheet>