function check_email (el,msg){
var reg=/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
		if (!reg.test(el.value)){
		alert(msg);
		el.focus();
		return false;
	}
	return true;
}
function check(el, msg) {
	if(el.value == ''){
		alert(msg);
		el.focus();
		return false;
	}
	return true;
}
function check_form(form) {
		return check(form.name, 'Please enter your name.')&& check_email(form.email, 'Please enter a valid e-mail address.') && check(form.message, 'Please enter your message.');
}
