/*
	validation of the contact form
*/
var elmnt = document.contact;
function check_un() {
//	val = elmnt.name1;
//	if (val.value.slice(0,1).match(/[0-9;]/)) {alert("Name should start with a letter.");val.value = "";}
	return true;
}
function validate(){
	var msg = "";
	var nm = elmnt.name1.value;
	if (nm == "") {msg += "You didn't enter your name.\n";}
	nm = elmnt.mail1.value;
	if (nm.length == 0) {msg += "You didn't enter your email address.\n";}
	else {if (!validateEmail(nm)) {msg += "The email address you entered is invalid.\n";}}
	nm = elmnt.msg.value;
	if (nm == "") {msg += "You didn't type in a message.\n";}
	nm = elmnt.usernumber.value;
	msg += checkAutoCode(nm);

	if (msg.length > 0) {
		err = "Please, note the following problems:\n\n" + msg;
		alert(err);
	} else {
		elmnt.submit();
	}
		return true;
}
