rendered paste body
<html>
<head>
<script language="javascript">
function new1(form)
{
//Set the variables
var NationalBase = document.getElementById("txtNationalBase1").value;
var AgreedTotalFee = document.getElementById("txtTotalAgreeFee").value;
var Cand = document.getElementById("txtCand").value;
var LecHours = document.getElementById("txtLecHours").value;
var IndivFee = document.getElementById("txtIndivFee").value;
//Work out course costing informations
var StaffCost = parseInt(LecHours) * 60;
var LScInc = parseInt(NationalBase) * parseInt(Cand);
var IndivFeeTotal = parseInt(IndivFee) * parseInt(Cand);
var TravelCost = document.getElementById("txtTravelCost").value;
var FacCost = document.getElementById("txtFacCost").value;
var OtherCosts = document.getElementById("txtOtherCosts").value;
document.getElementById("txtTutFeeInc").value = AgreedTotalFee;
document.getElementById("txtStaffCost").value = StaffCost;
document.getElementById("txtLSCFundingInc").value = LScInc;
//Work out balances
if( document.getElementById("chkFunded").checked ) {
if( AgreedTotalFee == 0 ) {
if( parseInt(LScInc) < parseInt(AgreedTotalFee) ) {
document.getElementById("lblTutError").innerText="LSc income is not available where Tution fee is greater than the national base rate claimed";
document.getElementById("txtLSCFundingInc").value = 0;
document.getElementById("txtBalance").value = parseInt(AgreedTotalFee) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}else if( (parseInt(LScInc) * 0.95) < parseInt(AgreedTotalFee) ){
document.getElementById("lblTutError").innerText="This course is approaching full cost (not funded), consider reducing Agreed Total fee slightly";
document.getElementById("txtBalance").value = parseInt(LScInc) + parseInt(AgreedTotalFee) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}else {
document.getElementById("lblTutError").innerText="";
document.getElementById("txtBalance").value = parseInt(LScInc) + parseInt(AgreedTotalFee) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}
}else if (IndivFeeTotal == 0 ) {
if( parseInt(LScInc) < parseInt(IndivFeeTotal) ) {
document.getElementById("lblTutError").innerText="LSc income is not available where Tution fee is greater than the national base rate claimed";
document.getElementById("txtLSCFundingInc").value = 0;
document.getElementById("txtBalance").value = parseInt(IndivFeeTotal) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}else if( (parseInt(LScInc) * 0.95) < parseInt(IndivFeeTotal) ){
document.getElementById("lblTutError").innerText="This course is approaching full cost (not funded), consider reducing Agreed Total fee slightly";
document.getElementById("txtBalance").value = parseInt(LScInc) + parseInt(IndivFeeTotal) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}else {
document.getElementById("lblTutError").innerText="";
document.getElementById("txtBalance").value = parseInt(LScInc) + parseInt(IndivFeeTotal) - parseInt(StaffCost) - parseInt(TravelCost) - parseInt(FacCost) - parseInt(OtherCosts);
}
}
}
</script>