
function fnDoThumbNailGrid(d,nNumWidth,aImages)
{
	d.write("<center><table cellpadding=0 cellspacing=20 border=0>");

	nPic=0;
	for(i=0;i<aImages.length; i+=nNumWidth*3)
	{
		d.write("<tr>");

		for(j=0;j<nNumWidth&&nPic<aImages.length;j++)
		{
	d.write("<td class=\"imgcell\" align=\"center\"><!-- <a href=\"#1\" onClick=\"window.open('scripts/showimage.html?image="+aImages[nPic]+"&portrait="+aImages[nPic+2]+"', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=none,resizable=no,copyhistory=yes,width=650,height=650')\"> --><img src=\"main/"+aImages[nPic]+".jpg\"");

	if (aImages[nPic+2]==0)
		d.write("width=\"330\" height=\"330\"");
	else
		d.write("width=\"150\" height=\"150\"");


	d.write("border=\"1\" alt=\"&copy; richard cross - click to zoom\" /><br />"+aImages[nPic+1]+"</a></td>");


			nPic+=3;
		}
		d.write("</tr>");
	}
	d.write("</table></center>");

}

