//*******************************************
//DO NOT REMOVE THIS COPYWRITE INFO!
//Cash Flow Calculator
//2001 Daniel C. Peterson ALL RIGHTS RESERVED
//Created: 04/16/2001
//Last Modified: 07/04/2002
//This script may not be copied, edited, distributed or reproduced
//without express written permission from
//Daniel C. Peterson of Web Winder Website Services
//For commercial use rates, contact:
//Dan Peterson:
//Web Winder Website Services
//P.O. Box 11
//Bemidji, MN  56619
//dan@webwinder.com
//http://www.webwinder.com
//Commercial User Licence #:5782-1237-48-1198
//Commercial Licence Date:2008-09-11
//*******************************************



function stripNum(num) {

   num=num.toString();


   var len = num.length;
   var rnum = "";
   var test = "";
   var j = 0;

   var b = num.substring(0,1);
   if(b == "-") {
      rnum = "-";
   }

   for(i = 0; i <= len; i++) {

      b = num.substring(i,i+1);

      if(b == "0" || b == "1" || b == "2" || b == "3" || b == "4" || b == "5" || b == "6" || b == "7" || b == "8" || b == "9" || b == ".") {
         rnum = rnum + "" + b;

      }

   }

   if(rnum == "" || rnum == "-") {
      rnum = 0;
   }

   rnum = Number(rnum);

   return rnum;

}



function formatNumber(num) {

var isNeg=0;

    if(num < 0) {
       num=num*-1;
       isNeg=1;
    }

    
	onum=Math.round(num*100)/100;
		
	integer=Math.floor(onum);

	if (Math.ceil(onum) == integer) {
		decimal="00";
	} else{
		decimal=Math.round((onum-integer)*100)
	}
	decimal=decimal.toString();
	if (decimal.length<2) decimal="0"+decimal;

	integer=integer.toString();
	var tmpnum="";
	var tmpinteger="";
	var y=0;

	for (x=integer.length;x>0;x--) {
		tmpnum=tmpnum+integer.charAt(x-1);
		y=y+1;
		if (y==3 & x>1) {
			tmpnum=tmpnum+",";
			y=0;
		}
	}

	for (x=tmpnum.length;x>0;x--) {
		tmpinteger=tmpinteger+tmpnum.charAt(x-1);
	}
		
	finNum=tmpinteger+"."+decimal;

    if(isNeg == 1) {
       finNum = "-" + finNum;
    }

	return finNum;
}


function makeReport(desc1,amt1,desc2,amt2,desc3,amt3,desc4,amt4,desc5,amt5,desc6,amt6,desc7,amt7,desc8,amt8,desc9,amt9,desc10,amt10) {

var report = "";

if(desc1.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc1 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt1 + "</small></font></TD></TR>");
  }

if(desc2.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc2 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt2 + "</small></font></TD></TR>");
  }

if(desc3.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc3 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt3 + "</small></font></TD></TR>");
  }

if(desc4.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc4 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt4 + "</small></font></TD></TR>");
  }

if(desc5.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc5 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt5 + "</small></font></TD></TR>");
  }

if(desc6.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc6 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt6 + "</small></font></TD></TR>");
  }

if(desc7.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc7 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt7 + "</small></font></TD></TR>");
  }

if(desc8.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc8 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt8 + "</small></font></TD></TR>");
  }

if(desc9.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc9 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt9 + "</small></font></TD></TR>");
  }

if(desc10.length > 0) {
   report = (report + "<TR><TD><font face='arial'><small>" + desc10 + "</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + amt10 + "</small></font></TD></TR>");
  }

return report;

}


