<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:param name="bgColour"></xsl:param>
	<xsl:param name="theColumns"></xsl:param>
	<xsl:param name="theArtistName"></xsl:param>
	<xsl:variable name="countArts" select="-1" />
	<xsl:template match="NewDataSet">
	
<td bgcolor="{$bgColour}">
<!-- row1= breadcrumbs, row2=info, row3=picture iteration-->
<table align="left" valign="top" style="border-collapse: collapse" bordercolor="#111111">
<!--row1-->
<tr><td>
		<table border="0" width="400" style="border-collapse: collapse" bordercolor="#111111">
			<tr><td width="120">
			<a href="ArtistAZ_Query.aspx">Index of Artists</a></td>
			<td align= "left" width="10">|</td>
			<td width="270"><a href="ArtistGallery.aspx?Artist_ID={artworks/Artist_ID}">
			<xsl:value-of select="$theArtistName"></xsl:value-of></a>
			
			<xsl:choose>
			<xsl:when test="Artwork_Value_EUROS &gt; 0">
				&#8364; <xsl:value-of select="Artwork_Value_EUROS" /> euro
			</xsl:when>
			<xsl:otherwise>
				Private Collection
			</xsl:otherwise>
			</xsl:choose>
			</td></tr>
		</table>
</td></tr>
<!--row2-->
<tr><TD bgcolor="{$bgColour}" align="left">
	<br/>For more information on <xsl:value-of select="$theArtistName"></xsl:value-of>, click 
	<a href="./ArtistBio.aspx?Artist_ID={artworks/Artist_ID}">
	here</a><br/><br/>
</TD></tr>	
<TR align="center"><td align="left">
<!--row3-->

<table bgcolor="{$bgColour}" border="0" CELLPADDING="0" CELLSPACING="0" width="680">
<xsl:text disable-output-escaping="yes">&lt;TR align="center"&gt;</xsl:text>
<xsl:for-each select="artworks">

	<xsl:variable name="countArts" select="$countArts+1" />
	<xsl:if test="$countArts div $theColumns=round($countArts div $theColumns) and $countArts &gt; 0">
		<xsl:text disable-output-escaping="yes">&lt;/tr&gt;&lt;tr align="center" &gt;</xsl:text>
    </xsl:if>

		<TD >
		<TABLE bgcolor="{$bgColour}" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="188">
					<TR>
						<TD WIDTH="10">&#160;</TD>
						<TD WIDTH="10">&#160;</TD>
						<TD WIDTH="188" HEIGHT="15" VALIGN="top" ALIGN="center">
							<A href="ImageViewer.aspx?Artist_ID={Artist_ID}&amp;ArtworkIndex={$countArts}">
							<img border="0" src="./live/Thumbnail/{Artwork_Thumbnail}"></img>
							</A>
							<BR/>
								<FONT FACE="verdana, arial, helvetica, sans-serif" SIZE="2">
									<xsl:value-of select="Artwork_Title" />
								</FONT>
							<BR/>
							
							<A href="ArtistBio.aspx?Artist_ID={Artist_ID}">
							<FONT FACE="verdana, arial, helvetica, sans-serif" SIZE="2" STYLE="font-size:9pt;">
									<B><xsl:value-of select="$theArtistName"></xsl:value-of></B>
								</FONT>
							</A>
							<BR/><BR/>
						</TD>
						<TD WIDTH="10">&#160;</TD>
					</TR>
		</TABLE>
		</TD>
</xsl:for-each>
</table>
<!-- end of row3-->
</td></TR>
</table>
</td>
</xsl:template>
</xsl:stylesheet>

