	function validateLoginForm(){
		
		// quickie references to my fields
		var UserName = document.getElementById('UserName');
		var Password = document.getElementById('Password');
			
		// check the inputs  (main function nav)

	if(emailField(UserName, "mand", "email address as your username.")) {
		if(passwordField(Password, "mand", 4, 15, "password.")) {
			return true;
		}
	}
	return false;
	}

	// function for quickly checking email format (check again on server side)	
	function emailField(element, which, fieldDesc){
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		if ((which == 'mand') && (element.value.length < 6)) {
			var shortStub = 'Please enter your ';
			alert(shortStub + fieldDesc);
			element.focus(); // set the focus to this input
			return false;
		} else if (element.value.match(emailExp)) {
			return true;
		} else {
			var wrongStub = 'Please check the format of your ';
			alert(wrongStub + fieldDesc);
			element.focus();
			return false;
		}
	}
	
	// function for checking password fields (really just for length as we take alpha, numbers, and symbols). 
	
	function passwordField(element, which, min, max, fieldDesc){
		var uInput = element.value;
		if ((which == 'mand') && (uInput.length < min || uInput.length > max)) {
			alert("Please enter between " +min+ " and " +max+ " characters for your " +fieldDesc+ "");
			element.focus();
			return false;	
		} else {
			return true;
		}
	}
