<?php
	// Pick a number at random to decide what images to load
	$imgset = "_" + rand(1,3);
?>

<!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">
	<head>
		<title>bppb.net</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<link rel="STYLESHEET" type="text/css" href="style.css">
	</head>
	<body bgcolor="#999999">
		<script language="JavaScript">
			<!--
				OK = ((navigator.appName.charAt(0)=='N' && navigator.appVersion.charAt(0)=='3') || navigator.appVersion.charAt(0)=='4');
				if (OK) { preload = new Array(); for (i=1; i<6; i++) { preload[i] = new Image(); preload[i].src = 'images/menu_'+i+'-on<?php echo $imgset; ?>.gif'; } }

				function over(i) { if (OK) { document['menu'+i].src = 'http://www.bppb.net/images/menu_'+i+'_<?php echo $imgset; ?>_o.gif'; } }
				function out(i) { if (OK) { document['menu'+i].src = 'http://www.bppb.net/images/menu_'+i+'_<?php echo $imgset; ?>.gif'; } }
			// -->
		</script>
		<center>
			<table id="Table_01" width="1152" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="6"><img id="index_01" src="images/index_01_<?php echo $imgset; ?>.jpg" width="1152" height="399" alt="" /></td>
				</tr>
				<tr>
					<td><img id="index_02" src="images/index_02_<?php echo $imgset; ?>.jpg" width="341" height="32" alt="" /></td>
					<td><a href="/index.php" onmouseover="over(1);" onmouseout="out(1);"><img name="menu1" id="index_03" src="images/menu_1_<?php echo $imgset; ?>.gif" width="118" height="32" border="0" alt="Home" /></a></td>
					<td><a href="/index.php?page=about" onmouseover="over(2);" onmouseout="out(2);"><img name="menu2" id="index_04" src="images/menu_2_<?php echo $imgset; ?>.gif" width="118" height="32" border="0" alt="About" /></a></td>
					<td><a href="/index.php?page=work" onmouseover="over(3);" onmouseout="out(3);"><img name="menu3" id="index_05" src="images/menu_3_<?php echo $imgset; ?>.gif" width="118" height="32" border="0" alt="Work" /></a></td>
					<td><a href="/index.php?page=contact" onmouseover="over(4);" onmouseout="out(4);"><img name="menu4" id="index_06" src="images/menu_4_<?php echo $imgset; ?>.gif" width="118" height="32" border="0" alt="Contact" /></a></td>
					<td><img id="index_07" src="images/index_07_<?php echo $imgset; ?>.jpg" width="339" height="32" alt="" /></td>
				</tr>
				<tr>
					<td colspan="6"><img id="index_08" src="images/index_08_<?php echo $imgset; ?>.gif" width="1152" height="6" alt="" /></td>
				</tr>
				<tr>
					<td colspan="6" class="content">
<?php
$base = "data/";
 
if (isset($_GET['page'])) 
{
	if (strpos($_GET['page'], "/")) 
	{
		$path = substr(str_replace('..', '', $_GET['page']), 0, strpos($_GET['page'], "/")) . "/";
		$file = substr(strrchr($_GET['page'], "/"), 1);
		
		$dir = $base . $path;	

		if (file_exists($dir.$file.".php")) 
		{
			include($dir.$file.".php");
		} 
		else 
		{
			include($base."uhoh.php");
		}
	} 
	else 
	{
		if (file_exists($base.basename($_GET['page']).".php")) 
		{
			include($base.basename($_GET['page']).".php");
		} 
		else 
		{
         		include($base."uhoh.php");
      		}
   	}
} 
else 
{
	include($base."home.php");
}
?> 
					</td>
				</tr>
			</table>
		</center>
	</body>
</html>
