﻿<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xsl:include href="htmlformat.xml"/>
  <xsl:template match="/">
    <html>
      <head>
        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
        <script type="text/javascript">
          _uacct = "UA-482330-5";
          urchinTracker();
        </script>
        <title>
          Weekly Recipe Clusters
        </title>
        <script language="javascript" src="scripts/xsl_mop-up.js"></script>
        <script type="text/javascript">
          
          function fixWrapperHeight()
          {
            var topheight = 0;

            var elements = document.getElementsByTagName("div");
            for (i = 0; i <![CDATA[<]]> elements.length; i++)
            {
              if(elements[i].className == 'ifsjswrapper')
              {
                var height = elements[i].offsetHeight;
                if(height > topheight)
                topheight = height;
              }
            }
            
            for (i = 0; i <![CDATA[<]]> elements.length; i++)
            {
              if(elements[i].className == 'ifsjswrapper')
              {
                elements[i].style.height = topheight + 'px';
              }
            }
          }
        </script>
        <style type="text/css">
          .ifsjswrapper{ float:left; width:108px; }
          .ifsjsthumbimage{ text-align:center;}
          .ifsjstitle{ font-size:12px;text-align:center; }
          .ifsjstitle a:link, a:visited{ text-decoration:none; }
        </style>
      </head>
      <body onload="go_decoding();fixWrapperHeight();">
        <div id="cometestme" style="display:none;">
          <xsl:text disable-output-escaping="yes">&amp;amp;</xsl:text>
        </div>
        
          <!--<tr>
            <td>

              <img src="http://www.culinary.net/images/onlinefeatures/onthemenu_green.gif" border="0" alt=""/>
              <br/>
              <xsl:for-each select="weeklyrecipes">
                <xsl:for-each select="recipe">
                  <a>
                    <xsl:attribute name="href">
                      #<xsl:value-of select="@id"/>
                    </xsl:attribute>
                    <xsl:for-each select="title">
                      <xsl:apply-templates/>
                    </xsl:for-each>
                  </a>
                  <br/>
                </xsl:for-each>
              </xsl:for-each>
              <br/>

            </td>
          </tr>-->
        <xsl:for-each select="weeklyRecipeClusters">
          <xsl:for-each select="recipe">
            <xsl:variable name="id" select="@id"/>
            <xsl:variable name="title" select="@title"/>
            <div class="ifsjswrapper">
              <div class="ifsjsthumbimage">
                <a>
                  <xsl:attribute name="name">
                    <xsl:value-of select="@id"/>
                  </xsl:attribute>
                </a>
                <xsl:for-each select="descriptionImage">
                  <xsl:if test="string-length(@src)>0">
                    <xsl:for-each select="@src">
                      <a href="recipe.ashx?recipeId={$id}" title="{$title}">                        
                        <img vspace="3" hspace="3" border="1" width="87px" height="87px">
                          <xsl:attribute name="src">
                            <xsl:value-of select="." />
                          </xsl:attribute>
                          <xsl:attribute name="alt">
                            <xsl:value-of select="../alt" />
                          </xsl:attribute>                          
                        </img>
                      </a>
                    </xsl:for-each>
                  </xsl:if>
                </xsl:for-each>
              </div>
              <div class="ifsjstitle">
                  <a href="recipe.ashx?recipeId={$id}" title="{$title}">                    
                    <xsl:for-each select="shortTitle">
                      <xsl:apply-templates/>
                    </xsl:for-each>
                  </a>     
              </div>
            </div>            
          </xsl:for-each>
        </xsl:for-each>
        <div style="clear:both;"></div>        
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

