<?php

function displayThumbnails ($dataFile, $numCol = 3)
{
	echo "<font class=\"detail\">&nbsp;&nbsp;&nbsp;&nbsp;Click on thumbnail for larger image and details</font>";


	if (stristr($_SERVER["HTTP_HOST"], "emily-wilson.com") == "emily-wilson.com")
	    $path = "/home/markstek/www/emily-wilson/data/";
	else
	    $path = "e:/www/web/ew/data/";

	$filename = $path . $dataFile . ".pdata";

	include $filename;

	$colCnt = 0;
	echo "\n<table border=0 cellspacing=10>\n";

	$names = array(); 
	$i = 0;

	// Loop trough all work nodes
	for ($a = 0; $a < sizeof($art); $a++)
	{
		if (($colCnt % $numCol) == 0)
		{
			if ($a > 0)
			{
				echo " </tr>\n <tr>\n";

				for ($j = 0; $j < $i; $j++)
				{
					echo "  <td align=\"center\"><font class=\"workName\">";
					echo $names[$j];
					echo "</font></td>\n";
				}
			}
			echo "<tr>\n"; 
			$i = 0;
		}
		$work = $art[$a];
		echo "  <td align=\"center\" valign=\"center\">";
		if (strcmp($work["file"], "_BLANK_"))
		{
			echo "<a href=\"dispWork.php?file=$dataFile&work=" . $work["file"] . "\">";
			echo "<img border=0 src=\"images/art/" . $imgPath . "/thumbnails/" . $work["file"] . ".jpg\">";
			echo "</a>";
			$names[$i] = $work["name"];
		}
		else
		{
			$names[$i] = "";
		}
		echo "</td>\n";
		
		$colCnt++;
		$i++;
	}

	echo " </tr>\n <tr>\n"; 
	for ($j = 0; $j < $i; $j++)
	{
		echo "  <td align=\"center\"><font class=\"workName\">";
		echo $names[$j];
		echo "</font></td>\n";
	}
	
	echo "</tr>\n</table>\n\n\n";
}

?>