function SubscriptionCalc() {
	var priceStep = 0.5;
	var minMonthlyPrice = 5.00;
	var minMonthlyInvCount = 10;
	var maxInvPrice = 0.5;
	var discountPercents = 0;
	
	var invPriceStep1 = 0.02125;
	var invPriceStep2 = 0.001111111;
	
	var percentStep = 0.6334;
	
	var packageProps = {
		monthlyPrice: minMonthlyPrice,
		monthlyInvCount: minMonthlyInvCount,
		prepaidMonths: 1,
		discountVal: 0.00,
		total: 5.00
	};
	
	/**
	 * Return the calculated price props
	 * @type Object
	 */
	this.getPackageProps = function() {
		return packageProps;
	};
	
	this.calculatePrice = function(step) {
		var price = minMonthlyPrice + (priceStep * step);
		packageProps.monthlyPrice = price = price.toFixed(2);
		var invPrice = 0.0;
		packageProps.monthlyInvCount = 0;
		if(step <= 20) {
			invPrice = maxInvPrice - step * invPriceStep1;
			packageProps.monthlyInvCount = Math.ceil(price / invPrice);
		} else if(step <= 29){
			invPrice = maxInvPrice - (20 * invPriceStep1) - ((step - 20) * invPriceStep2);
			packageProps.monthlyInvCount = Math.ceil(price / invPrice);
		} else {
			packageProps.monthlyInvCount = -1;
		}
		
		_calculateTotal();

		return packageProps;
	};
	
	this.calculateDiscount = function(step) {
		if(step == 0) {
			discountPercents = 0;
		} else if(step >= 1) {
			discountPercents = 2 + (step - 1) * percentStep;
		}
		packageProps.prepaidMonths = step + 1;
		
		_calculateTotal();

		return packageProps;
	};
	
	function _calculateTotal() {
		var total = packageProps.prepaidMonths * packageProps.monthlyPrice;
		var discountVal = (discountPercents / 100) * total;
		total = total - discountVal;
		
		packageProps.discountVal = discountVal.toFixed(2);
		packageProps.total = total.toFixed(2);
	};
};
