<?xml version='1.0'?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" />
<xsl:param name="numCols" select="4"/>

<xsl:template match="images">
<xsl:text disable-output-escaping="yes">
&lt;body link="blue" alink="blue" vlink="blue" bgcolor="#ffffff"&gt;
</xsl:text>

<center>
<table bgcolor="#ffffff" width="100%" cellpadding="5" cellspacing="0" border="0">
<tr>
<td width="33%" align="center" valign="top"><img src="http://digital.lib.umn.edu/IMAGES/images/maeswordmark.gif"/></td>
<td width="33%" align="center" valign="bottom"><font color="#000000" face="arial" size="+2"><b>Search Results</b><br /><br /></font>
<a href="http://www.extension.umn.edu/ext_image_lib/">New Search</a>
</td>
<td width="33%" align="center" valign="top"><img src="http://digital.lib.umn.edu/IMAGES/images/umeswordmark.gif"/></td>
</tr>
</table>
</center>
<hr />

<center>

<table>
<xsl:attribute name="width">90%</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellpadding">2</xsl:attribute>
<xsl:attribute name="cellspacing">1</xsl:attribute>
<xsl:call-template name="make-rows"/>
</table>
</center>

<hr />

<p align="center">
<font size="1" color="black">
<a>
<xsl:attribute name="href">http://digital.lib.umn.edu/IMAGES/</xsl:attribute>
<img>
<xsl:attribute name="src">/images/imagesartlogo3mini.jpg</xsl:attribute> 
<xsl:attribute name="border">0</xsl:attribute>
</img>
</a>
<br />
This site is a participant in the 
<a><xsl:attribute name="href">http://www.lib.umn.edu</xsl:attribute>
 University of Minnesota Libraries</a> Metadata Aggregator<br />
Copyright 2001, Regents of the University of Minnesota -- Twin Cities, All Rights Reserved<br/>
The University of Minnesota is an equal opportunity educator and employer.<br/>
Send comments, questions to 
<a><xsl:attribute name="href">mailto:dlh@umn.edu</xsl:attribute>dlh@umn.edu</a>
</font>
</p>
<!-- </body> take care of this in code... -->
</xsl:template>

<xsl:template match="image">
<xsl:text>&#10;</xsl:text>
<td align="center" valign="bottom" bgcolor="#e9e8e8">
<br />
<font size="2" color="#660000" face="verdana">
<a>
<xsl:attribute name="href">http://bigbird.lib.umn.edu/umimage/servlet/DisplayImage/ag/<xsl:value-of select="./digitalid"/></xsl:attribute>
<font color="black">
<img>
<xsl:attribute name="src">
<xsl:value-of select="./thmbimg/thmbpath"/>
</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</img></font></a><br />
     <xsl:choose>
     	<xsl:when test="title">
        <xsl:value-of select="substring(title,1,20)"/><xsl:text>...</xsl:text>
        </xsl:when>
        <xsl:when test="caption">
        <xsl:value-of select="substring(caption,1,20)"/><xsl:text>...</xsl:text>
        </xsl:when>
        <xsl:when test="annotat">
        <xsl:value-of select="substring(annotat,1,20)"/><xsl:text>...</xsl:text>
        </xsl:when>
        <xsl:when test="descript">
        <xsl:value-of select="substring(descript,1,20)"/><xsl:text>...</xsl:text>
        </xsl:when>
        <xsl:otherwise>
        <xsl:value-of select="substring(digitalid,1,20)"/>
        </xsl:otherwise>
     </xsl:choose>
</font>
<br /><br />
</td>
</xsl:template>

<xsl:template name="make-rows">
<xsl:param name="n" select="1"/>
<xsl:choose>
<xsl:when test="$n &gt; count(image)"/>
<xsl:otherwise>
<xsl:text>&#10;</xsl:text>
<tr>
<xsl:apply-templates select="image[position() &gt;= $n and position() &lt; $n + $numCols]"/>
<xsl:if test="not(image[position() &gt;= $n + $numCols]) and
                            count(image) mod $numCols">
<xsl:call-template name="fill-row">
<xsl:with-param name="num-empty" select="$numCols - count(image) mod $numCols"/>
</xsl:call-template>
</xsl:if>
</tr>
<xsl:call-template name="make-rows">
<xsl:with-param name="n" select="$n + $numCols"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="fill-row">
<xsl:param name="num-empty"/>
<xsl:choose>
<xsl:when test="$num-empty = 0"/>
<xsl:otherwise>
<td></td>
<xsl:call-template name="fill-row">
<xsl:with-param name="num-empty" select="$num-empty - 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

