
function checkPWDForm() {
	var e = document.getElementById('alternativ-email');
	if (!e.value.match(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)) {
		alert('The alternativ email address is invalid!');
		e.focus();
		return false;
	}

	e = document.getElementById('question');
	if (e.selectedIndex == 6) {
		e = document.getElementById('question-own-field');
		if (e.value.match(/^ *$/)) {
			alert('The secret question field is empty!');
			e.focus();
			return false;
		}
	}

	e = document.getElementById('question');
	if (e.selectedIndex > 0) {
		e = document.getElementById('answer');
		if (e.value.match(/^ *$/)) {
			alert('The password field is empty!');
			e.focus();
			return false;
		}
	}

	return true;
}

function checkPWDForm2() {
	var e = document.getElementById('email');
	if (e.value.match(/^ *$/)) {
		alert('The email field is empty!');
		e.focus();
		return false;
	}

	return checkPWDForm();
}
