<!-- this script checks client information to make sure the required fields are filled. If they are not a message box opens telling user which field was not filled and then the focus is returned to the text box.-->
function validateForm() {
	lValidFlg = true;
	if (!check_empty(document.employeeform.strFirstName.value) & lValidFlg) {
		lValidFlg = false;
		alert('Your First Name is a required field.');
		document.employeeform.strFirstName.focus() ;
	}
	if (!check_empty(document.employeeform.strCompany.value) & lValidFlg) {
		lValidFlg = false;
		alert('Company Name is a required field.');
		document.employeeform.strCompany.focus() ;
	}
	if (!check_empty(document.employeeform.strAddress1.value) & lValidFlg) {
		lValidFlg = false;
		alert('Address is a required field.');
		document.employeeform.strAddress1.focus() ;
	}
	if (!check_empty(document.employeeform.strCity.value) & lValidFlg){
		lValidFlg = false;
		alert('City is a required field.');
		document.employeeform.strCity.focus() ;
	}	
	if (!check_empty(document.employeeform.strState.value) & lValidFlg) { 
		lValidFlg = false;
		alert('State is a required field.');
		document.employeeform.strState.focus() ;
	}
	if (!check_empty(document.employeeform.strZipCode.value) & lValidFlg) { 
		lValidFlg = false;
		alert('Zip Code is a required field.');
		document.employeeform.strZipCode.focus() ;
	}	
	if (!check_empty(document.employeeform.strPhone.value) & lValidFlg) { 
 		lValidFlg = false;
		alert('Phone Number is a required field.');
		document.employeeform.strPhone.focus() ;
	}

<!-- test check boxes -->
	if (document.employeeform.cbSocialSecurityTracking.checked) {
		if (!check_empty(document.employeeform.strSubjectstrSubjectSocSecNum.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Social Security Number is a required field for Social Security Tracking.');
			document.employeeform.strSubjectstrSubjectSocSecNum.focus();
		}
	}
	if (document.employeeform.cbCriminalSearchCounty.checked) {
		if (!check_empty(document.employeeform.strCriminalCounties.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list Counties to be searched.');
			document.employeeform.strCriminalCounties.focus();
		}
	}
	if (document.employeeform.cbCriminalSearchUSFederalDistrict.checked) {
		if (!check_empty(document.employeeform.strcriminaldistricts.value) & (lvalidflg)) { 
			lValidFlg = false;
			alert('Please list Districts to be searched.');
			document.employeeform.strCriminalDistricts.focus();
		}
	}
	if (document.employeeform.cbCriminalSearchStatewide.checked) {
		if (!check_empty(document.employeeform.strCriminalStates.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list States to be searched.');
			document.employeeform.strCriminalStates.focus();
		}
	}
 
	if (document.employeeform.cbCivilSearchCounty.checked) {
		if (!check_empty(document.employeeform.strCivilCounties.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list Counties to be searched.');
			document.employeeform.strCivilCounties.focus();
		}
	}
	
	if (document.employeeform.cbCivilSearchUSFederalDistricts.checked) {
		if (!check_empty(document.employeeform.strCivilDistricts.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list Districts to be searched.');
			document.employeeform.strCivilDistricts.focus();
		}
	}
 
	if (document.employeeform.cbDriversLicenseSearch.checked) {
		if (!check_empty(document.employeeform.strSubjectLicenseNumber.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Drivers License Number is Required for a Drivers License Search.');
			document.employeeform.strSubjectLicenseNumber.focus();
		}
		if (!check_empty(document.employeeform.strSubjectLicenseState.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Drivers License State is Required for a Drivers License Search.');
			document.employeeform.strSubjectLicenseState.focus();
		}
	}



	if (document.employeeform.cbEmploymentVerification.checked) {
		if (!check_empty(document.employeeform.txtReferences.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list previous employers to be searched in the Reference section below.');
			document.employeeform.txtReferences.focus();
		}
	}
 
	if (document.employeeform.cbEducationalVerificationSearch.checked) {
		if (!check_empty(document.employeeform.txtReferences.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list Educational Facilities to be searched in the Reference section below.');
			document.employeeform.txtReferences.focus();
		}
	}
 
	if (document.employeeform.cbReferenceVerification.checked) {
		if (!check_empty(document.employeeform.txtReferences.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list references to be searched in the References section below.');
			document.employeeform.txtReferences.focus();
		}
	}
 
	if (document.employeeform.cbcpotherCopies.checked) {
		if (!check_empty(document.employeeform.strCopyType.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please list type of document.');
			document.employeeform.strCopyType.focus();
		}
	}
	if (document.employeeform.cbSexOffenderSearch.checked) {
		if (!check_empty(document.employeeform.strSubjectLastName.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please enter Last Name of subject to be searched.');
			document.employeeform.strSubjectLastName.focus();
		}
		if (!check_empty(document.employeeform.strSubjectFirstName.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('Please enter First Name of subject to be searched.');
			document.employeeform.strSubjectFirstName.focus();
		}
		if (!check_empty(document.employeeform.strSubjectCity.value) & (lValidFlg)) { 
			lValidFlg = false;
			alert('City of residence of subject is required for a Sex Offender search.');
			document.employeeform.strSubjectCity.focus();
		}
	}

<!-- Test Subject information -->
	if (!check_empty(document.employeeform.strSubjectLastName.value) & lValidFlg) { 
		lValidFlg = false;
		alert('Last Name is a required field.');
		document.employeeform.strSubjectLastName.focus() ;
	}
	if (!check_empty(document.employeeform.strSubjectFirstName.value) & lValidFlg) { 
		lValidFlg = false;
		alert('First Name is a required field.');
		document.employeeform.strSubjectFirstName.focus() ;
	}
	if (!check_empty(document.employeeform.strSubjectMiddleInitial.value) & lValidFlg) { 
		lValidFlg = false;
		alert('Middle Initial is a required field.If there is no Middle Initial, please enter NMI.');
		document.employeeform.strSubjectMiddleInitial.focus() ;
	}

	if (!check_empty(document.employeeform.strSubjectSocSecNum.value) & (lValidFlg)) { 
		lValidFlg = false;
		alert('Social Security Number is required field.');
		document.employeeform.strSubjectSocSecNum.focus();
	}
//	if (!check_empty(document.employeeform.dtSubjectBirth.value) & (lValidFlg)) { 
//		lValidFlg = false;
//		alert('Birth date is a required field.');
//		document.employeeform.dtSubjectBirth.focus();
//	}
	
return lValidFlg;
}

function check_empty(text) {
	return (text.length > 0); // returns false if empty
}

function openit(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


