var mCash;var mAccRec;var mInv;var mTCA;var mPPE;var mAccDep;var mNFA;var mTA;var mAccPay;var mNotes;var mTCL;var mLTDebt;var mTLTD;var mCS;var mCapSurp;var mRE;var mTSE;var mTL;var mCash1;var mAccRec1;var mInv1;var mTCA1;var mPPE1;var mAccDep1;var mNFA1;var mTA1;var mAccPay1;var mNotes1;var mTCL1;var mLTDebt1;var mTLTD1;var mCS1;var mCapSurp1;var mRE1;var mTSE1;var mTL1;var mSales;var mCOGS;var mAdmExp;var mDep;var	mEBIT;var mInt;var mTaxInc;var mTaxes;var mNI;var mDiv;var mAddRE;var mOCF;var mCapSpending;var mANWC;var mCFA;var mCFDebt;var	mCFStock;var	mCFDS;function gatherValues(form) {  mCash = parseFloat(form.Cash.value);  mAccRec = parseFloat(form.AccRec.value);  mInv = parseFloat(form.Inv.value);  mTCA = parseFloat(form.TCA.value);  mPPE = parseFloat(form.PPE.value);  mAccDep = parseFloat(form.AccDep.value);  mNFA = parseFloat(form.NFA.value);  mTA = parseFloat(form.TA.value);  mAccPay = parseFloat(form.AccPay.value);  mNotes = parseFloat(form.Notes.value);  mTCL = parseFloat(form.TCL.value);  mLTDebt = parseFloat(form.LTDebt.value);  mTLTD = parseFloat(form.TLTD.value);  mCS = parseFloat(form.CS.value);  mCapSurp = parseFloat(form.CapSurp.value);  mRE = parseFloat(form.RE.value);  mTSE = parseFloat(form.TSE.value);  mTL = parseFloat(form.TL.value);    mCash1 = parseFloat(form.Cash1.value);  mAccRec1 = parseFloat(form.AccRec1.value);  mInv1 = parseFloat(form.Inv1.value);  mTCA1 = parseFloat(form.TCA1.value);  mPPE1 = parseFloat(form.PPE1.value);  mAccDep1 = parseFloat(form.AccDep1.value);  mNFA1 = parseFloat(form.NFA1.value);  mTA1 = parseFloat(form.TA1.value);  mAccPay1 = parseFloat(form.AccPay1.value);  mNotes1 = parseFloat(form.Notes1.value);  mTCL1 = parseFloat(form.TCL1.value);  mLTDebt1 = parseFloat(form.LTDebt1.value);  mTLTD1 = parseFloat(form.TLTD1.value);  mCS1 = parseFloat(form.CS1.value);  mCapSurp1 = parseFloat(form.CapSurp1.value);  mRE1 = parseFloat(form.RE1.value);  mTSE1 = parseFloat(form.TSE1.value);  mTL1 = parseFloat(form.TL1.value);    mSales = parseFloat(form.Sales.value);  mCOGS = parseFloat(form.COGS.value);  mAdmExp = parseFloat(form.AdmExp.value);  mDep = parseFloat(form.Dep.value);  mEBIT = parseFloat(form.EBIT.value);  mInt = parseFloat(form.Int.value);  mTaxInc = parseFloat(form.TaxInc.value);  mTaxes = parseFloat(form.Taxes.value);  mNI = parseFloat(form.NI.value);  mDiv = parseFloat(form.Div.value);  mAddRE = parseFloat(form.AddRE.value);  } function getAll() {	var theOut = "<HTML><HEAD><TITLE>All Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>All Financial Cash Flows</h2>";	theOut += "<table>";	theOut += "<tr><td>Operating Cash Flow</td><td>$" + calcOCF() + "</td></tr>";	theOut += "<tr><td>Capital Spending</td><td>$" + calcCapSpending() + "</td></tr>";	theOut += "<tr><td>Additions to Net Working capital</td><td>$" + calcANWC() + "</td></tr>";	theOut += "<tr><td>&nbsp;&nbsp;<B>Cash Flow from Assets</B></td><td>$" + calcCFA() + "</td></tr>";	theOut += "<tr><td>Cash Flow to Debtholders</td><td>$" + calcCFDebt() + "</td></tr>";	theOut += "<tr><td>Cash Flow to Stockholders</td><td>$" + calcCFStock() + "</td></tr>";	theOut += "<tr><td>&nbsp;&nbsp;<B>Cash Flow to Investors</B></td><td>$" + calcCFDS() + "</td></tr>";	theOut += "</table>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin2","width=400,height=400,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin2","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcOCF() {	theVal = mEBIT + mDep - mTaxes;	return theVal;	}function getOCF() {	var theOut = "<HTML><HEAD><TITLE>Operating Cash Flow</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Operating Cash Flow</h2>";	mOCF = calcOCF();		theOut += "<p>Operating Cash Flow equals $" + mOCF + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Operating Cash Flow = EBIT + Depreciation - Taxes</p>";		theOut += "<p>Where:</br>";		theOut += "Earnings Before Interest and Taxes (EBIT) = $" + mEBIT + ",<br>";		theOut += "Depreciation = $" + mDep + ", and<br>";		theOut += "Taxes = $" + mTaxes + ".</p>";		theOut += "<p>Thus, Operating Cash Flow = $" + mEBIT + " + $" + mDep + " - $" + mTaxes + " = $" + mOCF +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcCapSpending() {	theVal = mNFA1 - mNFA + mDep;	return theVal;	}function getCapSpending() {	var theOut = "<HTML><HEAD><TITLE>Capital Spending</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Capital Spending</h2>";	mCapSpending = calcCapSpending();		theOut += "<p>Capital Spending equals $" + mCapSpending + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Capital Spending = Ending Net Fixed Assets - Beginning Net Fixed Assets + Depreciation</p>";		theOut += "<p>Where:</br>";		theOut += "Ending Net Fixed Assets = Net Fixed Assets (1998) = $" + mNFA1 + ",<br>";		theOut += "Beginning Net Fixed Assets = Net Fixed Assets (1997) = $" + mNFA + ", and<br>";		theOut += "Depreciation = $" + mDep + ".</p>";		theOut += "<p>Thus, Capital Spending = $" + mNFA1 + " - $" + mNFA + " + $" + mDep + " = $" + mCapSpending +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcANWC() {	var theENWC = mTCA1 - mTCL1;	var theBNWC = mTCA - mTCL;	theVal = theENWC - theBNWC;	return theVal;	}function getANWC() {	var theOut = "<HTML><HEAD><TITLE>Addition to Net Working Capital</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Addition to Net Working Capital</h2>";	mANWC = calcANWC();		theOut += "<p>Addition to Net Working Capital equals $" + mANWC + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Addition to Net Working Capital = Ending Net Working Capital - Beginning Net Working Capital</p>";		theOut += "<p>Where:</br>";		theOut += "Ending Net Working Capital = Total Current Assets (1998) - Total Current Liabilities (1998),<br>";		theOut += "Beginning Net Working Capital = Total Current Assets (1997) - Total Current Liabilities (1997),<br>";		theOut += "Total Current Assets (1998) = $" + mTCA1 + ",<br>";		theOut += "Total Current Liabilities (1998) = $" + mTCL1 + ",<br>";		theOut += "Total Current Assets (1997) = $" + mTCA + ", and<br>";		theOut += "Total Current Liabilities (1997) = $" + mTCL + ".</p>";		theOut += "<p>Thus,<br>";		var theENWC = mTCA1 - mTCL1;		var theBNWC = mTCA - mTCL;		theOut += "Ending Net Working Capital = $" + theENWC + "<br>";		theOut += "Beginning Net Working Capital = $" + theBNWC + "<br>";		theOut += "Addition to Net Working Capital = $" + theENWC + " - $" + theBNWC + " = $" + mANWC +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcCFA() {	var theOCF = calcOCF();	var theCapSpending = calcCapSpending();	var theANWC = calcANWC();	var theVal = theOCF - theCapSpending - theANWC;	return theVal;	}function getCFA() {	var theOut = "<HTML><HEAD><TITLE>Cash Flow from Assets</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Cash Flow from Assets</h2>";	mCFA = calcCFA();		theOut += "<p>Cash Flow from Assets equals $" + mCFA + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Cash Flow from Assets = Operating Cash Flow - Capital Spending - Addition to Net Working Capital</p>";		theOut += "<p>Where:</br>";		theOut += "Operating Cash Flow = $" + calcOCF() + ",<br>";		theOut += "Capital Spending = $" + calcCapSpending() + ", and<br>";		theOut += "Additions to Net Working Capital = $" + calcANWC() + ".</p>";		theOut += "<p>Thus,<br>";		theOut += "Cash Flow from Assets = $" + calcOCF() + " - $" + calcCapSpending() + " - $" + calcANWC() + " = $" + mCFA +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcCFDebt() {	theVal = mInt - mLTDebt1 + mLTDebt;	return theVal;	}function getCFDebt() {	var theOut = "<HTML><HEAD><TITLE>Cash Flow to Debtholders</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Cash Flow to Debtholders</h2>";	mCFDebt = calcCFDebt();		theOut += "<p>Cash Flow to Debtholders equals $" + mCFDebt + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Cash Flow to Debtholders = Interest Expense - Ending Long-Term Debt + Beginning Long-Term Debt</p>";		theOut += "<p>Where:</br>";		theOut += "Interest Expense = $" + mInt + ",<br>";		theOut += "Ending Long-Term Debt = Long-Term Debt (1998) = $" + mLTDebt1 + ", and<br>";		theOut += "Beginning Long-Term Debt = Long-Term Debt (1997) = $" + mLTDebt + ".</p>";		theOut += "<p>Thus, Cash Flow to Debtholders = $" + mInt + " - $" + mLTDebt1 + " + $" + mLTDebt + " = $" + mCFDebt +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcCFStock() {	theVal = mDiv - mCS1 - mCapSurp1 + mCS + mCapSurp;	return theVal;	}function getCFStock() {	var theOut = "<HTML><HEAD><TITLE>Cash Flow to Stockholders</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Cash Flow to Stockholders</h2>";	mCFStock = calcCFStock();		theOut += "<p>Cash Flow to Stockholders equals $" + mCFStock + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Cash Flow to Stockholders = Dividends - (Ending Common Stock + Ending Capital Surplus) + (Beginning Common Stock + Beginning Capital Surplus)</p>";		theOut += "<p>Where:</br>";		theOut += "Dividends = $" + mDiv + ",<br>";		theOut += "Ending Common Stock = Common Stock (1998) = $" + mCS1 + ",<br>";		theOut += "Ending Capital Surplus = Capital Surplus (1998) = $" + mCapSurp1 + ",<br>";		theOut += "Beginning Common Stock = Common Stock (1997) = $" + mCS + ", and</p>";		theOut += "Beginning Capital Surplus = Capital Surplus (1997) = $" + mCapSurp + ".<br>";		theOut += "<p>Thus, Cash Flow to Stockholders = $" + mDiv + " - ($" + mCS1 + " + $" + mCapSurp1 + ") + ($" + mCS + " + $" + mCapSurp + ") = $" + mCFStock +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function calcCFDS() {	var theCFDebt = calcCFDebt();	var theCFStock = calcCFStock();	var theVal = theCFDebt + theCFStock;	return theVal;	}function getCFDS() {	var theOut = "<HTML><HEAD><TITLE>Cash Flow to Investors</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Cash Flow to Investors</h2>";	mCFDS = calcCFDS();		theOut += "<p>Cash Flow to Investors equals $" + mCFDS + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p>Cash Flow to Investors = Cash Flow to Debtholders + Cash Flow to Stockholders</p>";		theOut += "<p>Where:</br>";		theOut += "Cash Flow to Debtholders = $" + calcCFDebt() + ", and<br>";		theOut += "Cash Flow to Stockholders = $" + calcCFStock() + ",</p>";		theOut += "<p>Thus,<br>";		theOut += "Cash Flow to Investors = $" + calcCFDebt() + " + $" + calcCFStock() + " = $" + mCFDS +"</p>";	theOut += "<p><form><input type=\"button\" name=\"Close\" value=\"Close\" onClick=\"window.close()\"></form></p>";	theOut += "</BODY></HTML>";	var theWin = window.open("","answerwin","width=500,height=350,scrollbars=yes,resizable=yes");	theWin.document.write(theOut);	theWin.document.close();	//var theWin = window.open("javascript:'" + theOut + "'","answerwin","width=400,height=350,scrollbars=yes,resizable=yes");	theWin.focus();}function getIncomeStatement(inPPE, inNFA) {  mSales = Math.round(Math.random()*((inPPE)/100)*(.5) + (inPPE/100))*100;  mDep = Math.round(Math.random()*(inNFA/100)*.20*100);  if (mDep < 50) {  	mDep = 50;  }  mCOGS = Math.round(Math.random()*(mSales/100)*.35 + (mSales/100)*(.5))*100;  mAdmExp = Math.round(Math.random()*(mSales/100)*.1 + .5)*100;  mEBIT = mSales - mCOGS - mAdmExp - mDep;  mInt = Math.round(((Math.random()*(20)+1)/100)*mLTDebt/10)*10;  mTaxInc = mEBIT - mInt;  mTaxes = Math.round(((Math.random()*(40)+5)/100)*mTaxInc);  mNI = mTaxInc - mTaxes;  if (mNI > 0) {  	mDiv = Math.round(((Math.random()*800)/1000)*mNI);  } else {  	mDiv = 0;  }  mAddRE = mNI - mDiv;}function newFinancials(form) {  var theG = Math.round(Math.random()*4*100)/1000 + 1;  mCash = Math.round(Math.random()*6 + 1)*100;  mCash1 = Math.round(.85*(mCash/10)*theG + Math.random()*(.2*(mCash/10)))*10;  mAccRec = Math.round(Math.random()*6 + 1)*100;  mAccRec1 = Math.round(.85*(mAccRec/10)*theG + Math.random()*(.2*(mAccRec/10)))*10;  mInv = Math.round(Math.random()*10 + 1)*100;  mInv1 = Math.round(.85*(mInv/10)*theG + Math.random()*(.2*(mInv/10)))*10;  mTCA = mCash + mAccRec + mInv;  mTCA1 = mCash1 + mAccRec1 + mInv1;  mPPE = Math.round(Math.random()*22 + 4)*100;  mPPE1 = Math.round(.85*(mPPE/10)*theG + Math.random()*(.2*(mPPE/10)))*10;  mAccDep = Math.round(Math.random()*((mPPE/10)*.3) + 1)*10;  mNFA = mPPE - mAccDep;  mTA = mTCA + mNFA;    mLTDebt = Math.round(Math.random()*.4*(mTA/10) + .15*(mTA/10))*10;  mTLTD = mLTDebt;    getIncomeStatement(mPPE,mNFA);    mTA = mTCA + mNFA;  mTL = mTA;    mTCL = Math.round(Math.random()*.5*((mTA-mTLTD)/10) + .25*((mTA-mTLTD)/10))*10;  mAccPay = Math.round((Math.random()*.6 + .2)*(mTCL/10))*10;  mNotes = mTCL - mAccPay;  mAccPay1 = Math.round(.85*(mAccPay/10)*theG + Math.random()*(.2*(mAccPay/10)))*10;  mNotes1 = Math.round(.85*(mNotes/10)*theG + Math.random()*(.2*(mNotes/10)))*10;  mTCL1 = mAccPay1 + mNotes1;    mTSE = mTA - mTLTD - mTCL;   mCS = Math.round((Math.random()*.2 + .20)*(mTSE/10))*10;  mCapSurp = Math.round((Math.random()*.3 + .20)*(mTSE/10))*10;  mRE = mTSE - mCS - mCapSurp;  mCS1 = mCS + Math.round(Math.random()*(.2*(mCS/10)))*10;  mCapSurp1 = mCapSurp + Math.round(Math.random()*(.2*(mCapSurp/10)))*10;    mAccDep1 = mAccDep + mDep;  mNFA1 = mPPE1 - mAccDep1;  mTA1 = mTCA1 + mNFA1;  mRE1 = mRE + mAddRE;  mTSE1 = mCS1 + mCapSurp1 + mRE1;  mTL1 = mTA1;  mLTDebt1 = mTA1 - mTSE1 - mTCL1;  mTLTD1 = mLTDebt1;    while((mTSE1 <= 0) || (mLTDebt1 < 0)) {  	getIncomeStatement(mPPE, mNFA);	mAccDep1 = mAccDep + mDep;	mNFA1 = mPPE1 - mAccDep1;	mTA1 = mTCA1 + mNFA1;	mRE1 = mRE + mAddRE;	mTSE1 = mCS1 + mCapSurp1 + mRE1;	mTL1 = mTA1;    mLTDebt1 = mTA1 - mTSE1 - mTCL1;	mTLTD1 = mLTDebt1;	  }    form.Cash.value = "" + mCash;  form.AccRec.value = "" + mAccRec;  form.Inv.value = "" + mInv;  form.TCA.value = "" + mTCA;  form.PPE.value = "" + mPPE;  form.AccDep.value = "" + mAccDep;  form.NFA.value = "" + mNFA;  form.TA.value = "" + mTA;  form.AccPay.value = "" + mAccPay;  form.Notes.value = "" + mNotes;  form.TCL.value = "" + mTCL;  form.LTDebt.value = "" + mLTDebt;  form.TLTD.value = "" + mTLTD;  form.CS.value = "" + mCS;  form.CapSurp.value = "" + mCapSurp;  form.RE.value = "" + mRE;  form.TSE.value = "" + mTSE;  form.TL.value = "" + mTL;    form.Cash1.value = "" + mCash1;  form.AccRec1.value = "" + mAccRec1;  form.Inv1.value = "" + mInv1;  form.TCA1.value = "" + mTCA1;  form.PPE1.value = "" + mPPE1;  form.AccDep1.value = "" + mAccDep1;  form.NFA1.value = "" + mNFA1;  form.TA1.value = "" + mTA1;  form.AccPay1.value = "" + mAccPay1;  form.Notes1.value = "" + mNotes1;  form.TCL1.value = "" + mTCL1;  form.LTDebt1.value = "" + mLTDebt1;  form.TLTD1.value = "" + mTLTD1;  form.CS1.value = "" + mCS1;  form.CapSurp1.value = "" + mCapSurp1;  form.RE1.value = "" + mRE1;  form.TSE1.value = "" + mTSE1;  form.TL1.value = "" + mTL1;    form.Sales.value = "" + mSales;  form.COGS.value = "" + mCOGS;  form.AdmExp.value = "" + mAdmExp;  form.Dep.value = "" + mDep;  form.EBIT.value = "" + mEBIT;  form.Int.value = "" + mInt;  form.TaxInc.value = "" + mTaxInc;  form.Taxes.value = "" + mTaxes;  form.NI.value = "" + mNI;  form.Div.value = "" + mDiv;  form.AddRE.value = "" + mAddRE; }
