String.prototype.startsWith = function(str)
{return (this.match("^"+str)==str)}

Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};

function CartItem(id, quan, price, name)
{
	this.id = id;
	this.quan = quan;
	this.price = price;
	this.name = name;
}

function Option(type, name, price)
{
	this.type = type;
	this.name = name;
	this.price = price;
}

function OptionList(name, type, opts)
{
	this.name = name;
	this.type = type;
	this.opts = opts;
}

function Food(price, name, desc, image, image_desc, opts, opts_default)
{
	this.price = price;
	this.name = name;
	this.desc = desc;
	this.image = image;
	this.image_desc = image_desc;
	this.opts = opts;
	this.opts_default = opts_default;
}

/*Begin Food Dynamic Generation*/

var f1 = new Array(
	new Food(
		7.95, 
		'Barbequed Shrimp Seafood Skewers', 
		'Taste our savory barbequed shrimp.',
		'images/food/app1.jpg',
		'Delicious Homestyle Shrimp',
		null,
		''
		),
	new Food(
		12.95,
		'Fifth Street Quesadillas',
		'Thiny sliced beef brisket, ground fillet, melted pepper jack and chedder cheese and homemade pico de gallo with a mix of secret spices.',
		'images/food/app2.jpg',
		'The Quesadilla You\'ve Been Waiting For...',
		null,
		''
		)
);

var f2 = new Array(
	new Food(
		8.95,
		'Fresh Cashew Pea Salad',
		'Celery, cauliflower, green onions, and cashews all with the sweet tang of our homestyle ranch.',
		'images/food/salad2.jpg',
		'A delightful burst of heavenly flavors',
		null,
		''
		),
	new Food(
		6.95,
		'Fifth Street House Salad',
		'An inviting kick of flavors that\'ll get you until the very last bite. Your own choice of sauce.',
		'images/food/salad1.jpg',
		'All the flavors of nature presented on a plate',
		[new OptionList('Sauce', 'opt', [new Option(null, 'Ranch', 0), new Option(null, 'Bleu Cheese', 0), 
		new Option(null, 'Ranch + Dried Bleu Cumbles', 0), new Option(null, 'Citrus Vinaigrette', 0)])],
		'Citrus Vinaigrette'
		)
);

var f3 = new Array(
	new Food(
		14.95,
		'Fifth Street Burger',
		'Ground fillet, a mix of secret spices, sharp cheddar, bleu cheese crumbles and a taste that you could die for. Comes with your choice of sauce.',
		'images/food/main1.jpg',
		'The Ultimate Burger',
		[new OptionList('Sauce', 'opt', [new Option(null, 'Bourbon Mushroom Sauce', 0), new Option(null, 'Our Homemade BBQ', 0)]),
		new OptionList('Main Side', 'opt', [new Option(null, 'Baked Beans', 0), new Option(null, 'French Fries', 0)]),
		new OptionList('Second Side', 'opt', [new Option(null, 'Coleslaw', 0), new Option(null, 'Mashed Potatoes', 0), new Option(null, 'Chips', 0)])],
		'Our Homemade BBQ, French Fries, Coleslaw'
		),
	new Food(
		23.95,
		'Succulent New York Strip w/ a Twist',
		'Delicious, market-fresh shrimp paired with a succulent New York Strip, both cooked to perfection.',
		'images/food/main2.jpg',
		'Seafood and Steak, what\'s not to like?',
		[new OptionList('Temperature', 'opt', [new Option(null, 'Well Done', 0), new Option(null, 'Medium Well', 0), new Option(null, 'Medium', 0), new Option(null, 'Medium Rare', 0)]),
		new OptionList('Main Side', 'opt', [new Option(null, 'Baked Beans', 0), new Option(null, 'French Fries', 0), new Option(null, 'House Salad', 0)])],
		'Medium Well, House Salad'
		)
);
	
var f0 = new Array(f1,f2,f3);

/*EOF*/
