<?
	echo "<div id=names style='z-index:100; visibility:hidden; position:relative'>";
	for ($t=1; $t<=$cellnames_lin; $t++) {
		if ($cellnames[$t][1][0]!='#') {
			$posx=substr($cellnames[$t][2],0,2)*1;
			$posy=substr($cellnames[$t][2],2,2)*1;
			$fs=$cellnames[$t][4];
			$fsq=$fs*0.25;
			$fst=$fs*0.33;
			$fsh=$fs*0.5;
			$fse=$fs*0.6;
			$fs3q=$fs*0.75;
			$mapcell1=$mapcell;
			if ($cellnames[$t][3][2]=="1") { $toptobottom=true; } else { $toptobottom=false; }
			switch ($cellnames[$t][3][0]) {
				case "0" :
					$posx=($posx-1)*$mapcell1;
					break;
				case "1" :
					if (!$toptobottom) {
						$posx=(($posx-1)*$mapcell1)+($mapcell/2-strlen($cellnames[$t][5])/2*$fsh);
					} else {
						$posx=(($posx-1)*$mapcell1)+($mapcell/2-$fs/2);
					}
					break;
				case "2" :
					if (!$toptobottom) {
						$posx=($posx*$mapcell)-(strlen($cellnames[$t][5])*$fs);
					} else {
						$posx=$posx*$mapcell-$fs-$fsq;
					}
					break;
				case "3" :
					if (!$toptobottom) {
						$posx=(($posx-1)*$mapcell1)-strlen($cellnames[$t][5])/2*$fsh;
					} else {
						$posx=($posx-1)*$mapcell1-$fse/2;
					}
					break;
			}
			if (!(1&$posy)) {
				$posx+=$mapcell1/2;
			}
			switch ($cellnames[$t][3][1]) {
				case "0" :
					$posy=($posy-1)*$mapcell;
					break;
				case "1" :
					if (!$toptobottom) {
						$posy=(($posy-1)*$mapcell)+($mapcell/2-$fse);
					} else {
						$posy=(($posy-1)*$mapcell)+($mapcell/2-strlen($cellnames[$t][5])*$fst);
					}
					break;
				case "2" :
					if (!$toptobottom) {
						$posy=$posy*$mapcell-$fs;
					} else {
						$posy=$posy*$mapcell-(strlen($cellnames[$t][5])*$fs);
					}
					break;
				case "3" :
					if (!$toptobottom) {
						$posy=(($posy-1)*$mapcell)+($mapcell/2-$fs);
					} else {
						$posy=(($posy-1)*$mapcell)+($mapcell/2-strlen($cellnames[$t][5])*$fse);
					}
					break;
			}
			for ($outl=1; $outl<=2; $outl++) {
				$dec=1;
				if ($outl==1) {
					echo "<div style='position:absolute; left:".($posx+$dec)."px; top:".($posy+$dec)."px;'>";
				} else {
					echo "<div style='position:absolute; left:".$posx."px; top:".$posy."px;'>";
				}
				if ($toptobottom) {
					echo "<table><tr><td align=center>";
				}
				echo "<font";
				if ($outl==1) {
					echo " color=black";
				} else {
					switch ($cellnames[$t][1]) {
						case "1" : echo " color=#8888FF"; break;
						case "2" : echo " color=#888888"; break;
						case "3" : echo " color=#FFA421"; break;
						case "4" : echo " color=#FFD28B"; break;
						case "5" : echo " color=#903D91"; break;
						case "6" : echo " color=#63E963"; break;
						case "7" : echo " color=#6FF1DA"; break;
						case "8" : echo " color=#C1C5FF"; break;
						case "9" : echo " color=#CBC699"; break;
					}
				}
				echo " style='font-size: ".$fs."px; line-height: ".$fs3q."px' class='base'><b>";
				if (!$toptobottom) {
					$cellnames[$t][5]=str_replace(" ", "&nbsp;" ,$cellnames[$t][5]);
					echo $cellnames[$t][5];
				} else {
					for ($i=0; $i<=strlen($cellnames[$t][5])-1; $i++) {
						echo $cellnames[$t][5][$i]."<br>";
					}
				}
				if ($toptobottom) {
					echo "</td></tr></table>";
				}
				echo "</b></font>";
				echo "</div>";
			}
		}
	}
	echo "</div>";
?>