theForm=document.contactForm;

function validate() {

			if (document.contactForm.first_name.value == "")
			{
			  	alert("Please enter your first name.");
				document.contactForm.first_name.focus();
				return false;
			}
			if (document.contactForm.last_name.value == "")
			{
			  	alert("Please enter your last name.");
				document.contactForm.last_name.focus();
				return false;
			}
			if (document.contactForm.email.value == "")
			{
			  	alert("Please provide your email.");
				document.contactForm.email.focus();
				return false;
			}
			
//check if postal is preferred
	//	alert (document.contactForm.cp_mail.value);
		if(document.contactForm.cp_mail.checked == true){
				if (document.contactForm.address.value == "")
				{
				  	alert("Please enter your mailing address.");
					document.contactForm.address.focus();
					return false;
				}
				if (document.contactForm.city.value == "")
				{
				  	alert("Please enter your city.");
					document.contactForm.city.focus();
					return false;
				}
				if (document.contactForm.state.value == "")
				{
				  	alert("Please enter your state.");
					document.contactForm.state.focus();
					return false;
				}
		}			
//end check if postal is preferred			
			if (document.contactForm.zip.value == "")
			{
			  	alert("Please enter your zip code.");
				document.contactForm.zip.focus();
				return false;
			}
			
//check if phone is preferred			
		if(document.contactForm.cp_phone.checked == true){
				if (document.contactForm.phone.value == "")
				{
				  alert("Please enter your phone number.");
					document.contactForm.phone.focus();
					return false;
				}
		}
//end check if phone is preferred			
			
			if (document.contactForm.heard_about.value == "")
			{
			  	alert("Please tell us how you heard about the Glenwood Agency.");
				document.contactForm.heard_about.focus();
				return false;
			}			


	}

function requirePostal(chk){
	if(chk){
			document.reqaddress.src = "/lib/images/common/required.gif";
			document.reqcity.src = "/lib/images/common/required.gif";
			document.reqstate.src = "/lib/images/common/required.gif";
	}
	else{
			document.reqaddress.src = "/lib/images/common/notrequired.gif";
			document.reqcity.src = "/lib/images/common/notrequired.gif";
			document.reqstate.src = "/lib/images/common/notrequired.gif";
	}
}
	
function requirePhone(chk){
	if(chk){	
			document.reqphone.src = "/lib/images/common/required.gif";
	}else{
			document.reqphone.src = "/lib/images/common/notrequired.gif";
	}
}	
