<? include $DOCUMENT_ROOT."/zzzfilelist.inc"; ?>
<? if (!$dont_inc_general) { include Inc("functions_general.inc.php"); } $dont_inc_general=true; ?>
<?
	$authok=false;
	if ($gamepassword!="") {
		$fn=Inc("gamelist.csv");
		$fp = fopen ($fn, "r");
		if (filesize($fn)>0) { $passlist = fread($fp, filesize($fn)); }
		fclose($fp);
		Decrunch($passlist);
		
		if ($gamepassword==$cell[$game][3]) { $authok=true; }
	}
	if ($authok) {
		$initfocus="onLoad='javascript:validate.go.focus()'";
	} else {
		$initfocus="onLoad='javascript:check.gamepassword.focus()'";
	}
?>
<? include Inc("metootop.inc.php"); ?>
<? $where="checkauth"; include Inc("checkgameaccess.inc.php"); ?>
<center><br>
<?
	if ($gamepassword!="") {
		if ($authok) {
?>
<font class='orangeBOLD'><b><? echo $loc[$loctag[2]+13][$lang]; ?></b></font><br><br>
<form name="validate" action="displaymap.php" method="post">
	<input type="hidden" name="game_checked" value="<? echo $game; ?>">
	<input name="go" type="submit" value="<? echo $loc[$loctag[2]+12][$lang]; ?>">
</form>
<?
		} else {
			echo "<font class='rougebold'><b>".$loc[$loctag[2]+3][$lang]."</b></font><br>";
		}
	}	
	
	if ($gamepassword=="") {
		echo "<font class='orangeBOLD'><b>".$loc[$loctag[2]+11][$lang]." ".$game."</b></font><br>";
?>
<form name="check" action="checkauth.php" method="post">
	<input type="hidden" name="game" value="<? echo $game; ?>">
	<font class='jaunePALE'><? echo $loc[$loctag[2]+14][$lang]; ?> :</font><br>
	<input type="password" name="gamepassword">
	<br>
	<input type="submit" value="<? echo $loc[$loctag[2]+12][$lang]; ?>">
</form>
<?
	}
?>
<? include Inc("metoobottom.inc.php"); ?>