// All scripts copyright (c) 2006, Stacey's Pennywell, Amsterdam
// Author: Mark van Leeuwen

/** 
 * Preloads all images used by the menu pages, starting from the menus 
 * itself and finishing with the images for the selected buttons.
 *
 * It is assumed this function is called from index.html, i.e. before 
 * the menu is displayed.
 */
function preloadMenu(imagesDir) {
	// preload menu images
	for (var i = 0; i < menuImgs.length; i++) {
		(new Image()).src = imagesDir + '/menus/' + menuImgs[i];
	}
	
	// preload button images
	for (var i = 0; i < menuButtonsImgs.length; i++) {
		(new Image()).src = imagesDir + '/buttons/' + menuButtonsImgs[i];
	}
}

/**
 * Preloads all images used by the gallery.
 */
function preloadGallery(imagesDir) {
	for (var i = 1; i <= 5; i++) {
		(new Image()).src = imagesDir + '/gallery/gallery' + i + '.jpg';
	}
}

var menuImgs = [
	'breakfastAndLunch.gif',
	'dinner.gif', 
	'fingerfoodAndCocktails.gif', 
	'wine.gif', 
	'dessert.gif'
];

var menuButtonsImgs = [
	'home.gif',
	'previous.gif',
	'next.gif',

	'breakfastAndLunch_Selected.gif',
	'dinner.gif', 
	'fingerfood.gif', 
	'cocktail.gif', 
	'wine.gif',
	'dessert.gif',

	'breakfastAndLunch.gif',
	'dinner_Selected.gif', 
	'fingerfood_Selected.gif', 
	'cocktail_Selected.gif', 
	'wine_Selected.gif',
	'dessert_Selected.gif'
];