var submitcount = 0;
function checkform(theForm)
{
	var why = "";
	if (!theForm.first.value) why += "Enter Your First Name \n";
	if (!theForm.last.value) why += "Enter Your Last Name \n"; 
	if (!theForm.phone.value) why += "Enter Your Phone Number \n"; 	
	if (theForm.email) why += validEmail(theForm.email.value); 	
	if (!theForm.msg.value) why += "Enter Your Message \n";	
	if(why != "")
	{
		alert(why);
		return false;
	}	
	if(submitcount == 0)
	{
		submitcount++;
		theForm.submit();
		return false;
	}
	else
	{
		alert("Form submission is in progress.");
		return false;
	}		
}
function validEmail(email)
{
	var str = email;
	var testresult = "";
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
	{
		testresult="";
	}	
	else{
		testresult="Enter a Valid Email Address \n";		
	}
	return testresult;
}