#! /bin/ksh

(
if test -r picdir.ini
then
	cat picdir.ini
fi

for i in tiny/*.[Jj][Pp][Gg]
do
	file=`basename $i`
	if test -r large/$file
	then
		# make an HTML file with the small image pointing to the large
		echo "<a href=\"large/$file\" title=\"Link to larger $file\"><img border=1 src=\"small/$file\" alt=\"Link to larger $file\"></a>" > $file.html
		# now point to that file
		echo "<a href=\"$file.html\" title=\"Link to larger $file\"><img border=1 src=\"tiny/$file\" alt=\"Link to larger $file\"></a>"
	else
		echo "<a href=\"small/$file\" title=\"Link to larger $file\"><img border=1 src=\"tiny/$file\" alt=\"Link to larger $file\"></a>"
	fi
done
) > index.html
