﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">

        <xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
        <xsl:variable name="CommunityID" select="AjaxRequest/Params/CommunityID"></xsl:variable>
        <xsl:variable name="CommunityName" select="AjaxRequest/Params/CommunityName"></xsl:variable>

        <xsl:call-template name="CommLinkedToPublication">
            <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
            <xsl:with-param name="CommunityID" select="$CommunityID"></xsl:with-param>
            <xsl:with-param name="CommunityName" select="$CommunityName"></xsl:with-param>
            <xsl:with-param name="Mode">
                <xsl:text>AddNew</xsl:text>
            </xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="CommLinkedToPublication">

        <xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
        <xsl:param name="CommunityID" select="'N/A'"></xsl:param>
        <xsl:param name="CommunityName" select="'N/A'"></xsl:param>
        <xsl:param name="Mode" select="'N/A'"></xsl:param>

        <span id="span_Community_{$CommunityID}" class="sentenceFont publicationSummary"
              style="padding:1px;font-size:16px;margin-bottom:5px;color:#969696;"
              onmouseover="document.getElementById('span_Community_{$CommunityID}').style.border='1px solid #787878';
                            document.getElementById('span_Community_{$CommunityID}').style.borderRadius='5px 5px 5px 5px';
                            document.getElementById('img_Community_{$CommunityID}').style.display='inline';"
              onmouseout="document.getElementById('span_Community_{$CommunityID}').style.border='';
                           document.getElementById('img_Community_{$CommunityID}').style.display='none';">
            <xsl:value-of select="$CommunityName"/>

            <img id="img_Community_{$CommunityID}" src="{$TemplateURL}/Web/Images/Ver_2_0/BT_x.png" align="absmiddle" title="Delete"
                 style="display:none;padding-bottom:2px;margin-left:5px;" width="9" height="9" class="onMouseOver"
                 onclick="RemoveCommLinkToPub('span_Community_{$CommunityID}','{$CommunityID}');"></img>
        </span>
    </xsl:template>
</xsl:stylesheet>