function makeLibs() {

var incomeRpt = makeReport(document.cashflow.income_1.value,document.cashflow.income_moAmt1.value,document.cashflow.income_2.value,document.cashflow.income_moAmt2.value,document.cashflow.income_3.value,document.cashflow.income_moAmt3.value,document.cashflow.income_4.value,document.cashflow.income_moAmt4.value,document.cashflow.income_5.value,document.cashflow.income_moAmt5.value,document.cashflow.income_6.value,document.cashflow.income_moAmt6.value,document.cashflow.income_7.value,document.cashflow.income_moAmt7.value,document.cashflow.income_8.value,document.cashflow.income_moAmt8.value,document.cashflow.income_9.value,document.cashflow.income_moAmt9.value,document.cashflow.income_10.value,document.cashflow.income_moAmt10.value);

incomeRpt = (incomeRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Cash Inflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.income_totMoAmt.value + "</small></font></TD></TR>");

var adminRpt = makeReport(document.cashflow.admin_1.value,document.cashflow.admin_moAmt1.value,document.cashflow.admin_2.value,document.cashflow.admin_moAmt2.value,document.cashflow.admin_3.value,document.cashflow.admin_moAmt3.value,document.cashflow.admin_4.value,document.cashflow.admin_moAmt4.value,document.cashflow.admin_5.value,document.cashflow.admin_moAmt5.value,document.cashflow.admin_6.value,document.cashflow.admin_moAmt6.value,document.cashflow.admin_7.value,document.cashflow.admin_moAmt7.value,document.cashflow.admin_8.value,document.cashflow.admin_moAmt8.value,document.cashflow.admin_9.value,document.cashflow.admin_moAmt9.value,document.cashflow.admin_10.value,document.cashflow.admin_moAmt10.value);

adminRpt = (adminRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Administrative Outflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.admin_totMoAmt.value + "</small></font></TD></TR>");

var personRpt = makeReport(document.cashflow.person_1.value,document.cashflow.person_moAmt1.value,document.cashflow.person_2.value,document.cashflow.person_moAmt2.value,document.cashflow.person_3.value,document.cashflow.person_moAmt3.value,document.cashflow.person_4.value,document.cashflow.person_moAmt4.value,document.cashflow.person_5.value,document.cashflow.person_moAmt5.value,document.cashflow.person_6.value,document.cashflow.person_moAmt6.value,document.cashflow.person_7.value,document.cashflow.person_moAmt7.value,document.cashflow.person_8.value,document.cashflow.person_moAmt8.value,document.cashflow.person_9.value,document.cashflow.person_moAmt9.value,document.cashflow.person_10.value,document.cashflow.person_moAmt10.value);

personRpt = (personRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Personnel Outflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.person_totMoAmt.value + "</small></font></TD></TR>");

var transRpt = makeReport(document.cashflow.trans_1.value,document.cashflow.trans_moAmt1.value,document.cashflow.trans_2.value,document.cashflow.trans_moAmt2.value,document.cashflow.trans_3.value,document.cashflow.trans_moAmt3.value,document.cashflow.trans_4.value,document.cashflow.trans_moAmt4.value,document.cashflow.trans_5.value,document.cashflow.trans_moAmt5.value,document.cashflow.trans_6.value,document.cashflow.trans_moAmt6.value,document.cashflow.trans_7.value,document.cashflow.trans_moAmt7.value,document.cashflow.trans_8.value,document.cashflow.trans_moAmt8.value,document.cashflow.trans_9.value,document.cashflow.trans_moAmt9.value,document.cashflow.trans_10.value,document.cashflow.trans_moAmt10.value);

transRpt = (transRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Transportation Outflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.trans_totMoAmt.value + "</small></font></TD></TR>");

var resideRpt = makeReport(document.cashflow.reside_1.value,document.cashflow.reside_moAmt1.value,document.cashflow.reside_2.value,document.cashflow.reside_moAmt2.value,document.cashflow.reside_3.value,document.cashflow.reside_moAmt3.value,document.cashflow.reside_4.value,document.cashflow.reside_moAmt4.value,document.cashflow.reside_5.value,document.cashflow.reside_moAmt5.value,document.cashflow.reside_6.value,document.cashflow.reside_moAmt6.value,document.cashflow.reside_7.value,document.cashflow.reside_moAmt7.value,document.cashflow.reside_8.value,document.cashflow.reside_moAmt8.value,document.cashflow.reside_9.value,document.cashflow.reside_moAmt9.value,document.cashflow.reside_10.value,document.cashflow.reside_moAmt10.value);

resideRpt = (resideRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Residential Outflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.reside_totMoAmt.value + "</small></font></TD></TR>");


var entertainRpt = makeReport(document.cashflow.entertain_1.value,document.cashflow.entertain_moAmt1.value,document.cashflow.entertain_2.value,document.cashflow.entertain_moAmt2.value,document.cashflow.entertain_3.value,document.cashflow.entertain_moAmt3.value,document.cashflow.entertain_4.value,document.cashflow.entertain_moAmt4.value,document.cashflow.entertain_5.value,document.cashflow.entertain_moAmt5.value,document.cashflow.entertain_6.value,document.cashflow.entertain_moAmt6.value,document.cashflow.entertain_7.value,document.cashflow.entertain_moAmt7.value,document.cashflow.entertain_8.value,document.cashflow.entertain_moAmt8.value,document.cashflow.entertain_9.value,document.cashflow.entertain_moAmt9.value,document.cashflow.entertain_10.value,document.cashflow.entertain_moAmt10.value);

entertainRpt = (entertainRpt + "<TR><TD ALIGN=RIGHT><font face='arial'><small><B>Total Entertainment Outflow:</B></small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.entertain_totMoAmt.value + "</small></font></TD></TR>");

var totalRpt =("<TR><TD><font face='arial'><small>Cash Inflows</TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.income_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small>Administrative Outflows</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.admin_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small>Personnel Outflows</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.person_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small>Transportation Outflows</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.trans_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small>Residential Outflows</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.reside_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small>Entertainment Outflows</small></font></TD><TD ALIGN=RIGHT><font face='arial'><small>" + document.cashflow.entertain_total.value + "</small></font></TD></TR><TR><TD><font face='arial'><small><B>Total Cash Outflows</B></small></font></TD><TD><font face='arial'><small>" + document.cashflow.totalOut.value + "</small></font></TD></TR><TR><TD><B>NET CASH FLOW</B></small></font></TD><TD><font face='arial'><small><B>" + document.cashflow.netFlow.value + "</B></small></font></TD></TR>");



var Vcashflow = "<HEAD><TITLE>Cash Flow Report</TITLE></HEAD>" + "<BODY BGCOLOR =  '#FFFFFF'><CENTER><FONT face='arial'><big><strong>Cash Flow Report</strong></big></FONT></CENTER><P><TABLE><TR><TD COLSPAN=2><HR><font face='arial'><small><B>Cash Inflow</B></small></font></TD></TR>" + incomeRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Administrative Outflows</B></small></font></TD></TR>" + adminRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Personnel Outflows</B></small></font></TD></TR>" + personRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Transporation Outflows</B></small></font></TD></TR>" + transRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Residential</B></small></font></TD></TR>" + resideRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Entertainment Outflows</B></small></font></TD></TR>" + entertainRpt + "<TR><TD COLSPAN=2><HR><font face='arial'><small><B>Total Inflows & Outflows</B></small></font></TD></TR>" + totalRpt + "</TABLE><P><center><font face='arial'><small>This report was created with <U>The Cash Flow Calculator</U><BR>Written by Daniel C. Peterson<BR>Calculator can be found at http://www.webwinder.com</small></font><p><form method='post'><input type='button' value='Close Window' onClick='window.close()'></form></CENTER></body></html>";

libsWin = window.open("","","width=400,height=350,toolbar=yes,menubar=yes,scrollbars=yes");

libsWin.document.write(Vcashflow);
libsWin.document.close();
}

function computeLine(pmtPerYear,pmtAmount) {

var moAmount = 0;

if(pmtPerYear == "" || pmtPerYear == 0) {
      moAmount = 0;
      } else {
      moAmount = ((pmtPerYear * pmtAmount) /12);
      }
      return parseInt(moAmount,10);
   }

function computeForm(form) {

var accumBal = 0;

//COMPUTE INCOME

var Vincome_totMoAmt = 0;

var Vincome_ppYr1 = stripNum(form.income_ppYr1.value);
var Vincome_pmt1 = stripNum(form.income_pmt1.value);
if(Vincome_ppYr1 > 0 && Vincome_pmt1 > 0) {
   var Vincome_moAmt1 = (Vincome_ppYr1 * Vincome_pmt1) / 12;
   form.income_moAmt1.value = formatNumber(Vincome_moAmt1);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt1);
}

var Vincome_ppYr2 = stripNum(form.income_ppYr2.value);
var Vincome_pmt2 = stripNum(form.income_pmt2.value);
if(Vincome_ppYr2 > 0 && Vincome_pmt2 > 0) {
   var Vincome_moAmt2 = (Vincome_ppYr2 * Vincome_pmt2) / 12;
   form.income_moAmt2.value = formatNumber(Vincome_moAmt2);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt2);
}

