function validateLoginForm(authMethod, formType) {
	
	if(formType != "password_reminder"){
		f = document.getElementById("login_form");
		
		$("#user_name").removeClass("hilightTextField");
		$("#user_password").removeClass("hilightTextField");
		$(".alert").hide();
		
		if(authMethod == "username") {
			if (f.user_name.value == "") {
				$("#user_name").focus();
				$("#user_name").addClass("hilightTextField");
				$("#userNameAlert").show();
				return false;
				
			} else if (f.user_password && f.user_password.value == "") {
				$("#user_password").focus();
				$("#user_password").addClass("hilightTextField");
				$("#passwordAlert").show();
				return false;
				
			} else {
				return true;
				
			}
		} else {
			//email address authentication
		}
	}else{
		return validateReminderForm(authMethod);
	}
}

function validateReminderForm(authMethod) {
	f = document.getElementById("login_form");
	$("#user_name").removeClass("hilightTextField");
	$(".alert").hide();
	if (f.user_name.value == "") {
		$("#user_name").focus();
		$("#user_name").addClass("hilightTextField");
		$("#userNameAlert").show();
		return false;		
	}else{		
		return true;		
	}
}


function submitForm(myfield, e){
	var keycode;
	
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13)
	   {
	   myfield.form.submit();
	   return false;
	   }
	else
	   return true;
}