PricesView.prototype = new PastelBaseView();
PricesView.prototype.constructor = PricesView;

/**
 * @constructor
 * @base PastelBaseView
 */
function PricesView() {
 
	// accessors ==================================================================================
	this.priceCursor = function() {
		return this._getset("div.id_price_cursor", arguments);
	};
	
	this.monthCursor = function() {
		return this._getset("div.id_month_cursor", arguments);
	};
	
	this.monthlyPrice = function() {
		return this._getset("ins.id_monthly_price", arguments);
	};
	
	this.monthlyInvoices = function() {
		return this._getset("ins.id_monthly_invoices", arguments);
	};
	
	this.monthlyInvDesc = function() {
		return this._getset("ins.id_monthly_inv_desc", arguments);
	};
	
	this.prepaidMonths = function() {
		return this._getset("ins.id_prepaid_months", arguments);
	};
	
	this.discountVal = function() {
		return this._getset("ins.id_discount_val", arguments);
	};
	
	this.total = function() {
		return this._getset("ins.id_total", arguments);
	};		
	
	// methods ====================================================================================
	this.getCursorOffset = function($element) {
		var left = $element.css("left");
		return parseInt(left.replace("px", ""));
	};
	
	this.updatePriceSummary = function(priceProps) {
		this.monthlyPrice("set", priceProps.monthlyPrice);
		
		var monthlyInvCount = priceProps.monthlyInvCount;
		if(monthlyInvCount == -1) {
			monthlyInvCount = translate('unlimited');
			this.monthlyInvDesc("css", "display", "none");
		} else {
			this.monthlyInvDesc("css", "display", "block");
		}
		this.monthlyInvoices("set", monthlyInvCount);
		
		this.prepaidMonths("set", priceProps.prepaidMonths);
		this.discountVal("set", priceProps.discountVal);
		this.total("set", priceProps.total);
	};
}
