﻿$(document).ready(function() {
	var currentPage;
	var currentButton;
	
	currentButton = $(".menuButton1");
	currentButton.css({'background-color' : '#ddd'});
	
	currentPage = $("#page1");
	currentPage.show();

	$(".menuButton1").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page1").show();
		currentPage = $("#page1");
	});
	$(".menuButton2").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page2").show();
		currentPage = $("#page2");
	});
	$(".menuButton3").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page3").show();
		currentPage = $("#page3");
	});
	$(".menuButton4").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page4").show();
		currentPage = $("#page4");
	});
	$(".menuButton5").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page5").show();
		currentPage = $("#page5");
	});
	$(".menuButton6").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page6").show();
		currentPage = $("#page6");
	});
	$(".menuButton7").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page7").show();
		currentPage = $("#page7");
	});
	$(".menuButton8").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page8").show();
		currentPage = $("#page8");
	});
	$(".menuButton9").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page9").show();
		currentPage = $("#page9");
	});
	$(".menuButton10").click(function() {
		if (currentButton != undefined) {
			currentButton.css({'background-color' : '#eee'});
		}
		$(this).css({'background-color' : '#ddd'});
		currentButton = $(this);

		if (currentPage != undefined) {
			currentPage.hide();
		}
		$("#page10").show();
		currentPage = $("#page10");
	});
});