var Vincome_ppYr3 = stripNum(form.income_ppYr3.value);
var Vincome_pmt3 = stripNum(form.income_pmt3.value);
if(Vincome_ppYr3 > 0 && Vincome_pmt3 > 0) {
   var Vincome_moAmt3 = (Vincome_ppYr3 * Vincome_pmt3) / 12;
   form.income_moAmt3.value = formatNumber(Vincome_moAmt3);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt3);
}

var Vincome_ppYr4 = stripNum(form.income_ppYr4.value);
var Vincome_pmt4 = stripNum(form.income_pmt4.value);
if(Vincome_ppYr4 > 0 && Vincome_pmt4 > 0) {
   var Vincome_moAmt4 = (Vincome_ppYr4 * Vincome_pmt4) / 12;
   form.income_moAmt4.value = formatNumber(Vincome_moAmt4);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt4);
}

var Vincome_ppYr5 = stripNum(form.income_ppYr5.value);
var Vincome_pmt5 = stripNum(form.income_pmt5.value);
if(Vincome_ppYr5 > 0 && Vincome_pmt5 > 0) {
   var Vincome_moAmt5 = (Vincome_ppYr5 * Vincome_pmt5) / 12;
   form.income_moAmt5.value = formatNumber(Vincome_moAmt5);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt5);
}

var Vincome_ppYr6 = stripNum(form.income_ppYr6.value);
var Vincome_pmt6 = stripNum(form.income_pmt6.value);
if(Vincome_ppYr6 > 0 && Vincome_pmt6 > 0) {
   var Vincome_moAmt6 = (Vincome_ppYr6 * Vincome_pmt6) / 12;
   form.income_moAmt6.value = formatNumber(Vincome_moAmt6);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt6);
}

var Vincome_ppYr7 = stripNum(form.income_ppYr7.value);
var Vincome_pmt7 = stripNum(form.income_pmt7.value);
if(Vincome_ppYr7 > 0 && Vincome_pmt7 > 0) {
   var Vincome_moAmt7 = (Vincome_ppYr7 * Vincome_pmt7) / 12;
   form.income_moAmt7.value = formatNumber(Vincome_moAmt7);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt7);
}

var Vincome_ppYr8 = stripNum(form.income_ppYr8.value);
var Vincome_pmt8 = stripNum(form.income_pmt8.value);
if(Vincome_ppYr8 > 0 && Vincome_pmt8 > 0) {
   var Vincome_moAmt8 = (Vincome_ppYr8 * Vincome_pmt8) / 12;
   form.income_moAmt8.value = formatNumber(Vincome_moAmt8);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt8);
}

var Vincome_ppYr9 = stripNum(form.income_ppYr9.value);
var Vincome_pmt9 = stripNum(form.income_pmt9.value);
if(Vincome_ppYr9 > 0 && Vincome_pmt9 > 0) {
   var Vincome_moAmt9 = (Vincome_ppYr9 * Vincome_pmt9) / 12;
   form.income_moAmt9.value = formatNumber(Vincome_moAmt9);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt9);
}

