if (Calculators == undefined) {
	var Calculators = {};
}
if (Calculators.loan == undefined) {
	Calculators.loan = {};
}
Calculators.loan.Statement = function Statement(balance, interest, principal){
	this.balance = new Calculators.type.Money(balance);
	this.interest = new Calculators.type.Money(interest);
	this.principal = new Calculators.type.Money(principal);
	
	this.getBalance = function() {
		return this.balance;
	}
	
	this.getInterest = function() {
		return this.interest;
	}
	
	this.getPrincipal = function() {
		return this.principal;
	}
	
	this.getPayment = function() {
		//alert("principal: " + this.principal.getAmount() + ", interest: " + this.interest.getAmount());
		//return (new Calculators.type.Money(this.principal.add(this.interest).getAmount())).getAmount();
		var payment = new Calculators.type.Money(this.getPrincipal());
		payment = payment.add(this.getInterest());
		return new Calculators.type.Money(payment.getAmount());
	}
	
	this.toString = function() {
		return "interest: " + this.interest.formatted() + "; principal: " + 
			this.principal.formatted() + "; balance: " + this.balance.formatted();
	}
}

