function validateForm(theForm) {
	errors = 0;
	errorMsg = "";
	errorFields = "";
	if (theForm.first_name.value == "") {
		errors++;
		errorFields += "- First Name\n";
	}
	if (theForm.last_name.value == "") {
		errors++;
		errorFields += "- Last Name\n";
	}
	if (theForm.phone.value == "") {
		errors++;
		errorFields += "- Phone\n";
	}
	if (theForm.email.value == "") {
		errors++;
		errorFields += "- Email\n";
	}
	if (theForm.C_State_Prov.value == "") {
		errors++;
		errorFields += "- State\n";
	}
	if (theForm.job_function) {
		myOption = -1;
		for (i=theForm.job_function.length-1; i > -1; i--) {
			if (theForm.job_function[i].checked) {
			myOption = i; i = -1;
			}
		}
		if (myOption == -1) {
			errors++;
			errorFields += "- Primary job function\n";
		}
	}
	if (theForm.BuyingHorizon.value == "") {
		errors++;
		errorFields += "- State\n";
	}
	if (errors > 0) {
		if (errorFields.length>0) {
		errorMsg += "The following fields were left blank or are incorrectly formatted.\nPlease correct and resubmit.\n\n";
		errorMsg += errorFields;
		}
		alert(errorMsg);
		return false;
	}
}


function validateNewsletterSignUp(theForm) {
	errors = 0;
	errorMsg = "";
	errorFields = "";
	if (theForm.first_name.value == "") {
		errors++;
		errorFields += "- First Name\n";
	}
	if (theForm.last_name.value == "") {
		errors++;
		errorFields += "- Last Name\n";
	}
	if (theForm.email.value == "") {
		errors++;
		errorFields += "- Email\n";
	}
	if (errors > 0) {
		if (errorFields.length>0) {
		errorMsg += "The following fields were left blank or are incorrectly formatted.\nPlease correct and resubmit.\n\n";
		errorMsg += errorFields;
		}
		alert(errorMsg);
		return false;
	}
}

/*$(document).ready(function(){
	   $("#download_logos").click(function(){
			if ($("#terms_accepted").is(":checked")) {
				window.location.href = "http://www.cppiconsuccess.com/downloads/icon_logos.zip";	
			} else {
				alert("Please check the checkbox to accept the terms of use before proceeding.");
			}
	  });
	   
	   $("#admin_links li:last-child").css("border","none");


});
*/