// code partly copyrighted knod
function checkForm(FormName) {
if (FormName.newpass.value != FormName.newpass2.value) {
	alert("Passwords does not match!")
	FormName.password.focus()
	return false
}
	var allEmpty = true
	for (var i = 0; i < FormName.length; i++) {
		if (FormName[i].type != 'text' && FormName[i].type != 'textarea') continue
		if (FormName[i].name == 'clanname') continue
		if (FormName[i].name == 'phone') continue
		if (FormName[i].value.length > 0) allEmpty = false
		if (FormName[i].value == "" || FormName[i].value == null || FormName[i].value.charAt(0) == ' ') {
			
			alert(FormName[i].name + " is a mandatory field.\nPlease provide the information.")
			FormName[i].focus()
			return false
		}
		if (FormName[i].value.match(/[^:alpha:0-9\.@_\-\/$%()\?!]/i)) {
//			alert("You have entered an invalid character, this form does not allow quotes or other special characters.")
//			FormName[i].focus()
//			return true
		}
	}
	if (allEmpty) {
		alert ("Do you think it's funny to try send out an empty form?")
		return false
	}
	if (isValidEmail(FormName.email_address)){
		return false; 
	}
	return true
}

function isValidEmail(strEmail) {
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
   if (strEmail.value.search(validRegExp) == -1) 
   {
	   alert('A valid e-mail address is required.');
	   strEmail.focus();
	   return true;
    } 
    return false; 
}
