<?php
session_start(); 

include("db.php");
include("security.php");
include("datefunctions.php");

// Parameter: waar zijn we...?
$id = $_GET["id"];

print("<html>\n");
print("<head>\n");
print("<title>++ Juventus Club Orange Olanda ++</title>\n");
print('<link rel="shortcut icon" href="/favicon.ico" >');
print("\n");
print("<link rel='stylesheet' href='css/juve.css' />\n");

?>
<script language="JavaScript">
<?php
if ($id === null || is_null($id) || !($id >= 1 || $id <= 12) ) {
?>
<!--

var revert = new Array();
var inames = new Array('p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9', 'p10', 'p11', 'p12');

// Preload
if (document.images) {
  var flipped = new Array();
  for(i=0; i< inames.length; i++) {
    flipped[i] = new Image();
    flipped[i].src = "pics/"+inames[i]+"hover.gif";
  }
}

function over(num) {
  if(document.images) {
    revert[num] = document.images[inames[num]].src;
    document.images[inames[num]].src = flipped[num].src;
  }
}
function out(num) {
  if(document.images) document.images[inames[num]].src = revert[num];
}

//-->
<?php
}
?>

</script>
<script type="text/javascript" src="sha1.js"></script> 
<script type="text/javascript"> 
<!-- 
function createResponse() 
{ 
  document.getElementById( 'response' ).value = hex_sha1( hex_sha1( document.getElementById( 'password' ).value ) + ":" + document.getElementById( 'challenge' ).value ); 
  document.getElementById( 'password' ).value = ""; 
  document.getElementById( 'challenge' ).value = ""; 
  return true; 
} 
//--> 
</script> 

<?php

print("</head>\n");
print("<body>\n");

// Maintable - start
print("<table class='maintable'><tr><td>\n");
	
// Navigation
print("<br />\n");
include("nav.php");
print("<br />\n");

// Aan de hand van parameter afleiden welke pagina we moeten includen

switch ($id) 
{
	case 1: include("gastenboek.php"); break;
	case 2: include("links.php"); break;
	case 3: include("foto.php"); break;
	case 4: include("uitslagen.php"); break;
	case 5: include("reports.php"); break;
	case 8: include("standen.php"); break;
	case 9: include("shop.php"); break;
	case 10: include("declub.php"); break;
	case 12: include("contact.php"); break;
	case 11: include("nieuws.php"); break;
	case 13: include("admin.php"); break;
	case 14: include("disclaimer.php"); break;
	case 99: include("uitslagen_dev.php"); break;
	default: include("main.php"); break;
}

// Maintable - finish
print("</td></tr></table>\n");

print("</body>\n");
print("</html>\n");

disconnect_database($database_connection);

?>