var Vincome_ppYr10 = stripNum(form.income_ppYr10.value);
var Vincome_pmt10 = stripNum(form.income_pmt10.value);
if(Vincome_ppYr10 > 0 && Vincome_pmt10 > 0) {
   var Vincome_moAmt10 = (Vincome_ppYr10 * Vincome_pmt10) / 12;
   form.income_moAmt10.value = formatNumber(Vincome_moAmt10);
   Vincome_totMoAmt = eval( Vincome_totMoAmt) + eval(Vincome_moAmt10);
}

form.income_totMoAmt.value = formatNumber(Vincome_totMoAmt);
accumBal = Vincome_totMoAmt;

form.adminBal.value = formatNumber(accumBal);

//COMPUTE ADMIN

var Vadmin_totMoAmt = 0;

var Vadmin_ppYr1 = stripNum(form.admin_ppYr1.value);
var Vadmin_pmt1 = stripNum(form.admin_pmt1.value);
if(Vadmin_ppYr1 > 0 && Vadmin_pmt1 > 0) {
   var Vadmin_moAmt1 = (Vadmin_ppYr1 * Vadmin_pmt1) / 12;
   form.admin_moAmt1.value = formatNumber(Vadmin_moAmt1);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt1);
}

var Vadmin_ppYr2 = stripNum(form.admin_ppYr2.value);
var Vadmin_pmt2 = stripNum(form.admin_pmt2.value);
if(Vadmin_ppYr2 > 0 && Vadmin_pmt2 > 0) {
   var Vadmin_moAmt2 = (Vadmin_ppYr2 * Vadmin_pmt2) / 12;
   form.admin_moAmt2.value = formatNumber(Vadmin_moAmt2);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt2);
}

var Vadmin_ppYr3 = stripNum(form.admin_ppYr3.value);
var Vadmin_pmt3 = stripNum(form.admin_pmt3.value);
if(Vadmin_ppYr3 > 0 && Vadmin_pmt3 > 0) {
   var Vadmin_moAmt3 = (Vadmin_ppYr3 * Vadmin_pmt3) / 12;
   form.admin_moAmt3.value = formatNumber(Vadmin_moAmt3);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt3);
}

var Vadmin_ppYr4 = stripNum(form.admin_ppYr4.value);
var Vadmin_pmt4 = stripNum(form.admin_pmt4.value);
if(Vadmin_ppYr4 > 0 && Vadmin_pmt4 > 0) {
   var Vadmin_moAmt4 = (Vadmin_ppYr4 * Vadmin_pmt4) / 12;
   form.admin_moAmt4.value = formatNumber(Vadmin_moAmt4);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt4);
}

var Vadmin_ppYr5 = stripNum(form.admin_ppYr5.value);
var Vadmin_pmt5 = stripNum(form.admin_pmt5.value);
if(Vadmin_ppYr5 > 0 && Vadmin_pmt5 > 0) {
   var Vadmin_moAmt5 = (Vadmin_ppYr5 * Vadmin_pmt5) / 12;
   form.admin_moAmt5.value = formatNumber(Vadmin_moAmt5);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt5);
}

var Vadmin_ppYr6 = stripNum(form.admin_ppYr6.value);
var Vadmin_pmt6 = stripNum(form.admin_pmt6.value);
if(Vadmin_ppYr6 > 0 && Vadmin_pmt6 > 0) {
   var Vadmin_moAmt6 = (Vadmin_ppYr6 * Vadmin_pmt6) / 12;
   form.admin_moAmt6.value = formatNumber(Vadmin_moAmt6);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt6);
}

var Vadmin_ppYr7 = stripNum(form.admin_ppYr7.value);
var Vadmin_pmt7 = stripNum(form.admin_pmt7.value);
if(Vadmin_ppYr7 > 0 && Vadmin_pmt7 > 0) {
   var Vadmin_moAmt7 = (Vadmin_ppYr7 * Vadmin_pmt7) / 12;
   form.admin_moAmt7.value = formatNumber(Vadmin_moAmt7);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt7);
}

var Vadmin_ppYr8 = stripNum(form.admin_ppYr8.value);
var Vadmin_pmt8 = stripNum(form.admin_pmt8.value);
if(Vadmin_ppYr8 > 0 && Vadmin_pmt8 > 0) {
   var Vadmin_moAmt8 = (Vadmin_ppYr8 * Vadmin_pmt8) / 12;
   form.admin_moAmt8.value = formatNumber(Vadmin_moAmt8);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt8);
}

var Vadmin_ppYr9 = stripNum(form.admin_ppYr9.value);
var Vadmin_pmt9 = stripNum(form.admin_pmt9.value);
if(Vadmin_ppYr9 > 0 && Vadmin_pmt9 > 0) {
   var Vadmin_moAmt9 = (Vadmin_ppYr9 * Vadmin_pmt9) / 12;
   form.admin_moAmt9.value = formatNumber(Vadmin_moAmt9);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt9);
}

