
	function part4_calc_total() {
		var total;
		total = numeric(document.part4_calc.txt_salaries.value);
		total = total + numeric(document.part4_calc.txt_rent.value);
		total = total + numeric(document.part4_calc.txt_utilities.value);
		total = total + numeric(document.part4_calc.txt_janitorial.value);
		total = total + numeric(document.part4_calc.txt_property_taxes.value);
		total = total + numeric(document.part4_calc.txt_property_insurance.value);
		total = total + numeric(document.part4_calc.txt_furniture.value);
		total = total + numeric(document.part4_calc.txt_depreciation.value);
		total = total + numeric(document.part4_calc.txt_telephone.value);
		total = total + numeric(document.part4_calc.txt_postage.value);
		total = total + numeric(document.part4_calc.txt_accounting.value);
		total = total + numeric(document.part4_calc.txt_union.value);
		total = total + numeric(document.part4_calc.txt_business_insurance.value);
		total = total + numeric(document.part4_calc.txt_business_taxes.value);
		document.part4_calc.txt_overhead_total.value = total;
	}
	function part5_calc_total() {
		 part4_calc_total();
		var part4 = numeric(document.part4_calc.txt_overhead_total.value);
		var part5 = numeric(document.part5_calc.txt_business_income.value);
		var part6 = numeric(document.part5_calc.txt_business_income_by_you.value);
		var total = part4 * (part6 / part5);
		if (isNaN(total)) {
			alert('Please complete the form');
		} else {
			document.part5_calc.txt_monthly_total.value = total;
		}
	}
	function clear_all() {
		document.part4_calc.reset();
		document.part5_calc.reset();
	}
	function numeric(value) {
		var whole_number;
		if (value.length == 0) {
			whole_number = 0;
		} else {
			whole_number = parseInt(value);
		}
		return whole_number;
	}




	var frmvalidator  = new Validator("part4_calc");
 	frmvalidator.addValidation("txt_salaries","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_rent","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_utilities","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_janitorial","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_property_taxes","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_property_insurance","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_furniture","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_depreciation","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_telephone","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_postage","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_accounting","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_union","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_business_insurance","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_business_taxes","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");



var frmvalidator  = new Validator("part4_calc"); frmvalidator.addValidation("txt_salaries","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_rent","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_utilities","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_janitorial","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_property_taxes","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_property_insurance","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_furniture","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_depreciation","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_telephone","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_postage","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_accounting","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_union","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_business_insurance","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces."); frmvalidator.addValidation("txt_business_taxes","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");



var frmvalidator  = new Validator("part5_calc"); frmvalidator.addValidation("txt_business_income","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");frmvalidator.addValidation("txt_business_income_by_you","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");



