function calcwb(gbyte) {
	if (gbyte <= 0) {
		return 0;
	}
	if (gbyte <= 10) {
		return 24.20 + 6.1 * gbyte;
	}
	if (gbyte <= 100) {
		return 24.20 + 6.1 * 10.0 + 5.5 * (gbyte - 10.0);
	}
	return 24.20 + 6.1 * 10.0 + 5.5 * 90.0 + (gbyte - 100.0) * 5.4;
}

function calcnb(gbyte) {
	if (gbyte <= 0) {
		return 0;
	}
	if (gbyte <= 10) {
		return 24.20 + 3.5 * gbyte;
	}
	if (gbyte <= 100) {
		return 24.20 + 3.5 * 10.0 + 3.2 * (gbyte - 10.0);
	}
	return 24.20 + 3.5 * 10.0 + 3.2 * 90.0 + (gbyte - 100.0) * 3.2;
}

function update(form) {
	form.gbyte.value = Math.round(form.gbyte.value);
	form.feewb.value = calcwb(form.gbyte.value) . toFixed(2);
	form.feenb.value = calcnb(form.gbyte.value) . toFixed(2);
}
