function resetForm()
{
	document.all.frmContact == "";
}

function submitForm()
{
	if (isName() && isEmail() && isMessage())
	{
		if (confirm("You are about to submit your submission."))
		{
			return true;
		}
		else
		{
			alert("You have chosen to abort the submission.");
			return false;
		}
	}
	
	return false;
}

function isName()
{
	if (document.all.frmContact.name.value == "")
	{
		alert("The Fullname field is blank. Please enter your Fullname!")
		document.all.frmContact.name.focus();
		return false;
	}

	return true;
}

function isEmail()
{
	if (document.all.frmContact.email.value == "")
	{
		alert("The Email field is blank. Please enter your Email address!")
		document.all.frmContact.email.focus();
		return false;
	}
	if (document.all.frmContact.email.value.indexOf('@', 0) == -1 || document.all.frmContact.email.value.indexOf('.', 0) == -1)
	{
		alert ("The Email field requires a \"@\" and a \".\"be used. Please re-enter your Email address!")
		document.all.frmContact.email.select();
		document.all.frmContact.email.focus();
		return false;
	}
	
	return true;
}

function isMessage()
{
	if (document.all.frmContact.message.value == "")
	{
		alert("The Message field is blank. Please enter your Message!")
		document.all.frmContact.message.focus();
		return false;
	}
	
	else if (document.all.frmContact.message.value.length > 1000)
	{
		alert("Your message exceeds the maximum limit (1000 characters). Please try again!")
		document.all.frmContact.message.focus();
		return false;
	}

	return true;
}
