// JavaScript Document
//by Douglas Munro 5/9/2009
function checkform()
{
	var valid = 1
	var mes1 = ''
	var mes2 = ''
	var mes3 = ''
	var mes4 = ''
	if (document.form.name.value == '')
	{
		var mes1 = '** No name entered'
		valid = 0
	}
	//this part validates the email address, check blank, @ and dot(uses indexOf(char,start) if -1 does not exist
	//uses else statement
	if (document.form.formREPLY.value == '')
	{
		var mes2 = '** Email field empty'
		valid = 0
	}
		else
		if ( document.form.formREPLY.value.indexOf("@",0)<0)
		{
			var mes2 = '** Email field missing @'
			valid = 0
		} 
		else
			if ( document.form.formREPLY.value.indexOf(".",0)<0)
			{
				var mes2 = '** Email missing dot'
				valid = 0
			}
	if (document.form.query.value == '')
	{
		var mes3 = '** Query Type is empty'
		valid = 0
	}
	if (document.form.message.value == '')
	{
		var mes4 = '** Comments is empty'
		valid = 0
	}
	//check a series of radio buttons to find if one is checked
	if (valid == 0)
	{
		// something else is wrong
		alert('The following fields were not entered:\n\n' + mes1+ '\n' +mes2+ '\n' + mes3 + '\n' + mes4 )
		return false;
	}
		return true;
	// If the script gets this far through all of your fields
	// without problems, it's ok and you can submit the form
}
