function addInputSubmitEvent(form, input) {
    input.onkeydown = function(e) {
        e = e || window.event;
        if (e.keyCode == 13) {
            form.submit();
            return false;
        }
    }
}

function loginFix() {
    var theform = document.getElementById('loginForm');
    
    if (theform != null) {
		var theinputs = theform.getElementsByTagName('INPUT');

		for (var j = 0; j < theinputs.length; j++) {
		    addInputSubmitEvent(theform, theinputs[j]);
		}
    }
}