function isBlank(theInput){
	if ((theInput.value == "")||(theInput.value == null)){
		return true;
	}
	return false;
}


function isNotEmail(theInput){
	if(isBlank(theInput)){
		return true;
	}
	if((theInput.value.indexOf('@')!=-1)&&(theInput.value.indexOf('.')!=-1)){
		return false;
	}
	return true;
}


function submitForm(theForm){
	var errors='';

	if (isBlank(theForm.Name)){
		errors+='\nName';
	}
	
	if (isBlank(theForm.Company)){
		errors+='\nCompany';
	}
	
	if (isBlank(theForm.Address)){
		errors+='\nAddress';
	}
	
	if (isBlank(theForm.Postcode)){
		errors+='\nPostcode';
	}

	if (isBlank(theForm.Tel)){
		errors+='\nTel';
	}
	
	if (isNotEmail(theForm.email)){
		errors+='\nemail';
	}

	if(errors!=''){
		alert('Please amend or enter the following:'+errors);
	}
	else{
		theForm.submit();
	}
}
