﻿<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'
version="1.0">

	<xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>

	<xsl:template match="/">
		<xsl:text disable-output-escaping="yes"><![CDATA[
	<script type="text/javascript" src="/estilos/CombosC.js"></script>
	<script type="text/javascript" src="/estilos/jquery.js"></script>
	]]></xsl:text>

		<table border="0" width="100%" id="table73">
			<tr>
				<td style="padding-bottom:15px;padding-top:15px;border-bottom:1px solid #ececec;">
					<span style="color:#b80e2b;	font-size:14px;	font-weight:bold;	text-transform:uppercase; font-family:'Verdana';">
            Recomendaciones personalizadas
          </span>

				</td>
			</tr>
			
			<tr>
				<td>
					<xsl:call-template name="Cenas"/>
				</td>
			</tr>
		</table>
	</xsl:template>
  
	<xsl:template name="Cenas">
		<table cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td>
          <span style="color:#b80e2b; font-family:'Verdana';font-size:12px;font-weight:bold;">Edad</span>
          <br></br>
          <select style="width:150px;margin-top:5px;" name="Comboedad" id="Comboedad" onchange="Combos(this);">
            <option></option>
            <xsl:for-each select="./data/row">
              <xsl:sort select="substring-before(substring-after(./Busqueda,'|'),'|')"></xsl:sort>
              <xsl:sort select="./position"></xsl:sort>
              <xsl:variable name="Busqueda" select="substring-before(substring-after(./Busqueda,'|'),'|')"></xsl:variable>
              <xsl:variable name="col" select="//row[substring-before(substring-after(./Busqueda,'|'),'|')=$Busqueda]" />
              <xsl:if test="$col[position()=1]/ID = ./ID">
                <option>
                  <xsl:attribute name="value">
                    <xsl:value-of select="substring-before(substring-after(./Busqueda,'|'),'|')" />
                  </xsl:attribute>
                  <xsl:value-of select="substring-before(substring-after(./Busqueda,'|'),'|')" />
                </option>
              </xsl:if>
            </xsl:for-each>
          </select>
          <br></br>
          <br></br>
        </td>
        <td>
          <span style="color:#b80e2b; font-family:'Verdana';font-size:12px;font-weight:bold;">Sexo</span>
          <br></br>
          <select style="width:150px;margin-top:5px;" name="Combosexo" id="Combosexo" onchange="Combos(this);">
            <option></option>
            <xsl:for-each select="./data/row">
              <xsl:sort select="substring-before(./Busqueda,'|')"></xsl:sort>
              <xsl:sort select="./position"></xsl:sort>
              <xsl:variable name="Busqueda" select="substring-before(./Busqueda,'|')"></xsl:variable>
              <xsl:variable name="col" select="//row[substring-before(Busqueda,'|')=$Busqueda]" />
              <xsl:if test="$col[position()=1]/ID = ./ID">
                <option>
                  <xsl:attribute name="value">
                    <xsl:value-of select="substring-before(./Busqueda,'|')" />
                  </xsl:attribute>
                  <xsl:value-of select="substring-before(./Busqueda,'|')" />
                </option>
              </xsl:if>
            </xsl:for-each>
          </select>
          <br></br>
          <br></br>          
        </td>
      </tr>
        <tr colspan="2">
          <td>
          <span style="color:#b80e2b; font-family:'Verdana';font-size:12px;font-weight:bold;">Actividad física</span>
            <br></br>
            <select style="width:150px;margin-top:5px;" name="Comboactividad" id="Comboactividad" onchange="Combos(this);">
              <option></option>
              <xsl:for-each select="./data/row">
                <xsl:sort select="substring-after(substring-after(./Busqueda,'|'),'|')"></xsl:sort>
                <xsl:sort select="./position"></xsl:sort>
                <xsl:variable name="Busqueda" select="substring-after(substring-after(./Busqueda,'|'),'|')"></xsl:variable>
                <xsl:variable name="col" select="//row[substring-after(substring-after(./Busqueda,'|'),'|')=$Busqueda]" />
                <xsl:if test="$col[position()=1]/ID = ./ID">
                  <option>
                    <xsl:attribute name="value">
                      <xsl:value-of select="substring-after(substring-after(./Busqueda,'|'),'|')" />
                    </xsl:attribute>
                    <xsl:value-of select="substring-after(substring-after(./Busqueda,'|'),'|')" />
                  </option>
                </xsl:if>
              </xsl:for-each>
            </select>
            <br></br>
            <br></br>
				</td>
			</tr>
			<tr colspan="2" style="text-align:center;padding-top:20px; padding-bottom:10px;">
				<td>
					<a style="cursor:pointer;">
						<xsl:attribute name="onclick">javascript:Seleccionado2();</xsl:attribute>
						<img border="0" src="/ImagenesEduca/btn_encontrar.jpg"></img>
					</a>
				</td>
			</tr>
		</table>
	</xsl:template>
</xsl:stylesheet>

