// JavaScript Document
loginValid=""; //set variable loginValid to initial value of empty string
loginMessage=""; //set variable loginMessage to initial value of empty string

function loginvalidation() { //function loginvalidation begin

	loginMessage="You've missed out some information.\n\n "; //start loginMessage
	loginValid="true"; //initially set valid to true

	if (document.getElementById('loginusername').value=="") { //if the username field has no data entered
	loginValid="false"; //set valid to false
	loginMessage+="\tPlease enter your Username.\n\n "; //append the loginMessage to prompt user
	}
	
	if (document.getElementById('loginpassword').value=="") { //if the password field has no data entered
	loginValid="false"; //set valid to false
	loginMessage+="\tPlease enter your Password.\n\n "; //append the loginMessage to prompt user
	}
	
	if(loginValid=="false") { //if valid is equal to false
	alert(loginMessage); //put an alert box to the screen displaying loginMessage
	return false; //return false, meaning form will not submit
	} else { //otherwise
	return true; //return true, meaning form will submit
	}
} //validate form end
