﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <xsl:call-template name="FollowDiscussion">
            <xsl:with-param name="Followed" select="Discussion/Followed"></xsl:with-param>
            <xsl:with-param name="DiscussionItemID" select="Discussion/DiscussItemID"></xsl:with-param>
            <xsl:with-param name="DiscussionName" select="Discussion/DiscussionName"></xsl:with-param>
            <xsl:with-param name="TemplateURL" select="Discussion/TemplateURL"></xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="FollowDiscussion">
        <xsl:param name="Followed" select="'N/A'"></xsl:param>
        <xsl:param name="DiscussionItemID" select="'N/A'"></xsl:param>
        <xsl:param name="DiscussionName" select="'N/A'"></xsl:param>
        <xsl:param name="TemplateURL" select="'N/A'"></xsl:param>


        <div id="spanFollowCommunity_{$DiscussionItemID}" style="float:left;">
                <xsl:choose>
                    <xsl:when test="$Followed = 3">
                        <span class="publicationSummary">
                            You are following this discussion
                        </span>
                        <span style="font-family: Calibri, Verdana, Arial; font-size: 9pt; font-weight: bold;	color: #4B4B4B; cursor: pointer;"
                              onmouseover="this.style.textDecoration='underline';"
                              onmouseout="this.style.textDecoration='none';"
                              onclick="discussion_Follow({$DiscussionItemID},'{$DiscussionName}',0,'spanFollowCommunity_{$DiscussionItemID}')">
                            (Do not Follow)
                        </span>
                    </xsl:when>
                    <xsl:when test="$Followed = 0">
                        <span id="span_FollowDiscussion_{$DiscussionItemID}" class="onMouseOver"
                              onmouseover="document.getElementById('img_FollowDisc').src='{$TemplateURL}Web/Images/Ver_2_0/BT_follow_hover.png';document.getElementById('span_FollowDisc').style.color='#FFFFFF'"
                              onmouseout="document.getElementById('img_FollowDisc').src='{$TemplateURL}Web/Images/Ver_2_0/BT_follow.png';document.getElementById('span_FollowDisc').style.color='#6D6E71';"
                              onclick="discussion_Follow({$DiscussionItemID},'{$DiscussionName}',3,'spanFollowCommunity_{$DiscussionItemID}')">
                            <img id="img_FollowDisc" src="{$TemplateURL}Web/Images/Ver_2_0/BT_follow.png" class="verticallyMiddle marginLeft15"></img>
                            <span id="span_FollowDisc" class="followDiscussionText verticallyMiddle marginRight10">
                                FOLLOW
                            </span>
                        </span>
                    </xsl:when>
                </xsl:choose>
            </div>
        
        <!--<xsl:if test="$Followed = 0">
            <span id="div_NotFollowing_{$DiscussionItemID}">
                <span id="span_FollowDiscussion_{$DiscussionItemID}" class="onMouseOver"
                     onmouseover="document.getElementById('img_FollowDisc').src='{$TemplateURL}Web/Images/Ver_2_0/BT_follow_hover.png';document.getElementById('span_FollowDisc').style.color='#FFFFFF'"
                     onmouseout="document.getElementById('img_FollowDisc').src='{$TemplateURL}Web/Images/Ver_2_0/BT_follow.png';document.getElementById('span_FollowDisc').style.color='#6D6E71';"
                     onclick="discussion_Follow({$DiscussionItemID},'{$DiscussionName}',3,'span_FollowDiscussion_{$DiscussionItemID}')">
                    <img id="img_FollowDisc" src="{$TemplateURL}Web/Images/Ver_2_0/BT_follow.png" class="verticallyMiddle marginLeft15"></img>
                    <span id="span_FollowDisc" class="followDiscussionText verticallyMiddle marginRight10">
                        FOLLOW
                    </span>
                </span>
            </span>
            <span id="div_Following_{$DiscussionItemID}" style="display:none;">
                <xsl:choose>
                    <xsl:when test="$DiscussionName != ''">
                        <span class="publicationSummary">
                            You are following this discussion
                        </span>
                    </xsl:when>
                    <xsl:otherwise>
                        <span class="publicationSummary">
                            You are following this Publication
                        </span>
                    </xsl:otherwise>
                </xsl:choose>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 9pt; font-weight: bold;	color: #4B4B4B; cursor: pointer;"
                      onmouseover="this.style.textDecoration='underline';"
                      onmouseout="this.style.textDecoration='none';"
                      onclick="discussion_Follow({$DiscussionItemID},'{$DiscussionName}',3,'div_Following_{$DiscussionItemID}')">
                    (Do not Follow)
                </span>
            </span>
        </xsl:if>
        <xsl:if test="$Followed != 0">
            <xsl:choose>
                <xsl:when test="$DiscussionName != ''">
                    <span class="publicationSummary">
                        You are following this discussion
                    </span>
                </xsl:when>
                <xsl:otherwise>
                    <span class="publicationSummary">
                        You are following this Publication
                    </span>
                </xsl:otherwise>
            </xsl:choose>
            <span style="font-family: Calibri, Verdana, Arial; font-size: 9pt; font-weight: bold;	color: #4B4B4B; cursor: pointer;"
                  onmouseover="this.style.textDecoration='underline';"
                  onmouseout="this.style.textDecoration='none';"
                  onclick="discussion_Follow({$DiscussionItemID},'{$DiscussionName}',0,'divFollowCommunity_{$DiscussionItemID}')">
                (Do not Follow)
            </span>
        </xsl:if>-->

    </xsl:template>


</xsl:stylesheet>
