﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template name="BirthdayDropDown">
          <xsl:param name="DateOfBirthMasterData" select="'N/A'"></xsl:param>
          <xsl:param name="Day" select="'N/A'"></xsl:param>
          <xsl:param name="Month" select="'N/A'"></xsl:param>
          <xsl:param name="Year" select="'N/A'"></xsl:param>
          <select id="ddlMonth" class="label" style="width:68px; height: 20px; border: 2px solid #4F81BD;">
               <option value="month">Month:</option>
               <xsl:for-each select ="$DateOfBirthMasterData/Months/Month">
                    <xsl:choose>
                         <xsl:when test ="ID = $Month">
                              <option value="{ID}" selected="selected">
                                   <xsl:value-of select ="Name"/>
                              </option>
                         </xsl:when>
                         <xsl:otherwise>
                              <option value="{ID}">
                                   <xsl:value-of select ="Name"/>
                              </option>          
                         </xsl:otherwise>
                    </xsl:choose>
               </xsl:for-each>
          </select>
          <select id="ddlDay" class="label" style="width:50px; height: 20px; border: 2px solid #4F81BD; margin-left:5px;">
               <option value="day">Day:</option>
               <xsl:for-each select ="$DateOfBirthMasterData/Days/Day">
                    <xsl:choose>
                         <xsl:when test =". = $Day">
                              <option value="{.}" selected="selected">
                                   <xsl:value-of select ="."/>
                              </option>
                         </xsl:when>
                         <xsl:otherwise>
                              <option value="{.}">
                                   <xsl:value-of select ="."/>
                              </option>
                         </xsl:otherwise>
                    </xsl:choose>
               </xsl:for-each>
          </select>
          <select id="ddlYear" class="label" style="width:53px; height: 20px; border: 2px solid #4F81BD; margin-left:5px;">
               <option value="year">Year:</option>
               <xsl:for-each select ="$DateOfBirthMasterData/Years/Year">
                    <xsl:choose>
                         <xsl:when test =". = $Year">
                              <option value="{.}" selected="selected">
                                   <xsl:value-of select ="."/>
                              </option>
                         </xsl:when>
                         <xsl:otherwise>
                              <option value="{.}">
                                   <xsl:value-of select ="."/>
                              </option>
                         </xsl:otherwise>
                    </xsl:choose>
               </xsl:for-each>
          </select>
     </xsl:template>
</xsl:stylesheet>
