

function checkFields()
{

//document.EmailForm.To.value = "enquiries@nosh-fine-catering.com";
	missinginfo = "";


if (document.EmailForm.NAME.value == "") 
		{
			missinginfo += "\n     -  Your name";
		}		
		
if ((document.EmailForm.FROM.value == "") || 
(document.EmailForm.FROM.value.indexOf('@') == -1) || 
(document.EmailForm.FROM.value.indexOf('@') == 0) || 
(document.EmailForm.FROM.value.indexOf('.') == -1) ||
(document.EmailForm.FROM.value.lastIndexOf('.') == (document.EmailForm.FROM.value.length)-1) ||
(document.EmailForm.FROM.value.indexOf('.') - document.EmailForm.FROM.value.indexOf('@')==1 )
)  
	{
		missinginfo += "\n     -  Your email address";
	}			


if (document.EmailForm.DOB.value == "") 
		{
			missinginfo += "\n     -  Your date of birth";
		}		

//radio valid
chosen = "";
chosen2 = "";
len = document.EmailForm.Smoker.length; //only 2 answers each. could srt len = 2
//len2 = document.EmailForm.maritalstatus.length;

for (i = 0; i <2; i++) {
if (document.EmailForm.Smoker[i].checked) 
	{
		chosen = document.EmailForm.Smoker[i].value;
		
	}


if (document.EmailForm.maritalstatus[i].checked) 
	{
		chosen2 = document.EmailForm.maritalstatus[i].value;
		
	}
}

if (chosen == "") 
	{
		missinginfo += "\n     -  If you smoke";
	}

if (chosen2 == "") 
	{
		missinginfo += "\n     -  Single or joint";
	}	
	
//radio valid end
						
	if (missinginfo != "") 
		{
			missinginfo ="_____________________________\n" +
			"Please correctly fill in your:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again!";
			alert(missinginfo);
			return false;
		}
	else return true;
}
