<?xml     version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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="'ENC'" />
      <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="EN">    

    <div id="PressReleases">
      <div class="Title"><a style="text-decoration:none;color:#A08C78;" href="/en/investors/pressreleases/index.asp" target="_top">Press Releases</a></div> 
        <div class="PressReleasesNewsZone">
            <xsl:for-each select="//NewsReleases/NewsCategory[@Category='NA']/NewsRelease">    
                <xsl:choose> 
                    <xsl:when test="position() &lt; 3">
                        <div style="display:block;" id="num{position()}" class="newsDiv"><span class="Date"><xsl:call-template name="DisplayDateEN"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template></span><br/>
                       <span class="Texte"><a href="/en/investors/pressreleases/index.asp?ID={@ReleaseID}" target="_top"><xsl:value-of select="Title"/></a></span><br/></div>
                    </xsl:when>                
                <xsl:otherwise>
                    <div style="display:none;" id="num{position()}" class="newsDiv"><span class="Date"><xsl:call-template name="DisplayDateEN"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template></span><br/><span class="Texte"><a href="/en/investors/pressreleases/index.asp?ID={@ReleaseID}" target="_top"><xsl:value-of select="Title"/></a></span><br/></div>    
                </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>  
        </div>  
        <xsl:variable name="total2" select="count(//NewsReleases/NewsCategory[@Category='NA']/NewsRelease)" />
        <table cellspacing="0" cellpadding="0" border="0" class="PressReleasesButtonZone">
        <tr>
            <td><div class="ButtonPrevious" onclick="check2('plus', '{$total2}')" id="nextlink">Previous</div></td>
            <td><div class="SeeMore" ><a href="/en/investors/pressreleases/index.asp" class="HomePageGreenLink" target="_top">See more press releases</a></div></td>
            <td><div class="ButtonNextDisable" onclick="check2('minus', '{$total2}')" id="prevlink">Next</div></td>
        </tr>
        </table>
    </div>
    </xsl:template>

    <xsl:template name="FR">    
    <div id="PressReleases">
      <div class="Title"><a style="text-decoration:none;color:#A08C78;" href="/en/investors/pressreleases/index.asp" target="_top">Communiqu&#233;s</a></div> 
        <div class="PressReleasesNewsZone">
            <xsl:for-each select="//NewsReleases/NewsCategory[@Category='NA']/NewsRelease">    
                <xsl:choose> 
                    <xsl:when test="position() &lt; 3">
                        <div style="display:block;" id="num{position()}" class="newsDiv"><span class="Date"><xsl:call-template name="DisplayDateFR"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template></span><br/>
                       <span class="Texte"><a href="/en/investors/pressreleases/index.asp?ID={@ReleaseID}" target="_top"><xsl:value-of select="Title"/></a></span><br/></div>
                    </xsl:when>                
                <xsl:otherwise>
                   <div style="display:none;" id="num{position()}" class="newsDiv"><span class="Date"><xsl:call-template name="DisplayDateEN"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template></span><br/><span class="Texte"><a href="/en/investors/pressreleases/index.asp?ID={@ReleaseID}" target="_top"><xsl:value-of select="Title"/></a></span><br/></div>    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>  
        </div>  
        <xsl:variable name="total2" select="count(//NewsReleases/NewsCategory[@Category='NA']/NewsRelease)" />
        <table cellspacing="0" cellpadding="0" border="0" class="PressReleasesButtonZone">
        <tr>
            <td><div class="ButtonPrevious" onclick="check2('plus', '{$total2}')" id="nextlink">Pr&#233;c&#233;dent</div></td>
            <td><div class="SeeMore" ><a href="/en/investors/pressreleases/index.asp" class="HomePageGreenLink" target="_top">Voir d'autres communiqu&#233;s</a></div></td>
            <td><div class="ButtonNextDisable" onclick="check2('minus', '{$total2}')" id="prevlink">Suivant</div></td>
        </tr>
        </table>
    </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:stylesheet>