
	
function clearIncomePercent() {
document.getElementById("income_percent").value = '';
}
function clearIncomeAmount() {
document.getElementById("income_amount").value = '';
}
function clearExpensePercent() {
document.getElementById("expenses_percent").value = '';
}
function clearExpenseAmount() {
document.getElementById("expenses_amount").value = '';
}

function ValidChars(sText,ValidChars) {
	var IsNumber=true;
	var Char;
	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1)  {
			IsNumber = false;
		}
	}
	return IsNumber;
}

function checkform (form) {
	if (!ValidChars(form.startup_cost.value,"0123456789.")) {
		alert( "Please enter only numbers for the startup costs (no commas)" );
		form.startup_cost.focus();
		return false;
	}
	if (!ValidChars(form.income.value,"0123456789.")) {
		alert( "Please enter only numbers for the monthly income (no commas)" );
		form.income.focus();
		return false;
	}
	if (!ValidChars(form.income_percent.value,"0123456789.")) {
		alert( "Please enter only numbers for the income increase (no commas)" );
		form.income_percent.focus();
		return false;
	}
	if (!ValidChars(form.income_amount.value,"0123456789.")) {
		alert( "Please enter only numbers for the income increase (no commas)" );
		form.income_amount.focus();
		return false;
	}
	if (form.income_percent.value == "" && form.income_amount.value == "") {
		alert( "Please enter the monthly income increase by percent for flat amount" );
		form.income_percent.focus();
		return false;
	}
	if (!ValidChars(form.lease.value,"0123456789.")) {
		alert( "Please enter only numbers for the lease (no commas)" );
		form.lease.focus();
		return false;
	}
	if (!ValidChars(form.payroll.value,"0123456789.")) {
		alert( "Please enter only numbers for the payroll (no commas)" );
		form.payroll.focus();
		return false;
	}
	if (!ValidChars(form.taxes.value,"0123456789.")) {
		alert( "Please enter only numbers for the taxes (no commas)" );
		form.taxes.focus();
		return false;
	}
	if (!ValidChars(form.loan_payment.value,"0123456789.")) {
		alert( "Please enter only numbers for the loan payment (no commas)" );
		form.loan_payment.focus();
		return false;
	}
	if (!ValidChars(form.utilities.value,"0123456789.")) {
		alert( "Please enter only numbers for the utilities (no commas)" );
		form.utilities.focus();
		return false;
	}
	if (!ValidChars(form.supplies.value,"0123456789.")) {
		alert( "Please enter only numbers for the supplies (no commas)" );
		form.utilities.focus();
		return false;
	}
	if (!ValidChars(form.travel.value,"0123456789.")) {
		alert( "Please enter only numbers for the travel expenses (no commas)" );
		form.travel.focus();
		return false;
	}
	if (!ValidChars(form.other.value,"0123456789.")) {
		alert( "Please enter only numbers for the other expenses (no commas)" );
		form.other.focus();
		return false;
	}
	if (!ValidChars(form.expenses_percent.value,"0123456789.")) {
		alert( "Please enter only numbers for the expense increase" );
		form.expenses_percent.focus();
		return false;
	}
	if (!ValidChars(form.expenses_amount.value,"0123456789.")) {
		alert( "Please enter only numbers for the expense increase" );
		form.expenses_amount.focus();
		return false;
	}
}