var Vadmin_ppYr10 = stripNum(form.admin_ppYr10.value);
var Vadmin_pmt10 = stripNum(form.admin_pmt10.value);
if(Vadmin_ppYr10 > 0 && Vadmin_pmt10 > 0) {
   var Vadmin_moAmt10 = (Vadmin_ppYr10 * Vadmin_pmt10) / 12;
   form.admin_moAmt10.value = formatNumber(Vadmin_moAmt10);
   Vadmin_totMoAmt = eval( Vadmin_totMoAmt) + eval(Vadmin_moAmt10);
}

form.admin_totMoAmt.value = formatNumber(Vadmin_totMoAmt);
accumBal = eval(accumBal) - eval(Vadmin_totMoAmt);

form.personBal.value = formatNumber(accumBal);

//COMPUTE PERSONNEL

var Vperson_totMoAmt = 0;

var Vperson_ppYr1 = stripNum(form.person_ppYr1.value);
var Vperson_pmt1 = stripNum(form.person_pmt1.value);
if(Vperson_ppYr1 > 0 && Vperson_pmt1 > 0) {
   var Vperson_moAmt1 = (Vperson_ppYr1 * Vperson_pmt1) / 12;
   form.person_moAmt1.value = formatNumber(Vperson_moAmt1);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt1);
}

var Vperson_ppYr2 = stripNum(form.person_ppYr2.value);
var Vperson_pmt2 = stripNum(form.person_pmt2.value);
if(Vperson_ppYr2 > 0 && Vperson_pmt2 > 0) {
   var Vperson_moAmt2 = (Vperson_ppYr2 * Vperson_pmt2) / 12;
   form.person_moAmt2.value = formatNumber(Vperson_moAmt2);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt2);
}

var Vperson_ppYr3 = stripNum(form.person_ppYr3.value);
var Vperson_pmt3 = stripNum(form.person_pmt3.value);
if(Vperson_ppYr3 > 0 && Vperson_pmt3 > 0) {
   var Vperson_moAmt3 = (Vperson_ppYr3 * Vperson_pmt3) / 12;
   form.person_moAmt3.value = formatNumber(Vperson_moAmt3);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt3);
}

var Vperson_ppYr4 = stripNum(form.person_ppYr4.value);
var Vperson_pmt4 = stripNum(form.person_pmt4.value);
if(Vperson_ppYr4 > 0 && Vperson_pmt4 > 0) {
   var Vperson_moAmt4 = (Vperson_ppYr4 * Vperson_pmt4) / 12;
   form.person_moAmt4.value = formatNumber(Vperson_moAmt4);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt4);
}

var Vperson_ppYr5 = stripNum(form.person_ppYr5.value);
var Vperson_pmt5 = stripNum(form.person_pmt5.value);
if(Vperson_ppYr5 > 0 && Vperson_pmt5 > 0) {
   var Vperson_moAmt5 = (Vperson_ppYr5 * Vperson_pmt5) / 12;
   form.person_moAmt5.value = formatNumber(Vperson_moAmt5);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt5);
}

var Vperson_ppYr6 = stripNum(form.person_ppYr6.value);
var Vperson_pmt6 = stripNum(form.person_pmt6.value);
if(Vperson_ppYr6 > 0 && Vperson_pmt6 > 0) {
   var Vperson_moAmt6 = (Vperson_ppYr6 * Vperson_pmt6) / 12;
   form.person_moAmt6.value = formatNumber(Vperson_moAmt6);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt6);
}

var Vperson_ppYr7 = stripNum(form.person_ppYr7.value);
var Vperson_pmt7 = stripNum(form.person_pmt7.value);
if(Vperson_ppYr7 > 0 && Vperson_pmt7 > 0) {
   var Vperson_moAmt7 = (Vperson_ppYr7 * Vperson_pmt7) / 12;
   form.person_moAmt7.value = formatNumber(Vperson_moAmt7);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt7);
}

var Vperson_ppYr8 = stripNum(form.person_ppYr8.value);
var Vperson_pmt8 = stripNum(form.person_pmt8.value);
if(Vperson_ppYr8 > 0 && Vperson_pmt8 > 0) {
   var Vperson_moAmt8 = (Vperson_ppYr8 * Vperson_pmt8) / 12;
   form.person_moAmt8.value = formatNumber(Vperson_moAmt8);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt8);
}

var Vperson_ppYr9 = stripNum(form.person_ppYr9.value);
var Vperson_pmt9 = stripNum(form.person_pmt9.value);
if(Vperson_ppYr9 > 0 && Vperson_pmt9 > 0) {
   var Vperson_moAmt9 = (Vperson_ppYr9 * Vperson_pmt9) / 12;
   form.person_moAmt9.value = formatNumber(Vperson_moAmt9);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt9);
}

var Vperson_ppYr10 = stripNum(form.person_ppYr10.value);
var Vperson_pmt10 = stripNum(form.person_pmt10.value);
if(Vperson_ppYr10 > 0 && Vperson_pmt10 > 0) {
   var Vperson_moAmt10 = (Vperson_ppYr10 * Vperson_pmt10) / 12;
   form.person_moAmt10.value = formatNumber(Vperson_moAmt10);
   Vperson_totMoAmt = eval( Vperson_totMoAmt) + eval(Vperson_moAmt10);
}

form.person_totMoAmt.value = formatNumber(Vperson_totMoAmt);
accumBal = eval(accumBal) - eval(Vperson_totMoAmt);

