<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>Human Nature Review Bookshelf</title>
</head>
<body bgcolor="#FFFFFF" style="font-family:verdana,arial,helvetica,sans-serif;">

<xsl:apply-templates select="ProductInfo/Details">
<xsl:sort select="SalesRank"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>
  
<xsl:template match="Details">

<table border="0" cellpadding="5" cols="2" width="50%" >
<tr>
<td align="left" valign="center" bgcolor="#8ca5ce"><b><font color="#ffffff">HUMAN NATURE REVIEW</font></b></td>

<td align="left" valign="center" rowspan="2"><img src="http://g-images.amazon.com/images/G/01/associates/navbar2000/logo-no-border(1).gif" alt="In Association with Amazon" border="0" height="43" width="148"/></td>
</tr>
<tr>
<td align="left" valign="center" bgcolor="#8ca5ce"><b><font color="#ffffff">In
Association with...</font></b></td>
<td></td>
</tr>
</table>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="#8ca5ce"><td valign="top">
<font color="#ffffff"><b class="sans">You clicked on this item...</b></font>
</td></tr>
</table>
<table border="0" width="100%" cellpadding="1" cellspacing="0" bgcolor="#8ca5ce" ><tr><td>
<table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#8ca5ce"><tr><td bgcolor="#ffffff" valign="top">
<table border="0" width="100%" cellspacing="10"><tr valign="top">
<td width="22%" align="center" valign="center">
<img src="{ImageUrlLarge}"/>
</td>
<td align="left" valign="top" width="55%" style="text-align:left;color:black;font-size:small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">
<img src="http://g-images.amazon.com/images/G/01/icons/icon-books.gif" width="22" height="22" align="absmiddle"      hspace="2" vspace="2" border="0" alt="Icon"/>
<xsl:value-of select="ProductName"/>
<br />
<b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;"><xsl:apply-templates select="Authors"/></b>
<br /><b style="text-align:left;color:black;font-size:x-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">Publisher: </b><b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;"><xsl:value-of select="Manufacturer"/></b>
<br /><b style="text-align:left;color:black;font-size:x-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">Availability: </b><b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;"><xsl:value-of select="Availability"/></b>
<br /><br />
<table border="0">
<tr>
<td valign="top" width="20">
<img src="http://g-images.amazon.com/images/G/01/marketing/free-shipping-2002/fs-truck-icon.gif" width="29" height="22" border="0"/>
</td>
<td align="left" valign="top" style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">
<b>Eligible</b> for <b>FREE</b> Super Saver Shipping on orders over <b>$25.00</b><xsl:text> </xsl:text>
<a href="http://www.amazon.com/exec/obidos/subst/misc/super-saver-shipping.html/ref=mk_gship_dp/" target="_blank">See details</a>.

</td>
</tr>
</table>
<td width="23%" bgcolor="#8ca5ce">
<table bgcolor="#ffffff" width="98%">
<tr><td align="center" valign="top" style="text-align:center;color:black;font-size:xx-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">
amazon.com prices subject to change
</td></tr>
<tr><td align="center" valign="top">
<xsl:call-template name="OurPrice">
<xsl:with-param name="OurPrice" 
select="substring(OurPrice, 2)"/>
<xsl:with-param name="ListPrice" 
select="substring(ListPrice, 2)"/>
</xsl:call-template>
</td></tr>
<tr><td align="center" valign="center">
<xsl:call-template name="BuyButton">
<xsl:with-param name="Asin" 
select="Asin"/>
</xsl:call-template>
</td></tr>
</table>
</td>
<table>

<tr><td align="center" valign="center" style="text-align:left;color:#CC6600;font-size:small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
Customers who shopped for <b style="color:black">"<xsl:value-of select="ProductName"/>"</b> also shopped for 
<a href="http://xml.amazon.com/onca/xml2?&amp;t=darwinanddarwini&amp;dev-t=D2C43HO9U0XYC0&amp;SimilaritySearch={Asin}&amp;type=heavy&amp;sort=+salesrank&amp;f=http://human-nature.com/web-services/asin-to-html-new.xsl">these similar books</a>.<br/>
<br /><br />
</td></tr>

<tr><td style="text-align:left;color:black;font-size:x-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">
CUSTOMER REVIEWS
</td></tr>
<tr><td style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;margin-left:5%;margin-right:5%;">
<xsl:apply-templates select="Reviews/AvgCustomerRating"/>
<xsl:apply-templates select="Reviews/CustomerReview">
<xsl:sort select="Reviews/CustomerReview/Rating" data-type="number" order="descending"/>
</xsl:apply-templates>
</td></tr>

