function showChecks() {
	document.getElementById('charityChecks').style.display = 'block';
}

function hideChecks() {
	document.getElementById('charityChecks').style.display = 'none';
}

function pickChecks() {
var values = "";
	for (var i=0; i < document.checks.charity.length; i++) {
		if (document.checks.charity[i].checked) {
			values += document.checks.charity[i].value + ", ";
		}
	}
	
	values += document.getElementById('charityOthers').value;
	document.getElementById('charities').value = values;
	document.getElementById('charityChecks').style.display = 'none';
}

function validateForm() {
	var errors = "";
	if(document.getElementById('name').value == "") {
		errors += "- Please provide your name before submitting.\n";
	}
	if(document.getElementById('email').value.indexOf('@') < 1) {
		errors += "- Please specify a valid email address.\n";
	}
	if(document.getElementById('zip').value == "") {
		errors += "- A primary postal code is required.\n";
	} else if(document.getElementById('zip').value.length < 5) {
		errors += "- Please specify a valid zip/postal code.\n";
	}
	if(document.getElementById('phone').value == "") {
		errors += "- A primary postal code is required.\n";
	} else if(document.getElementById('phone').value.length < 10) {
		errors += "- Please specify a valid phone number.\n";
	}
	if(document.getElementById('locations').value == "" || document.getElementById('locations').value == "Click here. Must be manager or owner, and home(s) must be valued between $200 and $20,000/night.") {
		errors += "- Please list general vacation rental locations. Specifics are not required. This helps us qualify your inquiry.\n";
	}
	if(errors == "") {
		return true;
	} else {
		alert(errors);
		return false;
	}
}