function validateRememberPasswordForm()
{
	//error message area
	var errormessage = document.getElementById('errormessage').firstChild;
	
	//variable to tell if either username or email is entered
	var usernameOrEmailEntered = false;
	
	//check either username or password is checked
	if ($('usernameEntered').value.length>0)
	{
		usernameOrEmailEntered = true;
	}
	if ($('emailEntered').value.length>0)
	{
		usernameOrEmailEntered = true;
	}
	if (!usernameOrEmailEntered)
	{
		errormessage.nodeValue = 'Please enter username or email to retrieve your password.';
		return false;
	}
	
	//check captcha code is not empty
	var captchaCode = document.getElementById('enteredCaptchaCode');
	if (captchaCode.value.length < 1){		
		$('captcha_error').firstChild.nodeValue = 'Please enter the code shown on the picture below.';
		$('captcha_error').style.display = 'block';
		captchaCode.parentNode.className = 'highlight';
		captchaCode.focus();
	
		errormessage.nodeValue = 'Please enter captcha code.';
		return false;
	}
}//END: validateRememberPasswordForm

function validateCaptcha(element){
	var error = document.getElementById('captcha_error');
	
	if (element.value.length < 1){
		error.firstChild.nodeValue = '';
		error.style.display = 'none';
		element.parentNode.className = '';
		return false;
	}
	
	
	//error.firstChild.nodeValue = '';
	//error.style.display = 'none';
	//element.parentNode.className = 'valid';
	return true;
}//END: validateCaptcha

