function checkDetails(MyForm){

	
	var name = MyForm.name.value	
	var email = MyForm.email.value
	var allError = 'These following errors were encountered during the submission process:\n\n'
	var errorFound = 0
	
	if(name == ''){
		allError += '- Your name was not correctly entered\n'
		errorFound++
	}

	// Email address validation

	var at 
	var dot = 0
	var loc_at
	var loc_dot
	var validEmail = 0
				
	for(i=0;i<email.length;i++){
		at = email.charAt(i)
		if(at == '@'){
			validEmail = 1
			loc_at = i
		}
		if(at == '.' && validEmail >= 1 && i != (loc_at+1) && i != (loc_dot+1)){
			validEmail = 2
			loc_dot = i
		}	
		if(at == '.'){ // counting number of dots.
			dot++
			if(i == (loc_dot+1)){validEmail = 1}
		}
	}
	if(email.charAt(email.length-1) == '.'){
		validEmail = 1
	}
	if(validEmail < 2 || dot > 2){
		allError += '- Email was not correctly entered\n'
		errorFound++
	}
	if(errorFound > 0){
		alert(allError+'\nYou must complete the form before continuing the submission process.\n')
		return false
	}
	else{
		return true
	}
}
