function validate() {

	highlightcolor = '#ffb2b2';
	normalcolor = '#ffffff';
	var returnfalse=0;

	// Check to make sure that there is a message
	if (document.contact.message.value == '') {
		document.contact.message.focus();
		document.contact.message.style.backgroundColor = highlightcolor;
		document.getElementById('error-message').innerHTML = 'Message required';
		returnfalse = 1;
	} else {
		document.contact.message.style.backgroundColor = normalcolor;
		document.getElementById('error-message').innerHTML = '';
	}

	// Check to make sure that subject isn't empty
	if (document.contact.subject.value == '') {
		document.contact.subject.focus();
		document.contact.subject.style.backgroundColor = highlightcolor;
		document.getElementById('error-subject').innerHTML = 'Subject required';
		returnfalse = 1;
	} else {
		document.contact.subject.style.backgroundColor = normalcolor;
		document.getElementById('error-subject').innerHTML = '';
	}
	
	// Check to make sure that the email has an @ sign and period if it isn't empty
	if (document.contact.email.value != '') {
		if (!(document.contact.email.value.indexOf('.') > 2) || !(document.contact.email.value.indexOf('@') > 0)) {
			document.contact.email.focus();
			document.contact.email.style.backgroundColor = highlightcolor;
			document.getElementById('error-email').innerHTML = 'Invalid email';
			returnfalse = 1;
		} else {
			document.contact.email.style.backgroundColor = normalcolor;
			document.getElementById('error-email').innerHTML = '';
		}
	} else {
		document.contact.email.focus();
		document.contact.email.style.backgroundColor = highlightcolor;
		document.getElementById('error-email').innerHTML = 'Email required';
		returnfalse = 1;
	}
	
	// Check to make sure that the phone number is composed of only numbers and that each field has the correct number of digits, if it isn't blank
	if (!((document.contact.phone3.value == '') && (document.contact.phone2.value == '') && (document.contact.phone1.value == ''))) {
		
		var phoneerror;
		
		if (isNaN(document.contact.phone3.value)) {
			document.contact.phone3.focus();
			document.contact.phone3.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else if (document.contact.phone3.value.length < 4) {
			document.contact.phone3.focus();
			document.contact.phone3.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else {
			document.contact.phone3.style.backgroundColor = normalcolor;
		}
	
		if (isNaN(document.contact.phone2.value)) {
			document.contact.phone2.focus();
			document.contact.phone2.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else if (document.contact.phone2.value.length < 3) {
			document.contact.phone2.focus();
			document.contact.phone2.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else {
			document.contact.phone2.style.backgroundColor = normalcolor;
		}

		if (isNaN(document.contact.phone1.value)) {
			document.contact.phone1.focus();
			document.contact.phone1.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else if (document.contact.phone1.value.length < 3) {
			document.contact.phone1.focus();
			document.contact.phone1.style.backgroundColor = highlightcolor;
			phoneerror = 1;
			returnfalse = 1;
		} else {
			document.contact.phone1.style.backgroundColor = normalcolor;
		}
		
		// Set error text (must since there are 3 fields with one error text thingie)
		if (phoneerror == 1) {
			document.getElementById('error-phone').innerHTML = 'Invalid phone number';
		} else {
			document.getElementById('error-phone').innerHTML = '';
		}
		
	} else {
		document.contact.phone3.style.backgroundColor = normalcolor;
		document.contact.phone2.style.backgroundColor = normalcolor;
		document.contact.phone1.style.backgroundColor = normalcolor;
		document.getElementById('error-phone').innerHTML = '';
	}

	// Check to make sure name isn't empty and contains a space
	if ((document.contact.name.value == '') || (document.contact.name.value.indexOf(' ') == -1)) {
		document.contact.name.focus();
		document.contact.name.style.backgroundColor = highlightcolor;
		document.getElementById('error-name').innerHTML = 'Full name required';
		returnfalse = 1;
	} else {
		document.contact.name.style.backgroundColor = normalcolor;
		document.getElementById('error-name').innerHTML = '';
	}

	// Check to see that a recipient is set
	if (document.contact.recipient.value == '') {
		document.contact.recipient.focus();
		document.contact.recipient.style.backgroundColor = highlightcolor;
		document.getElementById('error-recipient').innerHTML = 'Recipient required';
	} else {
		document.contact.recipient.style.backgroundColor = normalcolor;
		document.getElementById('error-recipient').innerHTML = '';
	}
	
	// Check to see what to return
	if (returnfalse != 0) {
		return(false);
	} else {
		return(true);
	}
	
}