var submitcount = 0;

function checkform(form)
{
var requiredstring = new String(form.required.value);
var fields = requiredstring.split(",");
var i = 0;
while (i < fields.length)
	{
	eval("tempstring = escape(form."+fields[i]+".value);");
	if ((tempstring == "") || (tempstring == "dummy"))
		{
		alert("You have not filled in all the required fields.");
		eval("form."+fields[i]+".focus();");
		submitcount = 0;
		return false;
		}
	i += 1;
	}

var address = form.email.value;

if ((address.indexOf("@") == -1) || (address.indexOf(".") == -1) || (address.length < 7))
	{
	alert("You must specify a valid e-mail address.");
	form.email.focus();
	form.email.select();
	submitcount = 0;
	return false;
	}

if (submitcount == 0)
	{
	submitcount++;
	return true;
	}
else
	{
	alert("You have already clicked the button to submit the form. Thank you!");
	return false;
	}
}