var PFResult = 0;
var	numofspaces = 0;
var	PFLength = 0;

function ValidateInput(addeditfrm) { 
	if(document.addeditfrm.fname.value ==""){
		alert("Your first name is required.");
		document.addeditfrm.fname.focus();
		return false;
	}
	
	if(document.addeditfrm.lname.value ==""){
		alert("Your last name is required.");
		document.addeditfrm.lname.focus();
		return false;
	}
	
	if(document.addeditfrm.email.value ==""){
		alert("Your email address is required.");
		document.addeditfrm.email.focus();
		return false;
	}
		
	if(document.addeditfrm.passw.value ==""){
		alert("The first password cannot be blank.");
		document.addeditfrm.passw.focus();
		return false;
	}
	
	if(document.addeditfrm.confirmpassw.value ==""){
		alert("The confirm password cannot be blank.");
		document.addeditfrm.confirmpassw.focus();
		return false;
	}
	
	if(document.addeditfrm.passw.value != document.addeditfrm.confirmpassw.value){
		alert("The passwords do not match.");
		document.addeditfrm.passw.focus();
		return false;
	}
	
	if(document.addeditfrm.pwhint.value == ""){
		alert("Please enter a Password hint, clue or phrase.");
		document.addeditfrm.pwhint.focus();
		return false;
	}
	
	return document.addeditfrm.submit();
} 

// check for spaces in a field.
function isNotSpaces(PassField) {
	PFResult = 0;
	numofspaces = 0;
	PFLength = PassField.length
	if (PFLength == 0){
		PFResult = 2;
		return;
	}
	for (var i = 0; i < PFLength ; i++)
	{
		
		if (PassField.charAt(i) == " ")
		{
			numofspaces = numofspaces + 1;
		}
	}	
	if(numofspaces > 0){
		PFResult = 2;
	}
}

