// JavaScript Document
var g_bIsSubmitted = false;

function SubmitComment(form, name, email, enquiry)
{
	if (g_bIsSubmitted)
	{
		return;
	}
	if (name.value == "")
	{
		alert("Please fill in the name.");
		name.focus();
		return;
	}
	if (email.value == "")
	{
		alert("Please fill in the e-mail address.");
		email.focus();
		return;
	}
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value))
	{
		alert("The format of the email address is incorrect.");
		email.focus();
		return;
	}
	if (enquiry.value == "")
	{
		alert("The enquiry cannot be blank.");
		enquiry.focus();
		return;
	}
	g_bIsSubmitted = true;
	form.submit();
}