function checkFormTAF(){
	var hasError = 0;
	var hasError2 = 0;
	var hasError3 = 0;
	var missingFields = "";

	highlightColor = "#96ADB5";
	defaultColor = "#ffffff";
	thisForm = document.formTAF

	var arrFields = new Array("yourName", "yourEmail",  "friendsName", "friendsEmail");
	var arrTitles = new Array("Your Name", "Your email address", "Friend's name", "Friend's email address");

	for(i=0; i<arrFields.length; i++){
		theField = arrFields[i]
		theTitle = arrTitles[i]

		if(isNaN(thisForm[theField].length) || ! isNaN(thisForm[theField].selectedIndex)){
			if(thisForm[theField].value == ""){
				missingFields += theTitle + "\n";
				thisForm[theField].style.background = highlightColor;
				if(hasError == 0){thisForm[theField].focus()}
				hasError = 1;
			}else{
				thisForm[theField].style.background = defaultColor;
			}
		}else{
			var hasNodeSelected = 0;
			for(j=0; j<thisForm[theField].length; j++){
				if(thisForm[theField][j].checked){
					hasNodeSelected++;
				}
			}
			if(hasNodeSelected == 0){
				hasError = 1;
				missingFields += theTitle + "\n";
			}
		}
	}

	if(hasError == 1){
		alert('Please complete the following fields:\n' + missingFields)
		return false;
	}else{
		return tellAFriend(thisForm);
	}

}

function checkFormEnquiry(){
	var hasError = 0;
	var hasError2 = 0;
	var hasError3 = 0;
	var missingFields = "";

	highlightColor = "#96ADB5";
	defaultColor = "#ffffff";
	thisForm = document.formEnquiry

	var arrFields = new Array("title", "firstName",  "surname", "email", "postcode");
	var arrTitles = new Array("Title", "First name", "Surname", "Email", "Post Code");

	for(i=0; i<arrFields.length; i++){
		theField = arrFields[i]
		theTitle = arrTitles[i]

		if(isNaN(thisForm[theField].length) || ! isNaN(thisForm[theField].selectedIndex)){
			if(thisForm[theField].value == ""){
				missingFields += theTitle + "\n";
				thisForm[theField].style.background = highlightColor;
				if(hasError == 0){thisForm[theField].focus()}
				hasError = 1;
			}else{
				thisForm[theField].style.background = defaultColor;
			}
		}else{
			var hasNodeSelected = 0;
			for(j=0; j<thisForm[theField].length; j++){
				if(thisForm[theField][j].checked){
					hasNodeSelected++;
				}
			}
			if(hasNodeSelected == 0){
				hasError = 1;
				missingFields += theTitle + "\n";
			}
		}
	}

	if(hasError == 1){
		alert('Please complete the following fields:\n' + missingFields)
		return false;
	}else{
		document.getElementById("googleTC").src = "vehicle-enquiry-google.html";
		return vehicleEnquiry(thisForm);
	}

}
