<?xml     version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:ccbnxml="http://xml.corporate-ir.net" exclude-result-prefixes="xsl xmlns ccbnxml">
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    INCLUDES
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    OUTPUT MEHTOD
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <xsl:output method="html" omit-xml-declaration="yes" indent="yes" standalone="no"/>

  
    <xsl:template match="/">
           <xsl:variable name="strLanguage" select="'FRC'" />
      <xsl:choose>
        <xsl:when test="$strLanguage = 'ENC'">
            <xsl:call-template name="EN"/>
        </xsl:when>  
        <xsl:otherwise>
            <xsl:call-template name="FR"/>
        </xsl:otherwise>
      </xsl:choose> 
    </xsl:template>
    
    <xsl:template name="FR">

        <div id="UpcommingEvents">
        <div class="Title"><a style="text-decoration:none;color:#A08C78;" href="/fr/investisseurs/calendrier/4819.asp" target="_top">&#201;v&#233;nements</a></div>
    
        <div class="UpcommingEventsNewsZone">
            <xsl:for-each select="//Events/Event[substring-after(EventTitle, 'R&#233;sultats') = '' and @EventStatus = '0']">    
                <xsl:sort select="DisplayableDatesTimes/DisplayableDateTime/@EventStartDate" order="descending" />
  
                  <div id="num{position()}" class="newsDiv">
                        <span class="Texte">
                            <a href="/fr/investisseurs/calendrier/4819.asp?EventId={@EventID}" target="_top"><xsl:value-of select="EventTitle"/></a>
                        </span>
                        <br/>
                        <span class="Date">
                                <xsl:call-template name="DisplayDateFR">
                                      <xsl:with-param name="strDate" select="DisplayableDatesTimes/DisplayableDateTime/@EventStartDate"/>
                                </xsl:call-template>
                        </span>
                        <br/>
                        <span class="Date">
                                <xsl:call-template name="DisplayTimeFR">
                                    <xsl:with-param name="strTime" select="DisplayableDatesTimes/DisplayableDateTime/@EventStartTime"/>
                                </xsl:call-template>&#160;HE
                        </span>                                                             
                    </div>    
            </xsl:for-each>  
        </div>   

        <xsl:variable name="total" select="count(//Events/Event[substring-after(EventTitle, 'R&#233;sultats') = '' and@EventStatus = '0'])" />
        <table cellspacing="0" cellpadding="0" border="0" class="UpcommingEventsButtonZone">
        <tr>
            <td><div class="ButtonPrevious" onclick="check2('plus', '{$total}')" id="nextlink" value="Previous">Pr&#233;c&#233;dent</div></td>
            <td><div class="SeeMore"><a href="/fr/investisseurs/calendrier/4819.asp" class="HomePageGreenLink" target="_top">Voir d'autres &#233;v&#233;nements</a></div></td>
            <td><div class="ButtonNextDisable" onclick="check2('minus', '{$total}')" id="prevlink" value="Next">Suivant</div></td>
        </tr>
        </table>
                
    
<script language="javascript">
<![CDATA[ 
load(']]><xsl:value-of select="$total" /><![CDATA[');
]]>
</script>     
</div>
    </xsl:template>

    <xsl:template name="EN">
        <div id="UpcommingEvents">
    <div class="Title"><a style="text-decoration:none;color:#A08C78;" href="/fr/investisseurs/calendrier/4819.asp" target="_top">Evenements</a></div>
    
        <div class="UpcommingEventsNewsZone">
            <xsl:for-each select="//Events/Event[substring-after(EventTitle, 'Earnings Relea') = '' and @EventStatus = '0']">       
                <xsl:sort select="DisplayableDatesTimes/DisplayableDateTime/@EventStartDate" order="descending" />

                    <div id="num{position()}" class="newsDiv">
                        <span class="Texte">
                            <a href="/fr/investisseurs/calendrier/4819.asp?EventId={@EventID}" target="_top"><xsl:value-of select="EventTitle"/></a>
                        </span>
                        <br/>
                        <span class="Date">
                            <!--display nicely formatted Start Date-->
                                <xsl:call-template name="DisplayDateEN">
                                    <xsl:with-param name="strDate" select="DisplayableDatesTimes/DisplayableDateTime/@EventStartDate"/>
                                </xsl:call-template>
                        </span>
                        <br/>
                        <span class="Date">
                                <xsl:call-template name="DisplayTimeEN">
                                    <xsl:with-param name="strTime" select="DisplayableDatesTimes/DisplayableDateTime/@EventStartTime"/>
                                </xsl:call-template>&#160;ET
                        </span>
                                
                                
                    </div>    
            </xsl:for-each>  
        </div>   

        <xsl:variable name="total" select="count(//Events/Event[substring-after(EventTitle, 'Earnings Relea') = '' and @EventStatus = '0'])" />
        <table cellspacing="0" cellpadding="0" border="0" class="UpcommingEventsButtonZone">
        <tr>
            <td><div class="ButtonPrevious" onclick="check2('plus', '{$total}')" id="nextlink" value="Previous">Precedent</div></td>
            <td><div class="SeeMore"><a href="/fr/investisseurs/calendrier/4819.asp" class="HomePageGreenLink" target="_top">See more events</a></div></td>
            <td><div class="ButtonNextDisable" onclick="check2('minus', '{$total}')" id="prevlink" value="Next">Suivant</div></td>
        </tr>
        </table>
                
    
