var srch, option, select;
function promptSearch() {
	srch = prompt("Enter any unique character string for the name you would like to find.", "");
	if (srch) {
		srch = srch.toUpperCase();
		aSelects = document.getElementsByTagName('select');
		for (i = 0;i < aSelects[0].length;i++) {
			option = aSelects[0].options[i].text.toUpperCase();
			if (option.indexOf(srch) >= 0) {
				aSelects[0].options[i].selected = true;
				break;
			}
		}
	}
	var cboFaculty = document.forms[0].cboFaculty;
	if( cboFaculty ){
		cboFaculty.blur();
	}
	var FirstPassword = document.forms[0].lstPassword;
	if( FirstPassword ){
		FirstPassword.focus();
	}
}
//
//This function will validate entries before they're submitted...
function checkUserPassword() {
	var strnew1 = document.forms[0].newPassword.value;
	var strnew2 = document.forms[0].confirmNewPassword.value;
	var msg = '';
	// if they aren't changing the password, don't worry about it...
	if (strnew1 == "" && strnew2 == "" ) { return true; }

	//Check to make sure all fields are filled in.
	if (strnew1 == window.defaultSitePassword)	{
		msg = "Your new password cannot be the site default: "+window.defaultSitePassword+".";
	}
	else if (strnew1 == "atlas")	{
		msg = "Your new password cannot be atlas.";
	}
	else if (strnew1 == "" && strnew2 != "") {	//AE 10/15/08 - added second condition for bug # 7558
		msg = "You did not fill in your new password.";
	}
	else if (strnew2 == "" && strnew1 != "") {	//AE 10/15/08 - added second condition for bug # 7558
		msg = "You did not confirm your new password.";
	}
	//Check to make sure password was confirmed correctly.
	else if (strnew1 != strnew2) {
		msg = "You did not correctly confirm your new password.";
	}
	//Check to make sure new password is not longer than 50 characters
	else if (strnew1.length > 50) {
		msg = "Please select a password which is 50 characters or less.";
	}
	if (msg != '') {
		alert(msg);
		return false;
	}
	return true;
}