function validateContact(form1)
{
	var valid = true;

	if (form1.email.value == "")
	{
		alert('Please enter your email address');
		valid = false;
		form1.email.focus();
	}

	if (form1.message.value == "" && valid)
	{
		alert('Please enter a message');
		valid = false;
		form1.message.focus();
	}

	if (valid)
	{
		form1.submit()
	}
}

function validateBooking(form1)
{
	var valid = true;
	if (form1.title.value == "")
	{
		alert('Please enter your title');
		form1.title.focus();
		valid = false;
	}

	if (form1.firstname.value == "" && valid)
	{
		alert('Please enter your firstname');
		form1.firstname.focus();
		valid = false;
	}

	if (form1.surname.value == "" && valid)
	{
		alert('Please enter your surname');
		form1.surname.focus();
		valid = false;
	}

/*	if (form1.address_line1.value == "" && valid)
	{
		alert('Please enter your premise name/number');
		form1.address_line1.focus();
		valid = false;
	}

	if (form1.address_line2.value == "" && valid)
	{
		alert('Please enter the street of your address');
		form1.address_line2.focus();
		valid = false;
	} 

	if (form1.post_town.value == "" && valid)
	{
		alert('Please enter the postal town/city');
		form1.post_town.focus();
		valid = false;
	} 

	if (form1.county.value == "" && valid)
	{
		alert('Please enter your county');
		form1.county.focus();
		valid = false;
	}*/

	if (form1.postcode.value == "" && valid)
	{
		alert('Please enter your postcode');
		form1.postcode.focus();
		valid = false;
	}

	if (form1.contact_num.value == "" && valid)
	{
		alert('Please enter your main contact number');
		form1.contact_num.focus();
		valid = false;
	}

	if (form1.alt_phone.value == "" && valid)
	{
		alert('Please enter an alternative number');
		form1.alt_phone.focus();
		valid = false;
	}

	if (form1.email.value == "" && valid)
	{
		alert('Please enter a valid email address');
		form1.email.focus();
		valid = false;
	}
	
	if( form1.confirm_email.value == "" && valid )
	{
		alert( 'Please confirm your email address' );
		form1.confirm_email.focus();
		valid = false;
	}
	
	if( ( form1.email.value != form1.confirm_email.value ) && valid )
	{
		alert( 'Please ensure the email fields match' );
		form1.email.focus();
		valid = false;
	}

	if (form1.car_make.value == "" && valid)
	{
		alert('Please enter the make of your car');
		form1.car_make.focus();
		valid = false;
	}

	if (form1.car_model.value == "" && valid)
	{
		alert('Please enter the model of your car');
		form1.car_model.focus();
		valid = false;
	}

	if (form1.car_colour.value == "" && valid)
	{
		alert('Please enter the colour of your car');
		form1.car_colour.focus();
		valid = false;
	}

	if (form1.car_reg.value == "" && valid)
	{
		alert('Please enter the registration number of the car');
		form1.car_reg.focus();
		valid = false;
	}

	if (form1.out_flight.value == "" && valid)
	{
		alert('Please enter the outgoing flight number');
		form1.out_flight.focus();
		valid = false;
	}

	if (form1.out_terminal.value == "" && valid)
	{
		alert('Please enter the terminal for the outgoing flight');
		form1.out_terminal.focus();
		valid = false;
	}

	if (form1.in_flight.value == "" && valid)
	{
		alert('Please enter the ingoing flight number');
		form1.in_flight.focus();
		valid = false;
	}

	if (form1.in_terminal.value == "" && valid)
	{
		alert('Please enter the terminal for the ingoing flight');
		form1.in_terminal.focus();
		valid = false;
	}

	/*if (form1.type.options[form1.type.selectedIndex].value == "" && valid)
	{
		alert('Please select an option for the Type of customer field');
		form1.type.focus();
		valid = false;
	}*/

	/*if (form1.hear.options[form1.hear.selectedIndex].value == "" && valid)
	{
		alert('Please select an option for the How did your hear about us section');
		form1.hear.focus();
		valid = false;
	}*/

	if (!form1.tc.checked && valid)
	{
		alert('Please tick that you have understood the terms + conditions');
		form1.tc.focus();
		valid = false;
	}

	if (valid)
	{
		form1.submit();
	}
}


function validateQuote(subform)
{
	var cal1 = document.fdf;
	var cal2 = document.tdf;
	var tim1 = document.ftf;
	var tim2 = document.ttf;

	var valid = true;

	if (cal1.fd.value == "")
	{
		alert('Please enter your arrival date');
		valid = false;
	}

	if (cal2.td.value == "" && valid)
	{
		alert('Please enter your departure date');
		valid = false;
	}

	if (tim1.fh.value == "" && valid)
	{
		alert('Please enter the hour of your arrival time');
		valid = false;
	}

	if (tim1.fm.value == "" && valid)
	{
		alert('Please enter the minutes of your arrival time');
		valid = false;
	}

	if (tim2.th.value == "" && valid)
	{
		alert('Please enter the hour of your departure time');
		valid = false;
	}

	if (tim2.tm.value == "" && valid)
	{
		alert('Please enter the minutes of your departure time');
		valid = false;
	}

	subform.ft.value = tim1.fh.value + ':'+tim1.fm.value + ':00';
	subform.tt.value = tim2.th.value + ':'+tim2.tm.value + ':00';

	subform.fd.value = cal1.fd.value;
	subform.td.value = cal2.td.value;

	// set discount code
	var dc = document.getElementById('dc');
	subform.d.value = dc.value;
	if (valid)
		subform.submit();
}
