if (Calculators == undefined) {
	var Calculators = {};
}
if (Calculators.type == undefined) {
	Calculators.type = {};
}
Calculators.type.IRASnapshot = function IRASnapshot(balance, contribution, interestRate, preTaxRate, postTaxRate) {
	this.balance = new Calculators.type.Money(balance);
	this.contribution = new Calculators.type.Money(contribution);
	this.interestRate = new Calculators.type.Rate(interestRate);
	this.preTaxRate = new Calculators.type.Rate(preTaxRate);
	this.postTaxRate = new Calculators.type.Rate(postTaxRate);
	//alert("pre = " + this.preTaxRate.amount + ", post = " + this.postTaxRate.getAmount());
	
	this.getBalance = function() {
		return this.balance;
	}
	
	this.getInvestmentGrowth = function() {
		return new Calculators.type.Money(this.balance.getAmount() * this.interestRate.getAmount());
	}
	
	this.getContribution = function() {
		return this.contribution;
	}
	
	this.getBalanceWithTaxSavings = function() {
		var ira = this.getBalance().getAmount();
		var interest = this.getInvestmentGrowth().getAmount();
		var taxSavings = (ira * this.preTaxRate.getAmount()) - (ira * this.postTaxRate.getAmount());
		var returnVsTaxRate = (interest * this.postTaxRate.getAmount()) - 
			(interest * this.interestRate.getAmount());
		return new Calculators.type.Money(ira + taxSavings - returnVsTaxRate);
	}
}