<script language="javascript">
<![CDATA[ 
load(']]><xsl:value-of select="$total" /><![CDATA[');
]]>
</script>     
</div>
    </xsl:template>

    
    <xsl:template name="DisplayDateEN">
        <xsl:param name="strDate"/>
        <!--strDate is assumed to be in yyyymmdd format-->
        <!--year parse-->
        <xsl:variable name="strYear" select="substring($strDate,1,4)"/>
        <!--month parse and string map-->
        <xsl:variable name="intMonth">
            <xsl:value-of select="substring($strDate,5,2)"/>
        </xsl:variable>
        <xsl:variable name="strMonth">
            <xsl:if test="$intMonth='01'">January</xsl:if>
            <xsl:if test="$intMonth='02'">February</xsl:if>
            <xsl:if test="$intMonth='03'">March</xsl:if>
            <xsl:if test="$intMonth='04'">April</xsl:if>
            <xsl:if test="$intMonth='05'">May</xsl:if>
            <xsl:if test="$intMonth='06'">June</xsl:if>
            <xsl:if test="$intMonth='07'">July</xsl:if>
            <xsl:if test="$intMonth='08'">August</xsl:if>
            <xsl:if test="$intMonth='09'">September</xsl:if>
            <xsl:if test="$intMonth='10'">October</xsl:if>
            <xsl:if test="$intMonth='11'">November</xsl:if>
            <xsl:if test="$intMonth='12'">December</xsl:if>
        </xsl:variable>
        <!--day parse and remove trailing 0 if applicable-->
        <xsl:variable name="strDay">
            <xsl:choose>
                <xsl:when test="substring($strDate,7,1) = '0'">
                    <xsl:value-of select="substring($strDate,8,1)"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="substring($strDate,7,2)"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!--display date as Dec. mm, YYYY-->
        <xsl:value-of select="concat($strMonth,' ',$strDay,', ',$strYear)"/>
    </xsl:template>

    <xsl:template name="DisplayDateFR">
        <xsl:param name="strDate"/>
        <!--strDate is assumed to be in yyyymmdd format-->
        <!--year parse-->
        <xsl:variable name="strYear" select="substring($strDate,1,4)"/>
        <!--month parse and string map-->
        <xsl:variable name="intMonth">
            <xsl:value-of select="substring($strDate,5,2)"/>
        </xsl:variable>
        <xsl:variable name="strMonth">
            <xsl:if test="$intMonth='01'">Janvier</xsl:if>
            <xsl:if test="$intMonth='02'">F&#233;vrier</xsl:if>
            <xsl:if test="$intMonth='03'">Mars</xsl:if>
            <xsl:if test="$intMonth='04'">Avril</xsl:if>
            <xsl:if test="$intMonth='05'">Mai</xsl:if>
            <xsl:if test="$intMonth='06'">Juin</xsl:if>
            <xsl:if test="$intMonth='07'">Juillet</xsl:if>
            <xsl:if test="$intMonth='08'">Ao&#251;t</xsl:if>
            <xsl:if test="$intMonth='09'">Septembre</xsl:if>
            <xsl:if test="$intMonth='10'">Octobre</xsl:if>
            <xsl:if test="$intMonth='11'">Novembre</xsl:if>
            <xsl:if test="$intMonth='12'">D&#233;cembre</xsl:if>
        </xsl:variable>
        <!--day parse and remove trailing 0 if applicable-->
        <xsl:variable name="strDay">
            <xsl:choose>
                <xsl:when test="substring($strDate,7,1) = '0'">
                    <xsl:value-of select="substring($strDate,8,1)"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="substring($strDate,7,2)"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!--display date as Dec. mm, YYYY-->
        <xsl:value-of select="concat('Le ',$strDay,' ',$strMonth,' ',$strYear)"/>
    </xsl:template>

    <xsl:template name="DisplayTimeEN">
        <xsl:param name="strTime"/>
        <!--strTime is assumed to be in 00:00:00 format-->
        <xsl:if test="string-length($strTime) &gt; 0">
            <!--hour parse-->
            <xsl:variable name="intHour" select="substring($strTime,1,2)"/>
            <!--minute parse-->
            <xsl:variable name="intMinute" select="substring($strTime, 4,2)"/>
            <!--display time-->
            <xsl:choose>
                <xsl:when test="number($intHour) &lt; 12">
                    <xsl:variable name="strHour">
                        <xsl:choose>
                            <xsl:when test="number($intHour) &lt; 10">
                                <xsl:value-of select="substring($intHour, 2, 1)"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$intHour"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
                    <xsl:value-of select="concat('at ', $strHour, ':', $intMinute, ' a.m')"/>
                </xsl:when>
                <xsl:when test="number($intHour) = 12">
                    <xsl:value-of select="concat('at ', $intHour, ':', $intMinute, ' p.m')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:variable name="intNonMilitaryHour" select="number($intHour) - 12"/>
                    <xsl:variable name="strHour">
                        <xsl:choose>
                            <xsl:when test="number($intNonMilitaryHour) &lt; 10">
                                <xsl:value-of select="substring(string($intNonMilitaryHour), 1, 1)"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$intNonMilitaryHour"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
                    <xsl:value-of select="concat('at ', $strHour, ':', $intMinute, ' p.m')"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:if>
    </xsl:template>

    <xsl:template name="DisplayTimeFR">
        <xsl:param name="strTime"/>
        <!--strTime is assumed to be in 00:00:00 format-->
        <xsl:if test="string-length($strTime) &gt; 0">
            <!--hour parse-->
            <xsl:variable name="intHour" select="substring($strTime,1,2)"/>
            <!--minute parse-->
            <xsl:variable name="intMinute" select="substring($strTime, 4,2)"/>
            <!--display time-->
        <xsl:value-of select="concat('&#224;&#160;', $intHour, 'h', $intMinute)"/>
        </xsl:if>
    </xsl:template>

</xsl:stylesheet>