<?php
//require_once("includes/quickmysql.php");

$possibleValues = array("home", "about", "projects", "contact");

// checks if the get variable page is defined
// if it is, store it in $page, otherwise set $page = home
if (isset($_GET["page"])){
  $page = $_GET["page"];
}else{
  // home page
  $page = "home";
}

// loops through the possibleValues array
// and if $page is equal to any one of the values 
// it sets the varaible okToRequire = true;
$okToRequire = false;
for ($i = 0; $i < count($possibleValues); $i++){
  if ($page == $possibleValues[$i]){
    $okToRequire = true;
  }
}

if ($okToRequire == false){
  $page = "home";
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head><title></title>
  
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>

  <script type="text/javascript">
  
  $(function(){
   
  });
  </script>
  <style type="text/css">
 
 
    
  </style>
  </head>
  
  <body>
 
	 <div id="head">
	  <div id="centerHeader">
		<h1>Header</h1>
	  </div>
	</div>
	
	<div id="nav">
	  <div id="centerNav">
		<div class="btn">About</div>
		<div class="btn">Projects</div>
		<div class="btn">Contact</div>
	  </div>
	</div>
	
	<div id="content">
	  <?php  require_once($page . ".php"); ?>
	</div>
  </body>
</html>
