//
//  Javascript specifically for login.asp
//
function SubmitLogin()
	{
	//
	//  Check entry has been made in user id and password
	//
	var blnSubmit = true;
	
	if (document.frmlogin["txtuserid"].value.length == 0)
		{
		alert("Please enter your user name and click on Login");
		document.frmlogin["txtuserid"].focus();
		blnSubmit = false;
		}
		
	if (blnSubmit == true && document.frmlogin["txtpassword"].value.length == 0)
		{
		alert("Please enter your password and click on Login");
		document.frmlogin["txtpassword"].focus();
		blnSubmit = false;
		}

	if (blnSubmit == true)
		{
		document.frmlogin.submit();
		}
	}
	
	
function OnLoad(strControlInError)
	{
	//
	//  Sets focus to the control passed
	//
	if (strControlInError.length > 0 )
		{
		document.frmlogin[strControlInError].focus();
		}
	}	
	
function submitEnter(e) {
		var keycode;
		if (window.event) {
			keycode = window.event.keyCode;
		}
		else {
			if (e) {
				keycode = e.which;
			}
			else {
				return true;
			}
		}
		if (keycode === 13) {
			document.frmlogin.submit();
			return false;
		}
		else {
			return true;
		}
}
	
function ForgotPassword()
	{
	//
	//  Sends out password by email
	//
	if (document.frmlogin["txtuserid"].value.length == 0)
		{
		alert("Please enter your user name to receive your password by email.");
		}
	else
		{
		window.location="forgotpassword.asp?userid=" + document.frmlogin["txtuserid"].value
		}
	}
