// JavaScript Document
try {
	Event.onDOMReady(function() {

		Event.observe(document, 'keypress', function(event) { 
				if( event.keyCode == Event.KEY_RETURN ) 
				{
					if( Event.element(event).match('input#user_login') )
					{
						$('user_pass').focus();
					}
					else if( Event.element(event).match('input#user_nev') )
					{
						$('user_login_reg').focus();
					}
					else if( Event.element(event).match('input#user_login_reg') )
					{
						$('user_passwd1').focus();
					}
					else if( Event.element(event).match('input#user_passwd1') )
					{
						$('user_passwd2').focus();
					}
					else if( Event.element(event).match('input#user_passwd2') )
					{
						$('user_email').focus();
					}
					else if( Event.element(event).match('input#user_email') )
					{
						$('user_hirlevel').focus();
					}
				}
			}
		);
		try {
			Event.observe('loginbutton', 'click', function() { 
					$('loginform').submit();
				}
			);
		} catch(e) {}
		
		try {
			Event.observe('regformbutton', 'click', function() { 
					$('registform').submit();
				}
			);
		} catch(e) {}
	});
} catch(e) {
}
