var LOGINFORM = 'login_form';
var LOGINFIELDCLASS = 'loginformfield';
function submitLoginform() {
	$(LOGINFORM).submit();
}

function processKeyPressFromLoginForm(e) {
	if(e.keyCode == Event.KEY_RETURN) { // if user has hit enter, they mean to submit the form
		$(LOGINFORM).submit();
	} else {
//		console.log("not the return key");
	}
}

function initLoginForm(){
	if($(LOGINFORM)){		
		var inputfields = $A(document.getElementsByClassName(LOGINFIELDCLASS));
		
		inputfields.each(function(field){
			Event.observe($(field), 'keypress', processKeyPressFromLoginForm, false);							
		});

	} // end if LOGINFORM
} // end initLoginForm 

function init() {	
	initLoginForm();
} // end volInit

Event.observe(window, 'load', init, false);