﻿function Select(page)
{
	document.getElementById('carte').className = "";
	document.getElementById('lunch').className = "";
	document.getElementById('pizzas').className = "";
	document.getElementById('horaire').className = "";
	document.getElementById('photos').className = "";
	document.getElementById('plan').className = "";
	document.getElementById('evenements').className = "";
	
	document.getElementById(page).className = "selected";
}

function GetRestoPicture()
{
	photo = window.location.search.split("?")[1];
	photo = 'photos/resto/photo' + photo + '.jpg';
	this.document.pic.src = photo;
}

function GetRestoPrevPicture()
{
	photo = window.location.search.split("?")[1];
	photo = parseInt(photo) - 1;
	
	if(photo == 0)
	{
		photo = 19;
	}
	
	window.location.href = "resto_photo.html?" + photo;
//	photo = 'photos/resto/photo' + photo + '.jpg';
//	this.document.pic.src = photo;
}

function GetRestoNextPicture()
{
	photo = window.location.search.split("?")[1];
	photo = parseInt(photo) + 1;

	if(photo == 20)
	{
		photo = 1;
	}

	window.location.href = "resto_photo.html?" + photo;

	photo = 'photos/resto/photo' + photo + '.jpg';
	this.document.pic.src = photo;
}

function GetSnackPicture()
{
	photo = window.location.search.split("?")[1];
	photo = 'photos/snack/photo' + photo + '.jpg';
	this.document.pic.src = photo;
}

function GetSnackPrevPicture()
{
	photo = window.location.search.split("?")[1];
	photo = parseInt(photo) - 1;
	
	if(photo == 0)
	{
		photo = 18;
	}
	
	window.location.href = "snack_photo.html?" + photo;
//	photo = 'photos/snack/photo' + photo + '.jpg';
//	this.document.pic.src = photo;
}

function GetSnackNextPicture()
{
	photo = window.location.search.split("?")[1];
	photo = parseInt(photo) + 1;

	if(photo == 19)
	{
		photo = 1;
	}

	window.location.href = "snack_photo.html?" + photo;

//	photo = 'photos/snack/photo' + photo + '.jpg';
//	this.document.pic.src = photo;
}

function ChangeImage(imgName, image)
{
	document.images[imgName].src = image;
}


function LoadEvents()
{
	window.location.href = 'restaurant.html';
}

