//form validation for Contact Us form
function checkContactUsForm(){
	var alertBox = "Missing fields:\n\n";
	var alertFlag = 0;
	
	if (document.contactUs.name.value == null || document.contactUs.name.value.length == 0){
		alertBox = alertBox + "Fill in name.\n";
		alertFlag = 1;
	}//end if

	if (document.contactUs.email.value == null || document.contactUs.email.value.length == 0){
		alertBox = alertBox + "Fill in email.\n";
		alertFlag = 1;
	}//end if
	
	if (document.contactUs.email.value != document.contactUs.email2.value){
		alertBox = alertBox + "Confirmation email address does not match first email address.\n";
		alertFlag = 1;
	}//end if
	
	if ( document.contactUs.dept.selectedIndex == 0 )
    {
		alertBox = alertBox + "Please select a department.\n";
		alertFlag = 1;
    }

	if (document.contactUs.comments.value == null || document.contactUs.comments.value.length == 0){
		alertBox = alertBox + "Fill in comment box.\n";
		alertFlag = 1;
	}//end if
	
	//print alert	
	if (alertFlag == 1){
		alert(alertBox);
		return false;	
	} //end if (alertFlag == 1){	
}//end function checkContactUsForm()

//form validation Hoover_Digest_Free_Issue_Form template
function checkfreeIssueForm(){
	var alertBox = "Missing fields:\n\n";
	var alertFlag = 0;
	
	if (document.freeIssue.first_name.value == null || document.freeIssue.first_name.value.length == 0){
		alertBox = alertBox + "Fill in first_name.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.last_name.value == null || document.freeIssue.last_name.value.length == 0){
		alertBox = alertBox + "Fill in last_name.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.street1.value == null || document.freeIssue.street1.value.length == 0){
		alertBox = alertBox + "Fill in street.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.city.value == null || document.freeIssue.city.value.length == 0){
		alertBox = alertBox + "Fill in city.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.state.selectedIndex == 0){
		alertBox = alertBox + "Fill in state\n";
		alertFlag = 1;
	}//end if

	if (document.freeIssue.zip.value == null || document.freeIssue.zip.value.length == 0){
		alertBox = alertBox + "Fill in zip code.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.emailAddress.value == null || document.freeIssue.emailAddress.value.length == 0){
		alertBox = alertBox + "Fill in email.\n";
		alertFlag = 1;
	}//end if
	
	if (document.freeIssue.emailAddress.value != document.freeIssue.emailAddress2.value){
		alertBox = alertBox + "Confirmation email address does not match first email address.\n";
		alertFlag = 1;
	}//end if
	
	//print alert	
	if (alertFlag == 1){
		alert(alertBox);
		return false;	
	} //end if (alertFlag == 1){	
}//end function checkfreeIssueForm()