form.transBal.value = formatNumber(accumBal);

//COMPUTE TRANSPORTATION

var Vtrans_totMoAmt = 0;

var Vtrans_ppYr1 = stripNum(form.trans_ppYr1.value);
var Vtrans_pmt1 = stripNum(form.trans_pmt1.value);
if(Vtrans_ppYr1 > 0 && Vtrans_pmt1 > 0) {
   var Vtrans_moAmt1 = (Vtrans_ppYr1 * Vtrans_pmt1) / 12;
   form.trans_moAmt1.value = formatNumber(Vtrans_moAmt1);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt1);
}

var Vtrans_ppYr2 = stripNum(form.trans_ppYr2.value);
var Vtrans_pmt2 = stripNum(form.trans_pmt2.value);
if(Vtrans_ppYr2 > 0 && Vtrans_pmt2 > 0) {
   var Vtrans_moAmt2 = (Vtrans_ppYr2 * Vtrans_pmt2) / 12;
   form.trans_moAmt2.value = formatNumber(Vtrans_moAmt2);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt2);
}

var Vtrans_ppYr3 = stripNum(form.trans_ppYr3.value);
var Vtrans_pmt3 = stripNum(form.trans_pmt3.value);
if(Vtrans_ppYr3 > 0 && Vtrans_pmt3 > 0) {
   var Vtrans_moAmt3 = (Vtrans_ppYr3 * Vtrans_pmt3) / 12;
   form.trans_moAmt3.value = formatNumber(Vtrans_moAmt3);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt3);
}

var Vtrans_ppYr4 = stripNum(form.trans_ppYr4.value);
var Vtrans_pmt4 = stripNum(form.trans_pmt4.value);
if(Vtrans_ppYr4 > 0 && Vtrans_pmt4 > 0) {
   var Vtrans_moAmt4 = (Vtrans_ppYr4 * Vtrans_pmt4) / 12;
   form.trans_moAmt4.value = formatNumber(Vtrans_moAmt4);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt4);
}

var Vtrans_ppYr5 = stripNum(form.trans_ppYr5.value);
var Vtrans_pmt5 = stripNum(form.trans_pmt5.value);
if(Vtrans_ppYr5 > 0 && Vtrans_pmt5 > 0) {
   var Vtrans_moAmt5 = (Vtrans_ppYr5 * Vtrans_pmt5) / 12;
   form.trans_moAmt5.value = formatNumber(Vtrans_moAmt5);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt5);
}

var Vtrans_ppYr6 = stripNum(form.trans_ppYr6.value);
var Vtrans_pmt6 = stripNum(form.trans_pmt6.value);
if(Vtrans_ppYr6 > 0 && Vtrans_pmt6 > 0) {
   var Vtrans_moAmt6 = (Vtrans_ppYr6 * Vtrans_pmt6) / 12;
   form.trans_moAmt6.value = formatNumber(Vtrans_moAmt6);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt6);
}

var Vtrans_ppYr7 = stripNum(form.trans_ppYr7.value);
var Vtrans_pmt7 = stripNum(form.trans_pmt7.value);
if(Vtrans_ppYr7 > 0 && Vtrans_pmt7 > 0) {
   var Vtrans_moAmt7 = (Vtrans_ppYr7 * Vtrans_pmt7) / 12;
   form.trans_moAmt7.value = formatNumber(Vtrans_moAmt7);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt7);
}

var Vtrans_ppYr8 = stripNum(form.trans_ppYr8.value);
var Vtrans_pmt8 = stripNum(form.trans_pmt8.value);
if(Vtrans_ppYr8 > 0 && Vtrans_pmt8 > 0) {
   var Vtrans_moAmt8 = (Vtrans_ppYr8 * Vtrans_pmt8) / 12;
   form.trans_moAmt8.value = formatNumber(Vtrans_moAmt8);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt8);
}

var Vtrans_ppYr9 = stripNum(form.trans_ppYr9.value);
var Vtrans_pmt9 = stripNum(form.trans_pmt9.value);
if(Vtrans_ppYr9 > 0 && Vtrans_pmt9 > 0) {
   var Vtrans_moAmt9 = (Vtrans_ppYr9 * Vtrans_pmt9) / 12;
   form.trans_moAmt9.value = formatNumber(Vtrans_moAmt9);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt9);
}

var Vtrans_ppYr10 = stripNum(form.trans_ppYr10.value);
var Vtrans_pmt10 = stripNum(form.trans_pmt10.value);
if(Vtrans_ppYr10 > 0 && Vtrans_pmt10 > 0) {
   var Vtrans_moAmt10 = (Vtrans_ppYr10 * Vtrans_pmt10) / 12;
   form.trans_moAmt10.value = formatNumber(Vtrans_moAmt10);
   Vtrans_totMoAmt = eval( Vtrans_totMoAmt) + eval(Vtrans_moAmt10);
}

form.trans_totMoAmt.value = formatNumber(Vtrans_totMoAmt);
accumBal = eval(accumBal) - eval(Vtrans_totMoAmt);

form.resideBal.value = formatNumber(accumBal);


//COMPUTE RESIDENTIAL

var Vreside_totMoAmt = 0;

