// JavaScript Document
function validateForm() 
{
 	var okSoFar=true
	$("span").not(".hidden").addClass("hidden");
 	with (document.contactform)
 	{
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
		strEmail = email.value;
	
		if (strEmail.search(validRegExp) == -1)
		{
			$(email).highlightFade({color:'red',speed:2000})
			$("#emailerror").removeClass("hidden")
			$("#generalerror").removeClass("hidden")
			email.focus()
			return false;
		}
		var e1 = email.value
		var e2 = email2.value
		if (!(e1==e2) && okSoFar)
		{
			okSoFar = false
			$(email).highlightFade({color:'red',speed:2000})
			$(email2).highlightFade({color:'red',speed:2000})
			$("#generalerror").removeClass("hidden")
			$("#emailmatcherror").removeClass("hidden")
			email.focus()
		}
		if (thesubject.value=="" && okSoFar)
		{
			okSoFar=false
			$(thesubject).highlightFade({color:'red',speed:2000})
			$("#generalerror").removeClass("hidden")
			$("#subjecterror").removeClass("hidden")
			thesubject.focus()
		}
		if (themessage.value=="" && okSoFar)
		{
			okSoFar=false
			$(themessage).highlightFade({color:'red',speed:2000})
			$("#generalerror").removeClass("hidden")
			$("#messageerror").removeClass("hidden")
			themessage.focus()
		}
		if (okSoFar==true)
		{
			submit();
		}
 	}
}