// functions.js
	var FULL_SIZE = 10;
	var THUMBNAIL = 20;

	function displayPictures(pictureArray, imagesPerLine, imageSize)
	{
		var spacerStyle = "";
		var pictureArrayLength = pictureArray.length;

		var i = 0;
		var result = 0;
		var nextResult = 0;


		if ( imageSize == FULL_SIZE)
		{
			spacerStyle = "longSpacer";
		}//end if
		else if ( imageSize == THUMBNAIL)
		{
			spacerStyle = "shortSpacer";
		}//end else if
		else
		{
			// Assume thumbnail size, if no matches found.
			spacerStyle = "shortSpacer";
		}//end else
		document.write("<table>");

		for(i = 0; i < pictureArrayLength; i++)
		{
			result = i % imagesPerLine;
			nextResult = (i + 1) % imagesPerLine;
			if (result == 0)
			{
				// If three pictures have been displayed
				// Start a new row
				document.write("<tr class=\"verticalAlign\">");
			}//end if

			document.write("<td>");
			document.write(pictureArray[i][0]);
			document.write("<br />");
			document.write(pictureArray[i][1]);
			document.write("</td>");

			if (nextResult == 0)
			{
				// If this is the last of a group of three
				// End the row
				document.write("</tr>");
			}//end if
			else
			{
				document.write("<td>");
				document.write("<img src=\"/images/spacer.gif\" class=\"" + spacerStyle + "\" \>");
				document.write("</td>");
			}//end else
		}//end for

		document.write("</table>");
	}//end displayPictures