var Vreside_ppYr1 = stripNum(form.reside_ppYr1.value);
var Vreside_pmt1 = stripNum(form.reside_pmt1.value);
if(Vreside_ppYr1 > 0 && Vreside_pmt1 > 0) {
   var Vreside_moAmt1 = (Vreside_ppYr1 * Vreside_pmt1) / 12;
   form.reside_moAmt1.value = formatNumber(Vreside_moAmt1);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt1);
}

var Vreside_ppYr2 = stripNum(form.reside_ppYr2.value);
var Vreside_pmt2 = stripNum(form.reside_pmt2.value);
if(Vreside_ppYr2 > 0 && Vreside_pmt2 > 0) {
   var Vreside_moAmt2 = (Vreside_ppYr2 * Vreside_pmt2) / 12;
   form.reside_moAmt2.value = formatNumber(Vreside_moAmt2);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt2);
}

var Vreside_ppYr3 = stripNum(form.reside_ppYr3.value);
var Vreside_pmt3 = stripNum(form.reside_pmt3.value);
if(Vreside_ppYr3 > 0 && Vreside_pmt3 > 0) {
   var Vreside_moAmt3 = (Vreside_ppYr3 * Vreside_pmt3) / 12;
   form.reside_moAmt3.value = formatNumber(Vreside_moAmt3);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt3);
}

var Vreside_ppYr4 = stripNum(form.reside_ppYr4.value);
var Vreside_pmt4 = stripNum(form.reside_pmt4.value);
if(Vreside_ppYr4 > 0 && Vreside_pmt4 > 0) {
   var Vreside_moAmt4 = (Vreside_ppYr4 * Vreside_pmt4) / 12;
   form.reside_moAmt4.value = formatNumber(Vreside_moAmt4);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt4);
}

var Vreside_ppYr5 = stripNum(form.reside_ppYr5.value);
var Vreside_pmt5 = stripNum(form.reside_pmt5.value);
if(Vreside_ppYr5 > 0 && Vreside_pmt5 > 0) {
   var Vreside_moAmt5 = (Vreside_ppYr5 * Vreside_pmt5) / 12;
   form.reside_moAmt5.value = formatNumber(Vreside_moAmt5);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt5);
}

var Vreside_ppYr6 = stripNum(form.reside_ppYr6.value);
var Vreside_pmt6 = stripNum(form.reside_pmt6.value);
if(Vreside_ppYr6 > 0 && Vreside_pmt6 > 0) {
   var Vreside_moAmt6 = (Vreside_ppYr6 * Vreside_pmt6) / 12;
   form.reside_moAmt6.value = formatNumber(Vreside_moAmt6);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt6);
}

var Vreside_ppYr7 = stripNum(form.reside_ppYr7.value);
var Vreside_pmt7 = stripNum(form.reside_pmt7.value);
if(Vreside_ppYr7 > 0 && Vreside_pmt7 > 0) {
   var Vreside_moAmt7 = (Vreside_ppYr7 * Vreside_pmt7) / 12;
   form.reside_moAmt7.value = formatNumber(Vreside_moAmt7);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt7);
}

var Vreside_ppYr8 = stripNum(form.reside_ppYr8.value);
var Vreside_pmt8 = stripNum(form.reside_pmt8.value);
if(Vreside_ppYr8 > 0 && Vreside_pmt8 > 0) {
   var Vreside_moAmt8 = (Vreside_ppYr8 * Vreside_pmt8) / 12;
   form.reside_moAmt8.value = formatNumber(Vreside_moAmt8);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt8);
}

var Vreside_ppYr9 = stripNum(form.reside_ppYr9.value);
var Vreside_pmt9 = stripNum(form.reside_pmt9.value);
if(Vreside_ppYr9 > 0 && Vreside_pmt9 > 0) {
   var Vreside_moAmt9 = (Vreside_ppYr9 * Vreside_pmt9) / 12;
   form.reside_moAmt9.value = formatNumber(Vreside_moAmt9);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt9);
}

var Vreside_ppYr10 = stripNum(form.reside_ppYr10.value);
var Vreside_pmt10 = stripNum(form.reside_pmt10.value);
if(Vreside_ppYr10 > 0 && Vreside_pmt10 > 0) {
   var Vreside_moAmt10 = (Vreside_ppYr10 * Vreside_pmt10) / 12;
   form.reside_moAmt10.value = formatNumber(Vreside_moAmt10);
   Vreside_totMoAmt = eval( Vreside_totMoAmt) + eval(Vreside_moAmt10);
}

form.reside_totMoAmt.value = formatNumber(Vreside_totMoAmt);
accumBal = eval(accumBal) - eval(Vreside_totMoAmt);

form.entertainBal.value = formatNumber(accumBal);

//COMPUTE ENTERTAINMENT

var Ventertain_totMoAmt = 0;

var Ventertain_ppYr1 = stripNum(form.entertain_ppYr1.value);
var Ventertain_pmt1 = stripNum(form.entertain_pmt1.value);
if(Ventertain_ppYr1 > 0 && Ventertain_pmt1 > 0) {
   var Ventertain_moAmt1 = (Ventertain_ppYr1 * Ventertain_pmt1) / 12;
   form.entertain_moAmt1.value = formatNumber(Ventertain_moAmt1);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt1);
}

