// JavaScript Document
function submitForm()
{	
		/** Check that fields are filled in **/
		var error = 0;
		var errors = {};
		
		if($('name').value == '')
		{
			error += 1;
			errors[error] = "Name";
		}
		
		if($('email').value == '')
		{
			error += 1;
			errors[error] = "Email";
		}
		
		if($('postcode').value == '')
		{
			error += 1;
			errors[error] = "Postcode";
		}
		
		if(error == 0)
		{
			document.forms[0].submit();
		}
		else
		{
			text = "";
			for(var i=1; i<errors.length;i++)
			{
					text += "- "+errors[i]+"\n";
			}
			
			alert("Please fill in all of the required fields before sending your comments:\n"+text);	
		}
}