<tr><td align="left" valign="left">
<xsl:call-template name="BuyButton">
<xsl:with-param name="Asin" 
select="Asin"/>
</xsl:call-template>
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:green;font-size:small;font-weight:bold;font-family:arial,helvetica,sans-serif;">NOT FROM THE USA?<br /><br /></td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:black;font-size:xx-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;">
We cannot guarantee availability at international Amazon stores.<br /><br />
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#808000;font-size:x-small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
<img src="http://www.human-nature.com/uk.gif" width="18" height="11" border="0" /> UK Users Click Here: <xsl:text disable-output-escaping="yes">&#60;</xsl:text>a href="http://www.amazon.co.uk/exec/obidos/ASIN/<xsl:value-of select="Isbn"/>/humannaturecom" style="color: blue"<xsl:text disable-output-escaping="yes">&#62;</xsl:text> <xsl:value-of select="ProductName"/><xsl:text disable-output-escaping="yes">&#60;</xsl:text>/a<xsl:text disable-output-escaping="yes">&#62;</xsl:text>
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#808000;font-size:x-small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
<img src="http://www.human-nature.com/ca.gif" width="18" height="11" border="0" /> Canadian Users Click Here: <xsl:text disable-output-escaping="yes">&#60;</xsl:text>a href="http://www.amazon.ca/exec/obidos/ASIN/<xsl:value-of select="Isbn"/>/humannaturere-20" style="color: blue"<xsl:text disable-output-escaping="yes">&#62;</xsl:text> <xsl:value-of select="ProductName"/><xsl:text disable-output-escaping="yes">&#60;</xsl:text>/a<xsl:text disable-output-escaping="yes">&#62;</xsl:text>
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#808000;font-size:x-small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
<img src="http://www.human-nature.com/fr.gif" width="18" height="11" border="0" /> Achetez ici de Amazon en France: <xsl:text disable-output-escaping="yes">&#60;</xsl:text>a href="http://www.amazon.fr/exec/obidos/ASIN/<xsl:value-of select="Isbn"/>/humannaturere-21" style="color: blue"<xsl:text disable-output-escaping="yes">&#62;</xsl:text> <xsl:value-of select="ProductName"/><xsl:text disable-output-escaping="yes">&#60;</xsl:text>/a<xsl:text disable-output-escaping="yes">&#62;</xsl:text>
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#808000;font-size:x-small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
<img src="http://www.human-nature.com/de.gif" width="18" height="11" border="0" /> Kaufen Sie hier von Amazon.de: <xsl:text disable-output-escaping="yes">&#60;</xsl:text>a href="http://www.amazon.de/exec/obidos/ASIN/<xsl:value-of select="Isbn"/>/humannature0c-21" style="color: blue"<xsl:text disable-output-escaping="yes">&#62;</xsl:text> <xsl:value-of select="ProductName"/><xsl:text disable-output-escaping="yes">&#60;</xsl:text>/a<xsl:text disable-output-escaping="yes">&#62;</xsl:text>
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#808000;font-size:x-small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
<img src="http://www.human-nature.com/jp.gif" width="18" height="11" border="0" /> Buy from Amazon.co.jp: <xsl:text disable-output-escaping="yes">&#60;</xsl:text>a href="http://www.amazon.co.jp/exec/obidos/ASIN/<xsl:value-of select="Isbn"/>/humannaturere-22" style="color: blue"<xsl:text disable-output-escaping="yes">&#62;</xsl:text> <xsl:value-of select="ProductName"/><xsl:text disable-output-escaping="yes">&#60;</xsl:text>/a<xsl:text disable-output-escaping="yes">&#62;</xsl:text><br /><br />
</td></tr>

<tr><td align="center" valign="center" style="text-align:left;color:#CC6600;font-size:small;font-weight:bold;font-family:arial,helvetica,sans-serif;">
Customers who shopped for <b style="color:black">"<xsl:value-of select="ProductName"/>"</b> also shopped for 
<a href="http://xml.amazon.com/onca/xml2?&amp;t=darwinanddarwini&amp;dev-t=D2C43HO9U0XYC0&amp;SimilaritySearch={Asin}&amp;type=heavy&amp;sort=+salesrank&amp;f=http://human-nature.com/web-services/asin-to-html-new.xsl">these similar books</a>.<br/>
<br /><br />
</td></tr>

<tr><td align="center" valign="center"></td></tr>

<tr><td align="left" valign="center" style="text-align:left;color:black;font-size:xx-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">
<b>"<xsl:value-of select="ProductName"/>"</b><br />ISBN - <b><xsl:value-of select="Asin"/></b>
</td></tr>

