function match(str, reg){
	var rx = new RegExp(reg);
	return rx.test(str);
}

function sendMail(){
	var form = document.forms["email"];

	if (match(form.name.value,"^\\s*$")){
		alert("Please enter name!")
		form.name.focus();
		return;
	}

	if (! match(form.email.value,"^\\w*\\@\\w*\\.\\w*.*$")){
		alert("Please enter valid email address!")
		form.email.focus();
		return;
	}

	var a = prompt( "Confirm Your Email");
	if (a != form.email.value){
		alert("The two emails you have entered are not identical!\nPlease check and re-enter.")
		form.email.focus();
		return;
	}

	form.submit();

}