// Copyright 2008 ProjectWizards GmbH. All rights reserved.

//console.log("MEBudget.js");

var MEBudget = WRLObject.extend({
	constructor: function(json)
	{
		this.base();
		this.amount = json.a == null || typeof(json.a) == "undefined" ? null : json.a;
		this.isFractional = json.f == null || typeof(json.f) == "undefined" ? null : json.f;
	},
	
	className: "MEBudget",
	
	sortValue: function() {
		return this.amount;
	},

    toJSON: function() {
        return '{"a":' + this.amount + ', "f":' + this.isFractional+'}';
    }
			
},{

	budgetWithAmountIsFractional: function(amount, isFractional) {
		return new MEBudget({a:amount, f:isFractional});
	}
	
});