function cakeType() {

	/* member variables */
	this.version = "0.1"
	this.Prices = new Hash();	//base price lookup
	this.Servings = new Hash();	//number of servings lookup
	this.Layers = new Hash();	//number of layers lookup
	this.Shapes = new Hash();	//shape lookup
	this.filling = "";			//default filling
	this.icing = "";			//default icing
	
	/* Alerts */
	this.alertPrice = function(key) {
		alert(this.Prices.getItem(key));
	}
	this.alertServings = function(key) {
		alert(this.Servings.getItem(key));
	}
	this.alertLayers = function(key) {
		alert(this.Layers.getItem(key));
	}
	this.alertShape = function(key) {
		alert(this.Shapes.getItem(key));
	}

	/* Sets */
	this.setFilling = function(filling) {
		this.filling = filling;
	}
	this.setIcing = function(icing) {
		this.icing = icing;
	}
	
	/* Gets */
	this.getPrice = function(key) {
		return this.Prices.getItem(key);
	}
	this.getServings = function(key) {
		return this.Servings.getItem(key);
	}
	this.getLayers = function(key) {
		return this.Layers.getItem(key);
	}
	this.getShape = function(key) {
		return this.Shapes.getItem(key);
	}
	this.getFilling = function() {
		return this.filling;
	}
	this.getIcing = function() {
		return this.icing;
	}
	

	/* Load */
	this.loadInfo = function(size, price, servings, layers, shape) {
		this.Prices.setItem(size,price);
		this.Servings.setItem(size,servings);
		this.Layers.setItem(size,layers);
		this.Shapes.setItem(size,shape);
	}
}

function Hash()
{
	this.length = 0;
	this.items = new Array();
	for (var i = 0; i < arguments.length; i += 2) {
		if (typeof(arguments[i + 1]) != 'undefined') {
			this.items[arguments[i]] = arguments[i + 1];
			this.length++;
		}
	}
   
	this.removeItem = function(in_key)
	{
		var tmp_previous;
		if (typeof(this.items[in_key]) != 'undefined') {
			this.length--;
			var tmp_previous = this.items[in_key];
			delete this.items[in_key];
		}
	   
		return tmp_previous;
	}

	this.getItem = function(in_key) {
		return this.items[in_key];
	}

	this.setItem = function(in_key, in_value)
	{
		var tmp_previous;
		if (typeof(in_value) != 'undefined') {
			if (typeof(this.items[in_key]) == 'undefined') {
				this.length++;
			}
			else {
				tmp_previous = this.items[in_key];
			}

			this.items[in_key] = in_value;
		}
	   
		return tmp_previous;
	}

	this.hasItem = function(in_key)
	{
		return typeof(this.items[in_key]) != 'undefined';
	}

	this.clear = function()
	{
		for (var i in this.items) {
			delete this.items[i];
		}

		this.length = 0;
	}
}