</table>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
</xsl:template>

<xsl:template name="OurPrice">
<xsl:param name="OurPrice"  select="'1.00'"/>
<xsl:param name="ListPrice" select="'1.00'"/>
<xsl:choose>
<xsl:when test="$OurPrice = $ListPrice">
<b style="text-align:left;color:#990000;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">Our price: </b><xsl:text>$</xsl:text>
<xsl:value-of select="$OurPrice"/>
</xsl:when>
<xsl:otherwise>
<b style="text-align:left;color:black;font-size:small;font-weight:bold;arial,verdana,helvetica,sans-serif;text-decoration:line-through;">List price: <xsl:text>$</xsl:text>
<xsl:value-of select="$ListPrice"/></b>
<br /><br />
<b style="text-align:left;color:#990000;font-size:small;font-weight:bold;font-family:arial,helvetica,sans-serif,verdanna;">Our price: <xsl:text>$</xsl:text>
<xsl:value-of select="$OurPrice"/></b>
<br /><br />
<b style="text-align:left;color:green;font-size:small;font-weight:bold;font-family:arial,helvetica,sans-serif,verdana;">THAT'S
<xsl:value-of select="100 - round(($OurPrice div $ListPrice) * 100)"/>
<xsl:text>%</xsl:text>
OFF!
</b><br /><br />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="Authors">
<xsl:choose>
<xsl:when test="count(Author)&gt; 2">
<b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">By: </b>
<xsl:for-each select="Author">
<xsl:choose>
<xsl:when test="not(position() = last())">
<xsl:value-of select="."/>
<xsl:text>, </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>and </xsl:text>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:when test="count(Author) = 2">
<b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">By: 
<xsl:value-of select="Author[1]"/>
<xsl:text> and </xsl:text>
<xsl:value-of select="Author[2]"/></b>
</xsl:when>
<xsl:otherwise>
<b style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">By: 
<xsl:value-of select="Author"/></b>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="BuyButton">
<xsl:param name="Asin"/>
<form method="POST"
action="{concat('http://www.amazon.com/o/dt/assoc/handle-buy-box=',$Asin)}">
<input type="hidden" name="{concat('asin.', $Asin)}" value="1"/>
<input type="hidden" name="tag_value" value="darwinanddarwini"/>
<input type="hidden" name="tag-value" value="darwinanddarwini"/>
<input type="hidden" name="dev-tag-value" value="D2C43HO9U0XYC0"/>
<input type="image" value="Add to Shopping Cart" name="submit.add-to-cart" src="http://www.human-nature.com/buy-from-amazon.gif" align="center" alt="Buy from Amazon" border="0" width="170" height="20"/>
</form>
</xsl:template>


<xsl:template match="AvgCustomerRating">
<tr>
<td colspan="2">
<b style="text-align:center;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;">Average customer rating: </b>
<xsl:call-template name="Stars">
<xsl:with-param name="average" select="."/>
</xsl:call-template>
</td>
</tr>
</xsl:template>
<xsl:template match="CustomerReview">
<tr>
<td colspan="2">
<xsl:call-template name="Stars">
<xsl:with-param name="average" select="Rating"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<b style="text-align:left;color:black;font-size:x-small;font-weight:bold;font-family:verdana,arial,helvetica,sans-serif;"><xsl:value-of select="Summary"/></b>
<br />
<p style="text-align:left;color:black;font-size:x-small;font-weight:normal;font-family:verdana,arial,helvetica,sans-serif;margin-left:5%;margin-right:5%;"><xsl:value-of select="Comment"/>
<br /><br />
</p>
</td>
</tr>
</xsl:template>
<xsl:template name="Stars">
<xsl:param name="average" select="5"/>
<xsl:choose>
<xsl:when test="$average &gt; 4.75">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 4.25">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-4-5.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 3.75">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-4-0.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 3.25">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-3-5.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 2.75">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-3-0.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 2.25">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-2-5.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 1.75">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-2-0.gif"/>
</xsl:when>
<xsl:when test="$average &gt; 1.25">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-1-5.gif"/>
</xsl:when>
<xsl:when test="$average &gt; .75">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-1-0.gif"/>
</xsl:when>
<xsl:when test="$average &gt; .25">
<img src="http://g-images.amazon.com/images/G/01/detail/stars-0-5.gif"/>
</xsl:when>
<xsl:otherwise>
<img src="http://g-images.amazon.com/images/G/01/detail/stars-0-0.gif"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


</xsl:stylesheet>
