<div id="msg">
<form method="POST" action="%%GLOBAL_FormAction%%" onsubmit="return CheckForm(this);">
<table>
<tr>
	<th colspan="2">%%LNG_kbLoginRequired%%</th>
</tr>
<tr>
	<td colspan="2" style="line-height: 6px;">&nbsp;</td>
</tr>
<tr>
	<td colspan="2" style="color: red;">
		%%Panel.FrontendLoginError%%
	</td>
</tr>
<tr>
	<td>%%LNG_Username%%:</td>
	<td>
		<input type="text" id="frontendUser" name="frontendUser" value="">
	</td>
</tr>
<tr>
	<td>%%LNG_Password%%:</td>
	<td>
		<input type="password" id="frontendPass" name="frontendPass" value="">
	</td>
</tr>
<tr>
	<td>
	</td>
	<td>
		<input type="checkbox" name="frontendRemember" value="1">
		%%LNG_RememberMyLoginDetails%%
	</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td>
		<input type="submit" value="Login" class="button">
	</td>
</table>
</form>
</div>

<script type="text/javascript" language="javascript">

	function CenterForm()
	{
		var width=0;
		var height=0;
		if (typeof( window.innerWidth ) == 'number') {
			// Anything but IE
			width = window.innerWidth;
			height = window.innerHeight;
		} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
			// IE4 compatible
			width = document.body.clientWidth;
			height = document.body.clientHeight;
		}
		var left = 0;
		var top = 0;
		if ((width / 2 - 200) > 10) {
			left = width / 2 - 200;
		} else {
			left = 10;
		}

		if ((height / 2 - 200) > 10) {
			top = height / 2 - 200;
		} else {
			top = 10;
		}

		document.getElementById("msg").style.position = "absolute";
		document.getElementById("msg").style.left = left;
		document.getElementById("msg").style.top = top;
	}

	window.onresize = function() {
		CenterForm();
	}

	window.onload = function() {
		CenterForm();
	}

	function CheckForm(f)
	{
		if (document.getElementById('frontendUser').value == '') {
			alert('%%LNG_noUser%%');
			document.getElementById('frontendUser').focus();
			return false;
		}

		if (document.getElementById('frontendPass').value == '') {
			alert('%%LNG_noPass%%');
			document.getElementById('frontendPass').focus();
			return false;
		}

		return true;
	}

</script>
