if (Calculators == undefined) {
	var Calculators = {};
}
if (Calculators.report == undefined) {
	Calculators.report = {};
}
Calculators.report.CollegeSavingsReport = function CollegeSavingsReport(plan){
	this.plan = plan;
	
	this.getBody = function() {
		var years = this.plan.getMaxYears();
		var goalPayment = this.plan.getMonthlyContributionsRequired();
		var header = "During the next " + years + " years you will need to save about " + this.plan.getTotalCosts() +
			" to cover educational expenses.";
		
		var body = new Array();
        body.push("    <table width=\"100%\" cellspacing=\"0\">\n");
        body.push("      <tr>\n");
        body.push("        <td width=\"20%\"><b>Year</b></td>\n");
        body.push("        <td width=\"20%\"><b>Starting Balance</b></td>\n");
        body.push("        <td width=\"20%\"><b>Contributions and Interest</b></td>\n");
        body.push("        <td width=\"20%\"><b>Expenses</b></td>\n");
        body.push("        <td width=\"20%\"><b>Ending Balance</b></td>\n");
        body.push("      </tr>\n");

		var snapshots = savings.getYearlySnapshots();
        for (var i = 1; i <= years; ++i) {
            var snapshot = snapshots[i];
            if (i % 2 == 0) {
                body.push("      <tr>\n");
            } else {
                body.push("      <tr class=\"highlightStripe\">\n");
            }
            body.push("        <td>");
			body.push(i);
			body.push("</td>\n");
            body.push("        <td>");
			body.push(snapshot.getBeginningBalance().formatted());
			body.push("</td>\n");
            body.push("        <td>");
			body.push(snapshot.getInvestmentGrowth().formatted());
			body.push("</td>\n");
            body.push("        <td>");
			body.push(snapshot.getExpenses().formatted());
			body.push("</td>\n");
            body.push("        <td>");
			body.push(snapshot.getEndingBalance().formatted());
			body.push("</td>\n");
            body.push("      </tr>\n");
        }

        body.push("    </table>\n");
		
        return body.join("");
	}
	
	this.getTitle = function() {
		return "Report";
	}
}
Calculators.report.CollegeSavingsReport.prototype = new Calculators.report.Report();