var Ventertain_ppYr2 = stripNum(form.entertain_ppYr2.value);
var Ventertain_pmt2 = stripNum(form.entertain_pmt2.value);
if(Ventertain_ppYr2 > 0 && Ventertain_pmt2 > 0) {
   var Ventertain_moAmt2 = (Ventertain_ppYr2 * Ventertain_pmt2) / 12;
   form.entertain_moAmt2.value = formatNumber(Ventertain_moAmt2);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt2);
}

var Ventertain_ppYr3 = stripNum(form.entertain_ppYr3.value);
var Ventertain_pmt3 = stripNum(form.entertain_pmt3.value);
if(Ventertain_ppYr3 > 0 && Ventertain_pmt3 > 0) {
   var Ventertain_moAmt3 = (Ventertain_ppYr3 * Ventertain_pmt3) / 12;
   form.entertain_moAmt3.value = formatNumber(Ventertain_moAmt3);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt3);
}

var Ventertain_ppYr4 = stripNum(form.entertain_ppYr4.value);
var Ventertain_pmt4 = stripNum(form.entertain_pmt4.value);
if(Ventertain_ppYr4 > 0 && Ventertain_pmt4 > 0) {
   var Ventertain_moAmt4 = (Ventertain_ppYr4 * Ventertain_pmt4) / 12;
   form.entertain_moAmt4.value = formatNumber(Ventertain_moAmt4);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt4);
}

var Ventertain_ppYr5 = stripNum(form.entertain_ppYr5.value);
var Ventertain_pmt5 = stripNum(form.entertain_pmt5.value);
if(Ventertain_ppYr5 > 0 && Ventertain_pmt5 > 0) {
   var Ventertain_moAmt5 = (Ventertain_ppYr5 * Ventertain_pmt5) / 12;
   form.entertain_moAmt5.value = formatNumber(Ventertain_moAmt5);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt5);
}

var Ventertain_ppYr6 = stripNum(form.entertain_ppYr6.value);
var Ventertain_pmt6 = stripNum(form.entertain_pmt6.value);
if(Ventertain_ppYr6 > 0 && Ventertain_pmt6 > 0) {
   var Ventertain_moAmt6 = (Ventertain_ppYr6 * Ventertain_pmt6) / 12;
   form.entertain_moAmt6.value = formatNumber(Ventertain_moAmt6);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt6);
}

var Ventertain_ppYr7 = stripNum(form.entertain_ppYr7.value);
var Ventertain_pmt7 = stripNum(form.entertain_pmt7.value);
if(Ventertain_ppYr7 > 0 && Ventertain_pmt7 > 0) {
   var Ventertain_moAmt7 = (Ventertain_ppYr7 * Ventertain_pmt7) / 12;
   form.entertain_moAmt7.value = formatNumber(Ventertain_moAmt7);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt7);
}

var Ventertain_ppYr8 = stripNum(form.entertain_ppYr8.value);
var Ventertain_pmt8 = stripNum(form.entertain_pmt8.value);
if(Ventertain_ppYr8 > 0 && Ventertain_pmt8 > 0) {
   var Ventertain_moAmt8 = (Ventertain_ppYr8 * Ventertain_pmt8) / 12;
   form.entertain_moAmt8.value = formatNumber(Ventertain_moAmt8);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt8);
}

var Ventertain_ppYr9 = stripNum(form.entertain_ppYr9.value);
var Ventertain_pmt9 = stripNum(form.entertain_pmt9.value);
if(Ventertain_ppYr9 > 0 && Ventertain_pmt9 > 0) {
   var Ventertain_moAmt9 = (Ventertain_ppYr9 * Ventertain_pmt9) / 12;
   form.entertain_moAmt9.value = formatNumber(Ventertain_moAmt9);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt9);
}

var Ventertain_ppYr10 = stripNum(form.entertain_ppYr10.value);
var Ventertain_pmt10 = stripNum(form.entertain_pmt10.value);
if(Ventertain_ppYr10 > 0 && Ventertain_pmt10 > 0) {
   var Ventertain_moAmt10 = (Ventertain_ppYr10 * Ventertain_pmt10) / 12;
   form.entertain_moAmt10.value = formatNumber(Ventertain_moAmt10);
   Ventertain_totMoAmt = eval( Ventertain_totMoAmt) + eval(Ventertain_moAmt10);
}

form.entertain_totMoAmt.value = formatNumber(Ventertain_totMoAmt);
accumBal = eval(accumBal) - eval(Ventertain_totMoAmt);


form.income_total.value = formatNumber(Vincome_totMoAmt);
form.admin_total.value = formatNumber(Vadmin_totMoAmt);
form.person_total.value = formatNumber(Vperson_totMoAmt);
form.trans_total.value = formatNumber(Vtrans_totMoAmt);
form.reside_total.value = formatNumber(Vreside_totMoAmt);
form.entertain_total.value = formatNumber(Ventertain_totMoAmt);

var VtotalOut = eval(Vadmin_totMoAmt) + eval(Vperson_totMoAmt) + eval(Vtrans_totMoAmt) + eval(Vreside_totMoAmt) + eval(Ventertain_totMoAmt);

form.totalOut.value = formatNumber(VtotalOut);

var VnetFlow = eval(Vincome_totMoAmt) - eval(VtotalOut);
form.netFlow.value = formatNumber(VnetFlow);

}
