function ka_check_userLogin(f) {
	var isValid = true;
	document.getElementById('container') = document.getElementById('j')('#ka_fieldLogin');
	sUserName = document.getElementById('container').find("#username");
	sPassword = document.getElementById('container').find("#password");
	
	if (!Ka.events.dispatchEvent('login-page-before-submit', {username: sUserName.value, password: sPassword.value})) { return false; }
	
	// check for empty values
	if (sUserName.val() == '' || sPassword.val() == '' || sUserName.val().length > 124) {
		document.getElementById('j')('#disabledUser-error').html('');
		document.getElementById('j')("#invalidUser-error").html(Ka.Messages.JoinPage.ERRORLOGINPAGE).css({display: 'block'});
		document.getElementById('j')("#ka_fieldLogin #username")[0].focus();
		isValid = false;
	}
		
	if (isValid) {
		document.getElementById('j')('input.ka_button[name*=ogin]').attr('disabled', 'disabled');
	}
	
	return isValid;
}


