function OfferManager(a, c, d) {
	this.adults = a;
	this.children = c;
	if ( d!=undefined ) {
		this.days = d;
	} else {
		this.days = 0;
	}
	
	/**
	* The prices of the rooms
	*/
	this.offerPrices = new Array();
	/**
	* Stores the number of booked extras
	*/
	this.extrasBooked = new Array();
	/**
	* Stores the prices of the extras
	*/
	this.extras = new Array();
	
	/**
	* Which catering is selected?
	*/
	this.catering = 0;
	/**
	* Prices of the caterings
	*/
	this.cateringPrices = new Array();
	
	
	this.setCateringPrices = function(prices) {
		this.cateringPrices = prices;
	}
	
	this.addOfferPrice = function(nr, price) {
		this.offerPrices[nr] = price;
	}
	this.countOffers = function() {
		return this.offerPrices.length;
	}
	
	this.addExtra = function(id, priceAdult, priceChildren) {
		this.extras[id] = new Array();
		this.extras[id]['adult'] = priceAdult;
		this.extras[id]['children'] = priceChildren;
		
		this.extrasBooked[id] = new Array();
		this.extrasBooked[id]['adult'] = 0;
		this.extrasBooked[id]['children'] = 0;
	}
	
	this.getExtraAdultPrice = function(id, nrOfAdults) {
		return (this.extras[id]['adult'] * nrOfAdults);
	}
	this.getExtraChildPrice = function(id, nrOfChildren) {
		return (this.extras[id]['children'] * nrOfChildren);
	}
	
	this.selectCatering = function(id) {
		this.catering = id;
	}
	
	this.bookExtra = function(id, adults, children) {
		this.extrasBooked[id]['adult'] = adults;
		this.extrasBooked[id]['children'] = children;
	}
	this.getBookedExtras = function() {
		var bookedExtras = new Array();
		for (var id in this.extrasBooked) {
			if ( this.extrasBooked[id]['adult']>0 || this.extrasBooked[id]['children']>0 ) {
				bookedExtras[id] = new Array();
				bookedExtras[id]['adult'] = this.extrasBooked[id]['adult'];
				bookedExtras[id]['children'] = this.extrasBooked[id]['children'];
			}
		}
		return bookedExtras;
	}
	
	this.getCompleteExtraPrice = function() {
		var price = 0;
		for (var id in this.extrasBooked) {
			price+= this.extrasBooked[id]['adult']*this.extras[id]['adult'];
			price+= this.extrasBooked[id]['children']*this.extras[id]['children'];
		}
		return price;
	}
	this.getCateringPrice = function() {
		var price = 0;
		price+= this.adults * this.cateringPrices[this.catering]['adult'];
		price+= this.children * this.cateringPrices[this.catering]['children'];
		price = price * this.days;
		return price;
	}
	this.getCompletePrice = function(offerNr) {
		var price = this.offerPrices[offerNr];
		price+= this.getCompleteExtraPrice();
		price+= this.getCateringPrice();
		return price;
	}
	
	this.getDifferenceToCatering = function(id) {
		var price = this.getCateringPrice();
		price-= (this.adults * this.cateringPrices[id]['adult'] * this.days);
		price-= (this.children * this.cateringPrices[id]['children'] * this.days);
		price = price*(-1); //Should be the difference, but should tell, how much more or less it will cost
		return price;
	}
}