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 mSales;var mCOGS;var mAdmExp;var mDep;var	mEBIT;var mInt;var mTaxInc;var mTaxes;var mNI;var mDiv;var mAddRE;var	mNumShares;var mPrice;var mCurrentRatio;var mQuickRatio;var mRecTurn;var mDSO;var mInvTurn;var	mDaysInv;var	mFATurn;var mTATurn;var mTIE;var mDebtRatio;var mDebtEquity;var mEquityMult;var mProfitMargin;var mROA;var mROE;var mPayout;var mRetention;var mEPS;var mBookValue;var mPE;var mMarketBook;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);    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);    mPrice = parseFloat(form.Price.value);  mNumShares = parseFloat(form.NumShares.value);} function getAll() {	mCurrentRatio = calcCurrentRatio();	mQuickRatio = calcQuickRatio();	mRecTurn = calcRecTurn();	mDSO = calcDSO();	mInvTurn = calcInvTurn();	mDaysInv = calcDaysInv();	mFATurn = calcFATurn();	mTATurn = calcTATurn();	mTIE = calcTIE();	mDebtRatio = calcDebtRatio();	mDebtEquity = calcDebtEquity();	mEquityMult = calcEquityMult();	mProfitMargin = calcProfitMargin();	mROA = calcROA();	mROE = calcROE();	mPayout = calcPayout();	mRetention = calcRetention();	mEPS = calcEPS();	mBookValue = calcBookValue()	mPE = calcPE();	mMarketBook = calcMarketBook();		var theOut = "<HTML><HEAD><TITLE>All Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>All Ratios</h2>";	theOut += "<table>";	theOut += "<tr><td>Current Ratio</td><td>" + mCurrentRatio + "</td></tr>";	theOut += "<tr><td>Quick Ratio</td><td>" + mQuickRatio + "</td></tr>";	theOut += "<tr><td>Receivables Turnover</td><td>" + mRecTurn + "</td></tr>";	theOut += "<tr><td>Days' Receivables</td><td>" + mDSO + "</td></tr>";	theOut += "<tr><td>Inventory Turnover</td><td>" + mInvTurn + "</td></tr>";	theOut += "<tr><td>Days' Inventory</td><td>" + mDaysInv + "</td></tr>";	theOut += "<tr><td>Fixed Assets Turnover</td><td>" + mFATurn + "</td></tr>";	theOut += "<tr><td>Total Assets Turnover</td><td>" + mTATurn + "</td></tr>";	theOut += "<tr><td>Times Interest Earned (TIE)</td><td>" + mTIE + "</td></tr>";	theOut += "<tr><td>Debt Ratio</td><td>" + mDebtRatio + "</td></tr>";	theOut += "<tr><td>Debt to Equity Ratio</td><td>" + mDebtEquity + "</td></tr>";	theOut += "<tr><td>Equity Multiplier</td><td>" + mEquityMult + "</td></tr>";	theOut += "<tr><td>Profit Margin</td><td>" + mProfitMargin + "</td></tr>";	theOut += "<tr><td>Return on Assets (ROA)</td><td>" + mROA + "</td></tr>";	theOut += "<tr><td>Return on Equity (ROE)</td><td>" + mROE + "</td></tr>";	theOut += "<tr><td>Payout Ratio</td><td>" + mPayout + "</td></tr>";	theOut += "<tr><td>Retention Ratio</td><td>" + mRetention + "</td></tr>";	theOut += "<tr><td>Earnings Per Share (EPS)</td><td>" + mEPS + "</td></tr>";	theOut += "<tr><td>Book Value Per Share</td><td>" + mBookValue + "</td></tr>";	theOut += "<tr><td>Price/Earnings Ratio</td><td>" + mPE + "</td></tr>";	theOut += "<tr><td>Market-to-Book Ratio</td><td>" + mMarketBook + "</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=480,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 calcCurrentRatio() {	if (mTCL == 0) {		return "N/A";	}	var theVal = Math.round((mTCA/mTCL)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal;	}function getCurrentRatio() {	var theOut = "<HTML><HEAD><TITLE>Current Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Current Ratio</h2>";	mCurrentRatio = calcCurrentRatio();	if (mCurrentRatio == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mCurrentRatio != "N/A") {		theOut += "<p>The Current Ratio is " + mCurrentRatio + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/CurrentRatio.gif\" WIDTH=\"246\" HEIGHT=\"35\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Total Current Assets = $" + mTCA + "<br>";		theOut += "Total Current Liabilities = $" + mTCL + "</p>";	} else {		theOut += "<p>The Current Ratio cannot be computed because Total Current Liabilities equals 0.</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=400,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 calcQuickRatio() {	if (mTCL == 0) {		return "N/A";	}	var theVal = Math.round(((mTCA-mInv)/mTCL)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal;}function getQuickRatio() {	var theOut = "<HTML><HEAD><TITLE>Quick Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Quick Ratio</h2>";	mQuickRatio = calcQuickRatio();	if (mQuickRatio == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mQuickRatio != "N/A") {		theOut += "<p>The Quick Ratio is " + mQuickRatio + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/QuickRatio.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Total Current Assets = $" + mTCA + "<br>";		theOut += "Inventory = $" + mInv + "<br>";		theOut += "Total Current Liabilities = $" + mTCL + "</p>";	} else {		theOut += "<p>The Quick Ratio cannot be computed because Total Current Liabilities equals 0.</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=400,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();}// Turnover Ratiosfunction calcRecTurn() {	if (mAccRec == 0) {		return "N/A";	}	var theVal = Math.round((mSales/mAccRec)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " times";}function calcDSO() {	if (mAccRec == 0) {		return "N/A";	}	var theVal = Math.round((mSales/mAccRec)*100)/100;	if (theVal == 0) {		return "N/A";	}	theVal = Math.round((365/theVal)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " days";}function getRecTurn() {	var theOut = "<HTML><HEAD><TITLE>Receivables Turnover and Days' Receivables</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Receivables Turnover</h2>";	mRecTurn = calcRecTurn();	mDSO = calcDSO();	if ((mRecTurn == "Error")  || (mDSO == "Error")) {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mRecTurn != "N/A") {			theOut += "<p>The Receivables Turnover is " + mRecTurn + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/ReceivablesTurnover.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Sales = $" + mSales + "<br>";		theOut += "Accounts Receivables = $" + mAccRec + "</p>";	} else {		theOut += "<p>The Receivables Turnover is not meaningful.</p>";	}		theOut += "<h2>Days' Receivables</h2>";	if (mDSO != "N/A") {		theOut += "<p>The Days' Receivables is " + mDSO + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/DaysReceivables.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Receivables Turnover = " + mRecTurn + " (from above).</p>";	} else {		theOut += "<p>The Days' Receivables is not meaningful.</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=400,height=400,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 calcInvTurn() {	if (mInv == 0) {		return "N/A";	}	var theVal = Math.round((mCOGS/mInv)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " times";}function calcDaysInv() {	if (mInv == 0) {		return "N/A";	}	var theVal = Math.round((mCOGS/mInv)*100)/100;	if (theVal == 0) {		return "N/A";	}	theVal = Math.round((365/theVal)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " days";}function getInvTurn() {	var theOut = "<HTML><HEAD><TITLE>Inventory Turnover and Days' Inventory</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Inventory Turnover</h2>";	mInvTurn = calcInvTurn();	mDaysInv = calcDaysInv();	if ((mInvTurn == "Error")  || (mDaysInv == "Error")) {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}		if (mInvTurn != "N/A") {		theOut += "<p>The Inventory Turnover is " + mInvTurn + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/InventoryTurnover.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>COGS = $" + mCOGS + "<br>";		theOut += "Inventory = $" + mInv + "</p>";	} else {		theOut += "<p>The Inventory Turnover is not meaningful.</p>";	}		theOut += "<h2>Days' Inventory</h2>";	if (mDaysInv != "N/A") {				theOut += "<p>The Days' Inventory is " + mDaysInv + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/DaysInventory.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Inventory Turnover = " + mInvTurn + " (from above).</p>";	} else {		theOut += "<p>The Days' Inventory is not meaningful.</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=400,height=400,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 calcFATurn() {	if (mNFA == 0) {		return "N/A";	}	var theVal = Math.round((mSales/mNFA)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " times";}function getFATurn() {	var theOut = "<HTML><HEAD><TITLE>Fixed Assets Turnover</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Fixed Assets Turnover</h2>";	mFATurn = calcFATurn();	if (mFATurn == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mFATurn != "N/A") {		theOut += "<p>The Fixed Assets Turnover is " + mFATurn + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/FATurnover.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Sales = $" + mSales + "<br>";		theOut += "Net Fixed Assets = $" + mNFA + "</p>";	} else {		theOut += "<p>The Fixed Assets Turnover ratio is not meaningful.</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=400,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 calcTATurn() {	if (mTA == 0) {		return "Error";	}	var theVal = Math.round((mSales/mTA)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " times";}function getTATurn() {	var theOut = "<HTML><HEAD><TITLE>Total Assets Turnover</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Total Assets Turnover</h2>";	mTATurn = calcTATurn();	if (mTATurn == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	theOut += "<p>The Total Assets Turnover is " + mTATurn + ".</p>";	theOut += "<h3>Explantion:</h3>";	theOut += "<p><IMG SRC=\"Equations/TATurnover.gif\" BORDER=\"0\"></p>";	theOut += "<p>where:<br>Sales = $" + mSales + "<br>";	theOut += "Total Assets = $" + mTA + "</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=400,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();}// Debt Management Ratiosfunction calcTIE() {	if (mInt == 0) {		return "N/A";	}	var theVal = Math.round((mEBIT/mInt)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + " times";}function getTIE() {	var theOut = "<HTML><HEAD><TITLE>Times Interest Earned</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Times Interest Earned</h2>";	mTIE = calcTIE();	if (mTIE == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mTIE != "N/A") {		theOut += "<p>The Times Interest Earned is " + mTIE + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/TIE.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>EBIT = $" + mEBIT + "<br>";		theOut += "Interest Expense = $" + mInt + "</p>";	} else {		theOut += "<p>The Times Interest Earned ratio is not meaningful.</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=400,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 calcDebtRatio() {	if (mTA == 0) {		return "Error";	}	var theVal = Math.round(((mTA - mTSE)/mTA)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getDebtRatio() {	var theOut = "<HTML><HEAD><TITLE>Debt Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Debt Ratio</h2>";	mDebtRatio = calcDebtRatio();	if (mDebtRatio == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	theOut += "<p>The Debt Ratio is " + mDebtRatio + ".</p>";	theOut += "<h3>Explantion:</h3>";	theOut += "<p><IMG SRC=\"Equations/DebtRatio.gif\" BORDER=\"0\"></p>";	theOut += "<p>where:<br>Total Assets = $" + mTA + "<br>";	theOut += "Total Owners' Equity = $" + mTSE + "</p>";	theOut += "<p>Note: Total Debt is computed by subtracting Total Owners' Equity from Total Assets.</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=400,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 calcDebtEquity() {	if (mTSE == 0) {		return "N/A";	}	var theVal = Math.round(((mTA - mTSE)/mTSE)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getDebtEquity() {	var theOut = "<HTML><HEAD><TITLE>Debt to Equity Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Debt to Equity Ratio</h2>";	mDebtEquity = calcDebtEquity();	if (mDebtEquity == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mDebtEquity != "N/A") {		theOut += "<p>The Debt to Equity Ratio is " + mDebtEquity + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/DebtEquity.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Total Assets = $" + mTA + "<br>";		theOut += "Total Owners' Equity = $" + mTSE + "</p>";		theOut += "<p>Note: Total Debt is computed by subtracting Total Owners' Equity from Total Assets.</p>";	} else {		theOut += "<p>The Debt to Equity ratio is not meaningful.</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=400,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 calcEquityMult() {	if (mTSE == 0) {		return "N/A";	}	var theVal = Math.round((mTA/mTSE)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "";}function getEquityMult() {	var theOut = "<HTML><HEAD><TITLE>Equity Multiplier</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Equity Multiplier</h2>";	mEquityMult = calcEquityMult();	if (mEquityMult == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mEquityMult != "N/A") {		theOut += "<p>The Equity Multiplier is " + mEquityMult + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/EquityMult.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Total Assets = $" + mTA + "<br>";		theOut += "Total Owners' Equity = $" + mTSE + "</p>";	} else {		theOut += "<p>The Equity Multiplier is not meaningful.</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=400,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();}// Profitabiity Ratiosfunction calcProfitMargin() {	if (mSales == 0) {		return "N/A";	}	var theVal = Math.round((mNI/mSales)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getProfitMargin() {	var theOut = "<HTML><HEAD><TITLE>Profit Margin</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Profit Margin</h2>";	mProfitMargin = calcProfitMargin();	if (mProfitMargin == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mProfitMargin != "N/A") {		theOut += "<p>The Profit Margin is " + mProfitMargin + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/ProfitMargin.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";		theOut += "Sales = $" + mSales + "</p>";	} else {		theOut += "<p>The Profit Margin is not meaningful.</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=400,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 calcROA() {	if (mTA == 0) {		return "Error";	}	var theVal = Math.round((mNI/mTA)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getROA() {	var theOut = "<HTML><HEAD><TITLE>Return on Assets (ROA)</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Return on Assets (ROA)</h2>";	mROA = calcROA();	if (mROA == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	theOut += "<p>The ROA is " + mROA + ".</p>";	theOut += "<h3>Explantion:</h3>";	theOut += "<p><IMG SRC=\"Equations/ROA.gif\" BORDER=\"0\"></p>";	theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";	theOut += "Total Assets = $" + mTA + "</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=400,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 calcROE() {	if (mTSE == 0) {		return "N/A";	}	var theVal = Math.round((mNI/mTSE)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getROE() {	var theOut = "<HTML><HEAD><TITLE>Return on Equity (ROE)</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Return on Equity (ROE)</h2>";	mROE = calcROE();	if (mROE == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mROE != "N/A") {		theOut += "<p>The ROE is " + mROE + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/ROE.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";		theOut += "Total Owners' Equity = $" + mTSE + "</p>";	} else {		theOut += "<p>The Return on Equity is not meaningful.</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=400,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 calcPayout() {	if (mNI == 0) {		return "N/A";	}	var theVal = Math.round((mDiv/mNI)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function calcRetention() {	if (mNI == 0) {		return "N/A";	}	var theVal = Math.round((mAddRE/mNI)*10000)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal + "\%";}function getPayout() {	var theOut = "<HTML><HEAD><TITLE>Payout and Retention Ratios</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Payout Ratio</h2>";	mPayout = calcPayout();	mRetention = calcRetention();	if ((mPayout == "Error")  || (mRetention == "Error")) {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mPayout != "N/A") {		theOut += "<p>The Payout Ratio is " + mPayout + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/Payout.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";		theOut += "Dividends = $" + mDiv + "</p>";	} else {		theOut += "<p>The Payout Ratio is not meaningful.</p>";	}		theOut += "<h2>Retention Ratio</h2>";	if (mRetention != "N/A") {		theOut += "<p>The Retention Ratio is " + mRetention + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/Retention.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";		theOut += "Addition to RE = $" + mAddRE + "</p>";		theOut += "<p>Note: The sum of the Payout Ratio and the Retention Ratio is 100\%.<\p>";	} else {		theOut += "<p>The Retention Ratio is not meaningful.</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=400,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();}// Market Value Ratiosfunction calcEPS() {	if (mNumShares == 0) {		return "N/A";	}	var theVal = Math.round((mNI/mNumShares)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "$" + theVal;}function calcBookValue() {	if (mNumShares == 0) {		return "N/A";	}	var theVal = Math.round((mTSE/mNumShares)*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "$" + theVal;}function getEPS() {	var theOut = "<HTML><HEAD><TITLE>EPS and Book Value Per Share</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Earnings Per Share</h2>";	mEPS = calcEPS();	mBookValue = calcBookValue();	if ((mEPS == "Error")  || (mBookValue == "Error")) {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mEPS != "N/A") {		theOut += "<p>The Earnings Per Share (EPS) is " + mEPS + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/EPS.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Net Income = $" + mNI + "<br>";		theOut += "Number of Shares Outstanding = " + mNumShares + "</p>";	} else {		theOut += "<p>The Earnings Per Share is not meaningful.</p>";	}		theOut += "<h2>Book Value Per Share</h2>";	if (mBookValue != "N/A") {		theOut += "<p>The Book Value Per Share is " + mBookValue + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/BookValue.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Total Owners' Equity = $" + mTSE + "<br>";		theOut += "Number of Shares Outstanding = " + mNumShares + "</p>";	} else {		theOut += "<p>The Book Value Per Share is not meaningful.</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=400,height=450,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 calcPE() {	if ((mNumShares == 0) || (mNI <= 0)) {		return "N/A";	}	var theVal = Math.round((mPrice/(mNI/mNumShares))*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal;}function getPE() {	var theOut = "<HTML><HEAD><TITLE>Price/Earnings Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Price/Earnings Ratio (P/E)</h2>";	mPE = calcPE();	if (mPE == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mPE != "N/A") {		theOut += "<p>The Price/Earnings Ratio (P/E) is " + mPE + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/PE.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Price Per Share = $" + mPrice + "<br>";		theOut += "Earnings Per Share (EPS) = $" + Math.round((mNI/mNumShares)*100)/100 + "</p>";		theOut += "<p>Note: See the EPS/Book Value Per Share calculation for additional information.<\p>";	} else {		theOut += "<p>The Price/Earnings Ratio is not meaningful.</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=400,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 calcMarketBook() {	if ((mNumShares == 0) || (mTSE == 0)) {		return "N/A";	}	var theVal = Math.round((mPrice/(mTSE/mNumShares))*100)/100;	if (isNaN(theVal)) {		return "Error";	}	return "" + theVal;}function getMarketBook() {	var theOut = "<HTML><HEAD><TITLE>Market-to-Book Ratio</TITLE></HEAD><BODY bgcolor=\"white\">";	theOut += "<h2>Market-to-Book Ratio</h2>";	mMarketBook = calcMarketBook();	if (mMarketBook == "Error") {		alert("An error occured in a calculation. There is likely a problem in the Financial Statement data.");		return;	}	if (mMarketBook != "N/A") {		theOut += "<p>The Market-to-Book Ratio is " + mMarketBook + ".</p>";		theOut += "<h3>Explantion:</h3>";		theOut += "<p><IMG SRC=\"Equations/MarketBook.gif\" BORDER=\"0\"></p>";		theOut += "<p>where:<br>Price Per Share = $" + mPrice + "<br>";		theOut += "Book Value Per Share = $" + Math.round((mTSE/mNumShares)*100)/100 + "</p>";		theOut += "<p>Note: See the EPS/Book Value Per Share calculation for additional information.<\p>";	} else {		theOut += "<p>The Market-to-Book Ratio is not meaningful.</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=400,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 newFinancials(form) {  mCash = Math.round(Math.random()*6 + 1)*100;  mAccRec = Math.round(Math.random()*6 + 1)*100;  mInv = Math.round(Math.random()*10 + 1)*100;  mTCA = mCash + mAccRec + mInv;  mPPE = Math.round(Math.random()*22 + 4)*100;  mAccDep = Math.round(Math.random()*((mPPE/100) - 2) + 1)*100;  mNFA = mPPE - mAccDep;  mTA = mTCA + mNFA;  mAccPay = Math.round(Math.random()*6 + 1)*100;   mNotes = Math.round(Math.random()*6 + 1)*100;  mTCL = mAccPay + mNotes;  mLTDebt = Math.round(Math.random()*12 + 1)*100;  mTLTD = mLTDebt;  mCS = Math.round(Math.random()*6 + 1)*100;  mCapSurp = Math.round(Math.random()*6 + 1)*100;  mRE = mTA - mTCL - mTLTD - mCS - mCapSurp;  while (mRE < 100) {  	mPPE += 100;  	mNFA = mPPE - mAccDep;  	mTA = mTCA + mNFA;  	mRE = mTA - mTCL - mTLTD - mCS - mCapSurp;  }  mTSE = mCS + mCapSurp + mRE;  mTL = mTA;    mSales = Math.round(Math.random()*(mTA/100)*2 + 6)*100;  mCOGS = Math.round(Math.random()*(mSales/100)*.7 + 4)*100;  mAdmExp = Math.round(Math.random()*(mSales/100)*.2 + 1)*100;  mDep = Math.round(Math.random()*(mNFA/100)*.5*100 + 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;    mNumShares = mCS;  mBookValue = Math.round((mTSE/mNumShares)*100)/100;  mPrice = Math.round((mBookValue - 2 + Math.random()*12)*100)/100;    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.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;    form.Price.value = "" + mPrice;  form.NumShares.value = "" + mNumShares;}
