var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
var numericExp = /^[0-9]+$/;

function validateMe() {
	if(document.getElementById('ltrItemOther').value.length > 500){
		alert("Your description of items you saw littered is too long for our systems. Please reduce the length of your description and resubmit.");
		return false;
		ltrItemOther.focus();
	}
	if(document.getElementById('ltrLocation').value.length > 500){
		alert("Your description of the location too long for our systems. Please reduce the length of your description and resubmit.");
		return false;
		ltrLocation.focus();
	}
	if(document.getElementById('ltrComments').value.length > 500){
		alert("Your additional comments are too long for our systems. Please reduce the length of your comments and resubmit.");
		return false;
		ltrComments.focus();
	}
	if(document.getElementById('fwyLocation').value.length > 500){
		alert("Your freeway location text is too long for our systems. Please reduce the length of your comments and resubmit.");
		return false;
		ltrComments.focus();
	}
	if(document.getElementById('ltrItemCigarette').checked == false &&
		document.getElementById('ltrItemFFContain').checked == false &&
		document.getElementById('ltrItemPaper').checked == false &&
		document.getElementById('ltrItemConstruction').checked == false &&
		document.getElementById('ltrItemOther').value.length == 0) {
		alert("Please include a description of the items littered and resubmit.");
		return false;
		ltrItemOther.focus();
	}
/*	if(document.getElementByID('ltrLocation').value.length < 1 && document.getElementByID('fwyLocation').value.length < 1){
		alert("Please include the location of the littering incident and resubmit.");
		return false;
		ltrLocation.focus(); // COMMENT THIS IF STATEMENT OUT IF IT IS GIVING YOU PROBLEMS
	}*/
	if(document.getElementById('freeways').value != "notFwy" && document.getElementById('fwyLocation').value.length == 0){
		alert("Please include an intersection or mileage description for the freeway location and resubmit.");
		return false;
		fwyLocation.focus();
	}
	if(document.getElementById('freeways').value == "notFwy" && document.getElementById('fwyLocation').value.length > 0){
		alert("Please check your freeway selection and resubmit.");
		return false;
		fwyLocation.focus();
	}
	if(document.getElementById('timeHour').value == "hour" ||
		document.getElementById('timeMin').value == "min" ||
		document.getElementById('dateMonth').value == "month" ||
		document.getElementById('dateDay').value == "day" ||
		(document.getElementById('timeAM').checked == false && document.getElementById('timePM').checked == false)) {
		alert("Please check your entry for the date and time of the littering incident and resubmit.");
		return false;
	}
	if(document.getElementById('desLicense').value.length == 0){
		alert("Please provide a valid Arizona license plate number.");
		return false;
		desLicense.focus();
	}
	if(document.getElementById('desState').value.length == 0){
		alert("Please indicate which state issued the license plate number.");
		return false;
		desState.focus();
	}
	if((document.getElementById('email').value.length == 0) && (document.getElementById('contact').checked == true)) {
		alert("If you would like us to contact you occasionally, please provide an e-mail address and resubmit.");
		return false;
		email.focus();
	}
	if((document.getElementById('email').value.length == 0) && (document.getElementById('newsletter').checked == true)) {
		alert("If you would like to receive our newsletter, please provide an e-mail address and resubmit.");
		return false;
		email.focus();
	}
	if((document.getElementById('email').value.length == 0) && (document.getElementById('volunteer').checked == true)) {
		alert("If you would like to volunteer occasionally, please provide an e-mail address and resubmit.");
		return false;
		email.focus();
	}
	if(document.getElementById('email').value.match(emailExp) || document.getElementById('email').value.length == 0) {
	} else {
		alert("There is a problem with your e-mail address. Please check it and resubmit.");
		return false;
		email.focus();
	}
	if(document.getElementById('zip').value.match(numericExp) || document.getElementById('zip').value.length == 0) {
	} else {
		alert("There is a problem with your zip code. Please check it and resubmit.");
		return false;
		zip.focus();
	}
	return true;
}