
function validate_forgot_e(){

	aErrors = new Array;
	
	oEmail = $('email');
	if (oEmail) {
		sEmail  = oEmail.value;
		if (String.trim){
			sEmail = sEmail.trim();
		}
		if (sEmail == ''){
			aErrors.push('- Email address is required');
		} else if (!email_valid(sEmail)){
			aErrors.push('- Email address is invalid');
		}

	} else {
		aErrors.push('- Unable to locate email field');
	}

	var sErrors = '';
	if (aErrors.length > 0){
		sErrors += 'Errors occurred\n';
		sErrors += aErrors.join('\n');
		alert(sErrors);
		return false;
	} else {
		// alert('No errors, returning false for hard test');
		// return false;

		return true;
	}

}

function validate_forgot_fpc(){

	aErrors = new Array;
	
	oFPC = $('fpc');
	if (oFPC) {
		sFPC  = oFPC.value;
		if (String.trim){
			sFPC = sFPC.trim();
		}
		if (sFPC == ''){
			aErrors.push('- Forgot-Password-Code is required');
		}

	} else {
		aErrors.push('- Unable to locate field for Forgot-Password-Code. Contact admin.');
	}

	var sErrors = '';
	if (aErrors.length > 0){
		sErrors += 'Errors occurred\n';
		sErrors += aErrors.join('\n');
		alert(sErrors);
		return false;
	} else {
		// alert('No errors, returning false for hard test');
		// return false;

		return true;
	}

}

function validate_forgot_pw(){

	aErrors = new Array;
	
	oPW1 = $('pass1');
	if (oPW1) {
		sPW1  = oPW1.value;
		if (String.trim){
			sPW1 = sPW1.trim();
		}
		if (sPW1 == ''){
			aErrors.push('- New password is required');
		}

	} else {
		aErrors.push('- Unable to locate field for password. Contact admin.');
	}

	oPW2 = $('pass2');
	if (oPW2) {
		sPW2  = oPW2.value;
		if (String.trim){
			sPW2 = sPW2.trim();
		}
		if (sPW2 == ''){
			aErrors.push('- Password confirmation is required');
		}

	} else {
		aErrors.push('- Unable to locate field for password confirmation. Contact admin.');
	}
	
	if (aErrors.length == 0){
		if (sPW1 != sPW2){
			aErrors.push('- Passwords do not match');
		}
	}

	var sErrors = '';
	if (aErrors.length > 0){
		sErrors += 'Errors occurred\n';
		sErrors += aErrors.join('\n');
		alert(sErrors);
		return false;
	} else {
		// alert('No errors, returning false for hard test');
		// return false;

		return true;
	}

}


