function Reset() {
	document.getElementById("txtname").value = "";
	document.getElementById("txtEmail").value = "";
	document.getElementById("txtmessage").value = "";
	document.getElementById("txtname").focus();
}

function submitForms() {
	if ( (isName() ) && (isEmail()) && (isComment()) )
	if (confirm("\nYou're about to e-mail the form.\n\nClick on YES to submit.\n\nClick on NO to abort."))
	{
		var emailAddress=document.getElementById("txtEmail").value
		alert("\nYour submission will now be made to:\n\n\n\n"+emailAddress+"\n\n\n\nThank you!");
		return true;
	}	
	else
		return false;
}

function isName() {
	var str = document.getElementById("txtname").value;
	if (str == "") {
		alert("\nPlease enter your name.")
		document.getElementById("txtname").focus();
		return false;
	}
	for (var i = 0; i < str.length; i++)
	{
		var ch = str.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ')
		{
			alert("\nThe NAME field only accepts letters & spaces.\n\nPlease re-Enter your name.");
			document.getElementById("txtname").select();
			document.getElementById("txtname").focus();
			return false;
		}
	}
	return true;
}

function isEmail()
{
	emailAddress=document.getElementById("txtEmail").value;
	if (document.getElementById("txtEmail").value == "") {
		alert("\nThe E-MAIL field is blank.\n\nPlease enter your e-mail address.")
		document.getElementById("txtEmail").focus();
		return false;
	}
	if (document.getElementById("txtEmail").value.indexOf ('@',0) == -1 ||
	document.getElementById("txtEmail").value.indexOf ('.',0) == -1)
	{
		alert("\nThe E-MAIL field requires a \"@\" and a \".\"be used.\n\nPlease enter valid e-mail address.")
		document.getElementById("txtEmail").select();
		document.getElementById("txtEmail").focus();
		return false;
	}	
	else
	{	
		return true;
	}
}

function isComment() {
	if (document.getElementById("txtmessage").value == "") {
		if (confirm("\nYou're about to submit without leaving a comment.\n\nClick on CANCEL to include a comment.\n\nClick on OK to continue without a comment."))
		return true
		else
		{
			document.getElementById("txtmessage").focus();
			return false;
		}
	}
	else
		return true
}
