
function validatePassword (strng) {
 	var error = "";
 	
	var strng = strng.replace(/[" "]/g, '');
	if (strng == "") {
    	error = "You didn't enter a valid password.\n";
 	}
	return error;

}










/*
    When it comes to passwords, we want to be strict with our users. 
  	It's for their own good; we don't want them choosing a password that's
  	easy for intruders to guess, like a dictionary word or their kid's birthday.
  	So we want to insist that every password contain a mix of uppercase and 
  	lowercase letters and at least one numeral. 
  	We specify that with three regular expressions, a-z, A-Z, and 0-9, 
  	each followed by the + quantifier, which means "one or more," 
  	and we use the search() method to make sure they're all there:
  
	var illegalChars = /[\W_]/; // allow only letters and numbers
    if ((strng.length < 6) || (strng.length > 8)) {
       error = "The password is the wrong length.\n";
    }
    else if (illegalChars.test(strng)) {
      error = "The password contains illegal characters.\n";
    }
	else if (!((strng.search(/(a-z)+/))&& (strng.search(/(A-Z)+/))&& (strng.search(/(0-9)+/)))) {
  		error = "The password must contain at least one 
    	uppercase letter, one lowercase letter,
    	and one numeral.\n";
  	}
*/
