﻿function activateLoginForm()
{
	Event.observe(window, 'load', InitForm);
}

function InitForm() {
	if (typeof window.event != 'undefined')
	{
		// IE
		document.onkeydown = function() {
			var t = event.srcElement.type;
			var kc = event.keyCode;
			if (kc == 13) {
				__doPostBack('LoginAction1$lnkbtnLogin','');
				document.body.style.cursor = 'wait';
				return false;
			}
		}
	}
	else {
		// FireFox/Others
		document.onkeypress = function(e) {
			var t = e.target.type;
			var kc = e.keyCode;
			if (kc == 13) {
				__doPostBack('LoginAction1$lnkbtnLogin','');
				document.body.style.cursor = 'wait';
				return false;
			}
		}
	}
	
	if ($("LoginAction1_tbLoginName").value != '') {
		$("LoginAction1_tbPassword").focus();
	}
	else {
		$("LoginAction1_tbLoginName").focus();
	}
}
