<!--

// This is the check script

function checkit ()
{
	// In textstring I gather the data that are finally written to the textarea.

	var textstring = '';

	// First of all, have all the text boxes been filled in?
	// This part is treated in the normal page.
	// I put all boxes and their values in textstring
	// (i=0;i<5;i++)


	//
	// check all required form field entered 
	//
	var box = document.forms['contact'].ContactUs_Body;
	if (!box.value) {
		alert('You haven\'t filled in message!');
		box.focus();
		return false;
	}
	
	var box = document.forms['contact'].ContactUs_Name;
	if (!box.value) {
		alert('You haven\'t filled in your name!');
		box.focus();
		return false;
	}
		
	var box = document.forms['contact'].teleno;
	if (!box.value) {
		alert('You haven\'t filled in your telephone number!');
		box.focus();
		return false;
	}
	
	var box = document.forms['contact'].ContactUs_Email;	
	if (!box.value || box.value.indexOf('@') == -1 || box.value.indexOf('.') == -1) {
		alert('You haven\'t filled in a valid email address');
		box.focus();
		return false;
	}
	
	//
	// make sure form fields have correct looking content
	// eg emails look like a@a.com etc
	//
	
	var x = document.forms['contact'].elements;
	for (var i=0;i<x.length;i++) {
		if (!x[i].value)
			writeError(x[i],'This field is required');
	}
	if (!W3CDOM)
		alert(errorstring);
	if (firstError)
		firstError.focus();
	if (validForm)
		alert('All data is valid!');
}
// -->
