<? 	ini_set("memory_limit","32M"); ?>
<? include $DOCUMENT_ROOT."/zzzfilelist.inc"; ?>
<? if (!$dont_inc_general) { include Inc("functions_general.inc.php"); } ?>
<? include Inc("metoo.inc.php"); ?>
<? include Inc("metoo_loc.inc.php"); ?>
<html>
<head><title>MeToo : Middle-Earth Tool for Overcoming Opposition</title></head>
<?
	if (!$goingtologin) { include Inc("testlogin.php");	}
?>
<? $where="input_data"; include Inc("checkgameaccess.inc.php"); ?>
<? include Inc("loaddata.inc.php"); ?>
<?
	$idt=explode(".", $id);
	$hex="";
	if ($idt[0]<10) { $hex.="0"; } $hex.=$idt[0];
	if ($idt[1]<10) { $hex.="0"; } $hex.=$idt[1];
	
	echo "<center><font size=-1><b>".$loc[$loctag[4]+15][$lang]." ".$hex."</b></font><hr>";
	
	
	
	echo "<table width=100%><tr bgcolor=#CCCCEE><td><center>";
	echo "<table width=100%><tr bgcolor=#AAAACC><td><font size=-1><b><center>".$loc[$loctag[9]+22][$lang]."</td></tr></table>";
	$nbtownshere=0;
	if ($nbtowns>0) {
		for ($i=1; $i<=$nbtowns; $i++) {
#			echo "town $i:".$town[$i]->hex."<br>";
			if ($town[$i]->hex==$hex) {
				$nbtownshere++;
				echo "<table border=1><tr>";
				echo "<td width=150><center>";
				echo "<table width=100%><tr bgcolor=#BBBBDD><td><center>";
				echo "<b>".$town[$i]->name."</b><br>";
				echo "</td></tr></table>";
				echo "<font size=-1>";
				if ($town[$i]->size>0) {
					echo $loc[$loctag[9]+$town[$i]->size][$lang];
				}
				if ($town[$i]->fortif>1) {
					echo " (".$loc[$loctag[9]+$town[$i]->fortif-1+5][$lang].")";
				}
				echo "<br>";
				if ($town[$i]->people>0) {
					echo $loc[$loctag[1]+$town[$i]->people][$lang]."</font><br>";
				}

				if (!$uptodate[$town[$i]->people]) {
				echo "<font size=-1><a onclick=\"document.getElementById('destroytown-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+26][$lang]."</a></font><br>";
				echo "<div id='destroytown-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='destroytown'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='people' value='".$town[$i]->people."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+11][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";

				echo "<font size=-1><a onclick=\"document.getElementById('modifytown-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+40][$lang]."</a></font>";
				echo "<div id='modifytown-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='modifytown'>";
				echo $loc[$loctag[4]+1][$lang]."&nbsp;<input type='text' name='townname' value='".$town[$i]->name."' size=10><br>";
				echo $loc[$loctag[4]+2][$lang]."&nbsp;<select name='people'>";
				echo "<option value=0>";
				for ($p=1; $p<=28; $p++) {
					echo "<option value='$p'";
					if ($p==$town[$i]->people) { echo " selected"; }
 					if ($uptodate[$p]) { echo " disabled"; }
 					echo ">".$loc[$loctag[1]+$p][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[9]+19][$lang]." <select name='size'>";
				echo "<option value=0>";
				for ($p=1; $p<=5; $p++) {
					echo "<option value='$p'";
					if ($p==$town[$i]->size) { echo " selected"; }
					echo ">".$loc[$loctag[9]+$p][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[9]+20][$lang]." <select name='fortif'>";
				echo "<option value=0>";
				for ($p=1; $p<=5; $p++) {
					echo "<option value='$p'";
					if ($p==$town[$i]->fortif-1) { echo " selected"; }
					echo ">".$loc[$loctag[9]+$p+5][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[9]+48][$lang]." <select name='dock'>";
				echo "<option value=0>";
				for ($p=1; $p<=2; $p++) {
					echo "<option value='".($p+1)."'";
					if ($p==$town[$i]->dock-1) { echo " selected"; }
					echo ">".$loc[$loctag[9]+$p+48][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[9]+51][$lang]." <select name='hidden'>";
				for ($p=1; $p<=2; $p++) {
					echo "<option value='$p'";
					if ($p==$town[$i]->hidden) { echo " selected"; }
					echo ">".$loc[$loctag[9]+$p+51][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[9]+21][$lang]." <input type='text' name='loyalty' value='".$town[$i]->loyalty."' size=2><br>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+15][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";
				}
				
				echo "</td></tr></table>";
			}
		}
	}
	if ($nbtownshere==0) {
		echo $loc[$loctag[9]+12][$lang]." - ";
		echo "<font size=-1><a onclick=\"document.getElementById('addtown').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+25][$lang]."</a><br></font>";
		echo "<div id='addtown' style='display:none'>";
		echo "<table border=1 cellpadding=5><tr>";
		echo "<form action='input_data_enter.inc.php' method='post'>";
		echo "<td width=150><center>";
		echo $loc[$loctag[4]+1][$lang]." <input type='text' name='townname' size=10><br>";
		echo $loc[$loctag[4]+2][$lang]." <select name='people'>";
		echo "<option value=0>";
		for ($i=1 ;$i<=28; $i++) { echo "<option value='$i'"; if ($uptodate[$i]) { echo " disabled"; } echo ">".$loc[$loctag[1]+$i][$lang]; }
		echo "</select><br>";
		echo $loc[$loctag[9]+19][$lang]." <select name='size'>";
		echo "<option value=0>";
		for ($i=1 ;$i<=5; $i++) { echo "<option value='$i'>".$loc[$loctag[9]+$i][$lang]; }
		echo "</select><br>";
		echo $loc[$loctag[9]+20][$lang]." <select name='fortif'>";
		echo "<option value=0>";
		for ($i=1 ;$i<=5; $i++) { echo "<option value='$i'>".$loc[$loctag[9]+$i+5][$lang]; }
		echo "</select><br>";
		echo $loc[$loctag[9]+48][$lang]." <select name='dock'>";
		echo "<option value=0>";
		for ($i=1 ;$i<=2; $i++) { echo "<option value='".($i+1)."'>".$loc[$loctag[9]+$i+48][$lang]; }
		echo "</select><br>";
		echo $loc[$loctag[9]+21][$lang]." <input type='text' name='loyalty' size=2><br>";
		echo "<input type='hidden' name='action' value='addtown'>";
		echo "<input type='hidden' name='id' value='$id'>";
		echo "<input type='hidden' name='hex' value='$hex'>";
		echo "<input type='hidden' name='game_checked' value='$game'>";
		echo "<input type='submit' value='".$loc[$loctag[9]+13][$lang]."'><br>";
		echo "</td></form></tr></table>";
		echo "</div>";
	}
	echo "</td></tr></table><br>";



	echo "<table width=100%><tr bgcolor=#CCEECC><td><center>";
	echo "<table width=100%><tr bgcolor=#AACCAA><td><font size=-1><b><center>".$loc[$loctag[9]+23][$lang]."</td></tr></table>";
	$nbarmieshere=0;
	if ($nbarmies>0) {
		for ($i=1; $i<=$nbarmies; $i++) {
			if ($army[$i]->hex==$hex) {
				$nbarmieshere++;
				echo "<table border=1><tr><td><center>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<table width=100%><tr bgcolor=#BBDDBB><td><center>";
				echo "<b>".$army[$i]->leadername."</b><br>";
				echo "</td></tr></table>";
				echo "<font size=-1>".$loc[$loctag[1]+$army[$i]->people][$lang]."</font><br>";
				
				if (!$uptodate[$army[$i]->people]) {
				echo "<font size=-1><a onclick=\"document.getElementById('movearmy-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+28][$lang]."</a></font>";
				echo "<div id='movearmy-$i' style='display:none'>";
				echo $loc[$loctag[9]+16][$lang]." <input type='text' name='newhex' size=4><br>";
				echo "<input type='hidden' name='action' value='movearmy'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='people' value='".$army[$i]->people."'>";
				echo "<input type='hidden' name='leader' value='".$army[$i]->leadername."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+17][$lang]."'><br>";
				echo "</div>";
				}
				echo "</td></form></tr></table>";

				if (!$uptodate[$army[$i]->people]) {
				echo "<font size=-1><a onclick=\"document.getElementById('destroyarmy-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+30][$lang]."</a></font><br>";
				echo "<div id='destroyarmy-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='destroyarmy'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='people' value='".$army[$i]->people."'>";
				echo "<input type='hidden' name='leader' value='".$army[$i]->leadername."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+11][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";

				echo "<font size=-1><a onclick=\"document.getElementById('modifyarmy-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+29][$lang]."</a></font><br>";
				echo "<div id='modifyarmy-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td><center>";
				echo "<input type='hidden' name='commandername' value='".$army[$i]->leadername."'>";
				echo "<input type='hidden' name='people' value='".$army[$i]->people."'>";
				echo $loc[$loctag[7]+25][$lang]." <input type='text' name='commanderlvl' size=10 value='".$army[$i]->leadercommand."'><br>";
				echo $loc[$loctag[7]+27][$lang]." <input type='text' name='morale' size=3 value='".$army[$i]->morale."'><br>";
				echo $loc[$loctag[7]+33][$lang]." <input type='text' name='offmagic' size=4 value='".$army[$i]->offmagic."'><br>";
				echo $loc[$loctag[7]+34][$lang]." <input type='text' name='defmagic' size=4 value='".$army[$i]->defmagic."'><br>";
				echo "<table>";
				echo "<tr align=center><td></td><td>#</td><td>".$loc[$loctag[7]+18][$lang]."</td>";
				echo "<td>".$loc[$loctag[7]+19][$lang]."</td><td>".$loc[$loctag[7]+23][$lang]."</td></tr>";
				for ($u=1; $u<=7; $u++) {
					echo "<tr align=center><td>";
					echo $loc[$loctag[7]+$u][$lang];
					echo "</td><td>";
					echo "<input type='text' name='unitnb[$u]' size=3 value='".$army[$i]->unitsnb[$u]."'>";
					echo "</td>";
					if ($u!=7) {
						echo "<td>";		
						echo "<input type='text' name='training[$u]' size=3 value='".$army[$i]->units_training[$u]."'>";
						echo "</td><td>";		
						echo "<input type='text' name='weapons[$u]' size=3 value='".$army[$i]->units_weapons[$u]."'>";
						echo "</td><td>";		
						echo "<input type='text' name='armors[$u]' size=3 value='".$army[$i]->units_armors[$u]."'>";
						echo "</td>";
					}
					echo "</tr>";		
				}
				echo "</table>";
				echo $loc[$loctag[9]+41][$lang]."<br>";
				for ($it=1; $it<=3; $it++) {
					if ($it!=1) { echo " - "; }
					echo "<input type='radio' name='intel' value=$it";
					if (($army[$i]->intel==$it) || (($army[$i]->intel==0) && ($it==1))) { echo " checked"; }
					echo "> ".$loc[$loctag[9]+41+$it][$lang];
				}
				echo "<br>";
				echo "<input type='hidden' name='action' value='modifyarmy'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+15][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";

				echo "<font size=-1><a onclick=\"document.getElementById('modifyracearmy-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+39][$lang]."</a></font><br>";
				echo "<div id='modifyracearmy-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td><center>";
				echo "<input type='hidden' name='formercommandername' value='".$army[$i]->leadername."'>";
				echo "<input type='hidden' name='formerpeople' value='".$army[$i]->people."'>";
				echo $loc[$loctag[4]+2][$lang]." <select name='people'>";
				echo "<option>";
				for ($p=1 ;$p<=28; $p++) {
					echo "<option value='$p'";
					if ($p==$army[$i]->people) { echo " selected"; }
 					if ($uptodate[$p]) { echo " disabled"; }
					echo ">".$loc[$loctag[1]+$p][$lang];
				}
				echo "</select><br>";
				echo $loc[$loctag[4]+1][$lang]." <input type='text' name='commandername' size=10 value='".$army[$i]->leadername."'><br>";
				echo $loc[$loctag[7]+25][$lang]." <input type='text' name='commanderlvl' size=10 value='".$army[$i]->leadercommand."'><br>";
				echo $loc[$loctag[7]+33][$lang]." <input type='text' name='offmagic' size=4 value='".$army[$i]->offmagic."'><br>";
				echo $loc[$loctag[7]+34][$lang]." <input type='text' name='defmagic' size=4 value='".$army[$i]->defmagic."'><br>";
				echo "<input type='hidden' name='action' value='modifyracearmy'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+15][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";
				}
			
				echo "</td></tr></table>";
			}
		}
	}
	if ($nbarmieshere==0) {
		echo $loc[$loctag[9]+14][$lang]." - ";
	}
	echo "<font size=-1><a onclick=\"document.getElementById('addarmy').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+27][$lang]."</a></font><br>";
	echo "<div id='addarmy' style='display:none'>";
	echo "<table border=1 cellpadding=5><tr>";
	echo "<form action='input_data_enter.inc.php' method='post'>";
	echo "<td><center>";
	echo $loc[$loctag[4]+2][$lang]." <select name='people'>";
	echo "<option>";
	for ($i=1 ;$i<=28; $i++) { echo "<option value='$i'"; if ($uptodate[$i]) { echo " disabled"; } echo ">".$loc[$loctag[1]+$i][$lang]; }
	echo "</select><br>";
	echo $loc[$loctag[4]+1][$lang]." <input type='text' name='commandername' size=10><br>";
	echo $loc[$loctag[7]+25][$lang]." <input type='text' name='commanderlvl' size=10><br>";
	echo $loc[$loctag[7]+27][$lang]." <input type='text' name='morale' size=3><br>";
	echo $loc[$loctag[7]+33][$lang]." <input type='text' name='offmagic' size=4><br>";
	echo $loc[$loctag[7]+34][$lang]." <input type='text' name='defmagic' size=4><br>";
	echo "<table>";
	echo "<tr align=center><td></td><td>#</td><td>".$loc[$loctag[7]+18][$lang]."</td>";
	echo "<td>".$loc[$loctag[7]+19][$lang]."</td><td>".$loc[$loctag[7]+23][$lang]."</td></tr>";
	for ($i=1; $i<=7; $i++) {
		echo "<tr align=center><td>";
		echo $loc[$loctag[7]+$i][$lang];
		echo "</td><td>";		
		echo "<input type='text' name='unitnb[$i]' size=3>";
		echo "</td>";
		if ($i!=7) {
			echo "<td>";
			echo "<input type='text' name='training[$i]' size=3>";
			echo "</td><td>";		
			echo "<input type='text' name='weapons[$i]' size=3>";
			echo "</td><td>";		
			echo "<input type='text' name='armors[$i]' size=3>";
			echo "</td>";
		}
		echo "</tr>";		
	}
	echo "</table>";
	echo $loc[$loctag[9]+41][$lang]."<br>";
	echo "<input type='radio' name='intel' value=1 checked> ".$loc[$loctag[9]+42][$lang]." - ";
	echo "<input type='radio' name='intel' value=2> ".$loc[$loctag[9]+43][$lang]." - ";
	echo "<input type='radio' name='intel' value=3> ".$loc[$loctag[9]+44][$lang]."<br>";
	echo "<input type='hidden' name='action' value='addarmy'>";
	echo "<input type='hidden' name='id' value='$id'>";
	echo "<input type='hidden' name='hex' value='$hex'>";
	echo "<input type='hidden' name='game_checked' value='$game'>";
	echo "<input type='submit' value='".$loc[$loctag[9]+13][$lang]."'>";
	echo "</td></form></tr></table>";
	echo "</div>";
	echo "</td></tr></table><br>";
	
	
	
	echo "<table width=100%><tr bgcolor=#EECCCC><td><center>";
	echo "<table width=100%><tr bgcolor=#CCAAAA><td><font size=-1><b><center>".$loc[$loctag[9]+24][$lang]."</td></tr></table>";
	$nbheroeshere=0;
	if ($nbheroes>0) {
		for ($i=1; $i<=$nbheroes; $i++) {
			if ($hero[$i]->hex==$hex) {
				$nbheroeshere++;
				echo "<table border=1><tr><td><center>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<table width=100%><tr bgcolor=#DDBBBB><td><center>";
				echo "<b>".$hero[$i]->name."</b><br>";
				echo "</td></tr></table>";
				$pf=$hero[$i]->people;
				if ($pf==32) { $pf=35; }
				echo "<font size=-1>".$loc[$loctag[1]+$pf][$lang]."</font><br>";

				if (!$uptodate[$hero[$i]->people]) {
				echo "<font size=-1><a onclick=\"document.getElementById('movehero-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+32][$lang]."</a></font>";
				echo "<div id='movehero-$i' style='display:none'>";
				echo $loc[$loctag[9]+16][$lang]." <input type='text' name='newhex' size=4><br>";
				echo "<input type='hidden' name='action' value='movehero'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='name' value='".$hero[$i]->name."'>";
				echo "<input type='hidden' name='people' value='".$hero[$i]->people."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+17][$lang]."'>";
				echo "</div>";
				}
				echo "</td></form></tr></table>";

				if (!$uptodate[$hero[$i]->people]) {
				echo "<font size=-1><a onclick=\"document.getElementById('destroyhero-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+33][$lang]."</a></font><br>";
				echo "<div id='destroyhero-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='destroyhero'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='name' value='".$hero[$i]->name."'>";
				echo "<input type='hidden' name='people' value='".$hero[$i]->people."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+11][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";
				}
			
				echo "</td></tr></table>";
			}
		}
	}
	if ($nbheroeshere==0) {
		echo $loc[$loctag[9]+18][$lang]." - ";
	}
	echo "<font size=-1><a onclick=\"document.getElementById('addhero').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+31][$lang]."</a></font><br>";
	echo "<div id='addhero' style='display:none'>";
	echo "<table border=1 cellpadding=5><tr>";
	echo "<form action='input_data_enter.inc.php' method='post'>";
	echo "<td width=150><center>";
	echo $loc[$loctag[4]+1][$lang]." <input type='text' name='name' size=10><br>";
	echo $loc[$loctag[4]+2][$lang]." <select name='people'>";
	echo "<option>";
	for ($i=1 ;$i<=28; $i++) { echo "<option value='$i'"; if ($uptodate[$i]) { echo " disabled"; } echo ">".$loc[$loctag[1]+$i][$lang]; }
	for ($i=30 ;$i<=31; $i++) { echo "<option value='$i'>".$loc[$loctag[1]+$i][$lang]; }
	echo "<option value='32'>".$loc[$loctag[1]+35][$lang];
	echo "</select><br>";
	echo "<input type='hidden' name='action' value='addhero'>";
	echo "<input type='hidden' name='id' value='$id'>";
	echo "<input type='hidden' name='hex' value='$hex'>";
	echo "<input type='hidden' name='game_checked' value='$game'>";
	echo "<input type='submit' value='".$loc[$loctag[9]+13][$lang]."'>";
	echo "</td></form></tr></table>";
	echo "</div>";
	echo "</td></tr></table><br>";
	
	
	echo "<table width=100%><tr bgcolor=#EEEECC><td><center>";
	echo "<table width=100%><tr bgcolor=#CCCCAA><td><font size=-1><b><center>".$loc[$loctag[9]+34][$lang]."</td></tr></table>";
	$nbartefacthere=0;
	if ($nbartefact>0) {
		for ($i=1; $i<=$nbartefact; $i++) {
			if ($artefact[$i]->hex==$hex) {
				$nbartefacthere++;
				echo "<table border=1><tr><td><center>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<table width=100%><tr bgcolor=#DDDDBB><td><center>";
				$pos=strpos($artefactname[$artefact[$i]->num][$lang], "[");
				if ($pos!=0) {	echo "<b>".substr($artefactname[$artefact[$i]->num][$lang], 0, $pos); } else { echo $artefactname[$artefact[$i]->num][$lang]."</b><br>"; }
				echo "</td></tr></table>";
				
				echo "<font size=-1><a onclick=\"document.getElementById('moveartefact-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+36][$lang]."</a></font>";
				echo "<div id='moveartefact-$i' style='display:none'>";
				echo $loc[$loctag[9]+16][$lang]." <input type='text' name='newhex' size=4><br>";
				echo "<input type='hidden' name='action' value='moveartefact'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='num' value='".$artefact[$i]->num."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+17][$lang]."'>";
				echo "</div>";
				echo "</td></form></tr></table>";

				echo "<font size=-1><a onclick=\"document.getElementById('destroyartefact-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+37][$lang]."</a></font><br>";
				echo "<div id='destroyartefact-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='destroyartefact'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='num' value='".$artefact[$i]->num."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+11][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";
				echo "</td></tr></table>";
			}
		}
	}
	if ($nbartefacthere==0) {
		echo $loc[$loctag[9]+38][$lang]." - ";
	}
	echo "<font size=-1><a onclick=\"document.getElementById('addartefact').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+35][$lang]."</a></font><br>";
	echo "<div id='addartefact' style='display:none'>";
	echo "<table border=1 cellpadding=5><tr>";
	echo "<form action='input_data_enter.inc.php' method='post'>";
	echo "<td width=150><center>";
	echo "<select name='num'>";
	echo "<option>";
	for ($i=1; $i<=190; $i++) { echo "<option value='$i'>";
		$pos=strpos($artefactname[$i][$lang], "[");
		if ($pos!=0) {	echo substr($artefactname[$i][$lang], 0, $pos); } else { echo $artefactname[$i][$lang]; }
	}
	echo "</select><br>";
	echo "<input type='hidden' name='action' value='addartefact'>";
	echo "<input type='hidden' name='id' value='$id'>";
	echo "<input type='hidden' name='hex' value='$hex'>";
	echo "<input type='hidden' name='game_checked' value='$game'>";
	echo "<input type='submit' value='".$loc[$loctag[9]+13][$lang]."'>";
	echo "</td></form></tr></table>";
	echo "</div>";
	echo "</td></tr></table><br>";
	
	
	echo "<table width=100%><tr bgcolor=#FFC0FF><td><center>";
	echo "<table width=100%><tr bgcolor=#FF80FF><td><font size=-1><b><center>".$loc[$loctag[4]+36][$lang]."</td></tr></table>";
	$nbmarkhere=0;
	if ($nbmark>0) {
		for ($i=1; $i<=$nbmark; $i++) {
			if ($mark[$i]->hex==$hex) {
				$nbmarkhere++;
				echo "<table border=1><tr><td><center>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<table width=100%><tr bgcolor=#FF80FF><td><center>";
				$markorient=0;
				if ($mark[$i]->num<=6) { $marknum=1; $markorient=$mark[$i]->num; } else { $marknum=2; $markorient=$mark[$i]->num-6; }
				if ($mark[$i]->num==13) { $marknum=3; }
				echo "<b>".$loc[$loctag[4]+36+$marknum][$lang];
				if ($markorient!=0) {
					echo " - ".$loc[$loctag[4]+15+$markorient][$lang];
				}
				echo "</b><br>";
				echo "</td></tr></table>";
				echo "</td></form></tr></table>";

				echo "<font size=-1><a onclick=\"document.getElementById('destroymark-$i').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+54][$lang]."</a></font><br>";
				echo "<div id='destroymark-$i' style='display:none'>";
				echo "<table><tr>";
				echo "<form action='input_data_enter.inc.php' method='post'>";
				echo "<td width=150><center>";
				echo "<input type='hidden' name='action' value='destroymark'>";
				echo "<input type='hidden' name='id' value='$id'>";
				echo "<input type='hidden' name='hex' value='$hex'>";
				echo "<input type='hidden' name='num' value='".$mark[$i]->num."'>";
				echo "<input type='hidden' name='game_checked' value='$game'>";
				echo "<input type='submit' value='".$loc[$loctag[9]+11][$lang]."'>";
				echo "</td></form></tr></table>";
				echo "</div>";
				echo "</td></tr></table>";
			}
		}
	}
	if ($nbmarkhere==0) {
		echo $loc[$loctag[9]+56][$lang]." - ";
	}
	echo "<font size=-1><a onclick=\"document.getElementById('addmark').style.display='block'\" style='color:black;text-decoration:underline;cursor:pointer'>".$loc[$loctag[9]+55][$lang]."</a></font><br>";
	echo "<div id='addmark' style='display:none'>";
	echo "<table border=1 cellpadding=5><tr>";
	echo "<form action='input_data_enter.inc.php' method='post'>";
	echo "<td width=150><center>";
	echo "<select name='num'>";
	echo "<option>";
	for ($i=1; $i<=6; $i++) { echo "<option value='$i'>".$loc[$loctag[4]+37][$lang]." - ".$loc[$loctag[4]+15+$i][$lang]; }
	for ($i=1; $i<=6; $i++) { echo "<option value='".($i+6)."'>".$loc[$loctag[4]+38][$lang]." - ".$loc[$loctag[4]+15+$i][$lang]; }
	echo "<option value='13'>".$loc[$loctag[4]+39][$lang];
	echo "</select><br>";
	echo "<input type='hidden' name='action' value='addmark'>";
	echo "<input type='hidden' name='id' value='$id'>";
	echo "<input type='hidden' name='hex' value='$hex'>";
	echo "<input type='hidden' name='game_checked' value='$game'>";
	echo "<input type='submit' value='".$loc[$loctag[9]+13][$lang]."'>";
	echo "</td></form></tr></table>";
	echo "</div>";
	echo "</td></tr></table><br>";
?>
<? include Inc("metoobottom.inc.php"); ?>