﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="GenericTemplates/HtmlSpacer.xslt" />
    <xsl:include href="GenericTemplates/Item.xslt" />
    <xsl:include href="GenericTemplates/TimeStamp.xslt" />

    <xsl:template match="/">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(Notifications/TemplateURL)"/>

        <xsl:choose>
            <xsl:when test ="Notifications/Mode = 'EmailDigest'">
                <div id="divNotificationControl" width="90%">
                    <xsl:apply-templates select="Notifications"></xsl:apply-templates>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <div id="divNotificationControl">
                    <xsl:apply-templates select="Notifications"></xsl:apply-templates>
                </div>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>

    <xsl:template match ="Notifications">
        <xsl:if test ="count(Notification) != 0">
            <xsl:if test="Mode = 'EmailDigest'">
                <div style="margin-left:30px; padding-top: 10px;">
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;
                                              font-weight: bold;color: #17375E;	font-size: 11pt;">
                        The following activity has occurred in LifeSpace since the last e-mail sent to you:
                    </span>
                </div>
            </xsl:if>
            <xsl:if test="Mode = 'Notifications'">
                <div id="divNotification_Operations" style="margin-left:20px;">
                    <div style="margin-bottom:25px;">
                        <input id="rbOrderByDate" type="radio" name="orderBy" checked="true"
                               onclick='return notificationFilter_Grouping(
                                                    "rbOrderByDate","rbOrderByPerson","rbOrderByGoal");'>
                            <span class="taskFilter">By Date</span>
                        </input>
                        <xsl:call-template name="HtmlSpacer"></xsl:call-template>
                        <input id="rbOrderByPerson" type="radio" name="orderBy"
                               onclick='return notificationFilter_Grouping(
                                                    "rbOrderByDate","rbOrderByPerson","rbOrderByGoal");'>
                            <span class="taskFilter">By Person</span>
                        </input>
                        <xsl:call-template name="HtmlSpacer"></xsl:call-template>
                        <input id="rbOrderByGoal" type="radio" name="orderBy"
                               onclick='return notificationFilter_Grouping(
                                                            "rbOrderByDate","rbOrderByPerson","rbOrderByGoal");'>
                            <span class="taskFilter">By Goal</span>
                        </input>
                        <xsl:call-template name="HtmlSpacer"></xsl:call-template>
                        <input id="chkActions" type="checkbox" checked="true"
                               onclick='return notifications_Filter_CheckBoxes(
                                                    "chkActions" ,"chkNotes","chkGoals","chkUsers", 
                                                    "opt_Item_Update_Users");'>
                            <span class="taskFilter">Actions</span>
                        </input>
                        <xsl:call-template name="HtmlSpacer"></xsl:call-template>
                        <input id="chkNotes" type="checkbox" checked="true"
                               onclick='return notifications_Filter_CheckBoxes(
                                                        "chkActions" ,"chkNotes","chkGoals",
                                                        "chkUsers", "opt_Item_Update_Users");'>
                            <span class="taskFilter">Notes</span>
                        </input>
                        <xsl:call-template name="HtmlSpacer"></xsl:call-template>
                        <input id="chkGoals" type="checkbox" checked="true"
                                onclick='return notifications_Filter_CheckBoxes(
                                                        "chkActions" ,"chkNotes","chkGoals","chkUsers", 
                                                        "opt_Item_Update_Users");'>
                            <span class="taskFilter">Goals</span>
                        </input>
                        <!--<xsl:call-template name="HtmlSpacer"></xsl:call-template>-->
                        <input id="chkUsers" type="checkbox" style="display: none;"
                               onclick='return notifications_Filter_CheckBoxes(
                                                        "chkActions" ,"chkNotes","chkGoals","chkUsers", 
                                                        "opt_Item_Update_Users");'>

                        </input>
                        <!--<xsl:call-template name="HtmlSpacer"></xsl:call-template>-->
                        <select id="opt_Item_Update_Users" name="responsible" style="display: none;" class="dropdown" tabindex="4"
                                onclick='return notifications_Filter_CheckBoxes(
                                                "chkActions" ,"chkNotes","chkGoals","chkUsers", 
                                                "opt_Item_Update_Users");'>
                            <xsl:for-each select="Users/User">
                                <option value="{ID/.}">
                                    <xsl:value-of select="normalize-space(FirstName/.)"/>&#xa0;
                                    <xsl:value-of select="normalize-space(LastName/.)"/>
                                </option>
                            </xsl:for-each>
                        </select>
                    </div>
                </div>
            </xsl:if>
            <div id="divNotification" style="margin-left:20px;">
                <input type="hidden" id="hiddenVersion" name="hiddenVersion" value="1.2"></input>
                <xsl:for-each select="Notification">
                    <xsl:if test ="normalize-space(TypeID)= 7">
                        <xsl:call-template name="NoteCreated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 8">
                        <xsl:call-template name="NoteChanged"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 9">
                        <xsl:call-template name="NoteDeleted"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 5">
                        <xsl:call-template name="ActionChangd"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 4">
                        <xsl:call-template name="ActionCreated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 11">
                        <xsl:call-template name="ActionDeleted"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 1">
                        <xsl:call-template name="GoalCreated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 49">
                        <xsl:call-template name="ChallengeAdded"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 2">
                        <xsl:call-template name="GoalChanged"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 3">
                        <xsl:call-template name="GoalCompleted"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 13">
                        <xsl:call-template name="SecureItMemberRightUpdated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 12">
                        <xsl:call-template name="SecureItMemberAdded"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 6">
                        <xsl:call-template name="ActionCompleted"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 14">
                        <xsl:call-template name="UserRegistered"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 15">
                        <xsl:call-template name="AccountActivated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 16">
                        <xsl:call-template name="ActionAssigned"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 17">
                        <xsl:call-template name="RelationshipRequest"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 18">
                        <xsl:call-template name="RelationshipRequestConfirmed"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 21">
                        <xsl:call-template name="DiscussionAddedActive"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 22">
                        <xsl:call-template name="CommentsAddedinDiscussion"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 26">
                        <xsl:call-template name="DiscussionAddedUser"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 27">
                        <xsl:call-template name="EventLoginfo"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 28">
                        <xsl:call-template name="EventLogEmailDispatcherInfo"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 29">
                        <xsl:call-template name="EventLogEmailDispatcherError"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 30">
                        <xsl:call-template name="EventLogEmailCreaterInfo"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 31">
                        <xsl:call-template name="EventLogEmailCreaterError"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 32">
                        <xsl:call-template name="EventLogSubmittedSurvey"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 33">
                        <xsl:call-template name="EventLogCustomized"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 34">
                        <xsl:call-template name="EventLogAddComment"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 35">
                        <xsl:call-template name="IsUnauthorizedUser"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 36">
                        <xsl:call-template name="FollowItUser"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 37">
                        <xsl:call-template name="NewBlogPosts"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 38">
                        <xsl:call-template name="CreateBrand"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 45">
                        <xsl:call-template name="ResponseAdded"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 46">
                        <xsl:call-template name="ResponseUpdated"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 47">
                        <xsl:call-template name="NoteBookEntryAdded"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 48">
                        <xsl:call-template name="JoinChallenge"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 50">
                        <xsl:call-template name="SurveySubmitted"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 51">
                        <xsl:call-template name="SurveyReturned"></xsl:call-template>
                    </xsl:if>
                    <xsl:if test ="normalize-space(TypeID)= 52">
                        <xsl:call-template name="SurveyReviewed"></xsl:call-template>
                    </xsl:if>
                </xsl:for-each>
            </div>
        </xsl:if>
        <xsl:if test ="count(Notification) = 0">
            <div style="margin:5px; text-align: center;">
                <i>
                    <div>
                        You currently have no notifications.
                    </div>
                    <div>
                        Notifications occur when activity takes place in your goals or followed communities
                    </div>
                </i>
                <!--</span>-->
            </div>
        </xsl:if>
    </xsl:template>

    <xsl:template name ="CreateBrand">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}{normalize-space(Item/BrandKey)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>has setup their brand.
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="NewBlogPosts">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="AuthorDisplayName"/>
                            <!--<xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                                   <xsl:value-of select="normalize-space(Actor/LastName)"/>-->
                        </b>
                    </font>
                    posted a new blog post,
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Publication.aspx?ID={normalize-space(Item/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="FollowItUser">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    is now following the
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Community.aspx?ID={normalize-space(Item/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    Community
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="SurveyReviewed">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has reviewed 
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    worksheet
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="SurveyReturned">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has requested you changed your
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    worksheet answers
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="SurveySubmitted">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has submitted
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    Worksheet
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="JoinChallenge">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has joined
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Challenge.aspx?ID={normalize-space(Item/ID)}">
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    Challenge
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="IsUnauthorizedUser">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_UnAuthorizedUser">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>&#xa0;
                            (<xsl:value-of select="normalize-space(Actor/ActorEmail)"/>)
                        </b>
                    </font>
                    has made
                    <font color="#17375E">
                        <b>
                            5+ unauthorized
                        </b>
                    </font> item views today
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="CommentsAddedinDiscussion">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added a new
                    <font color="#17375E">
                        <b>
                            Comment 
                        </b>
                    </font> on the
                  
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Discussion.aspx?ID={normalize-space(ParentItem/ID)}">
                                <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    Discussion
                  
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <xsl:if test ="Item/NotesHtml">
                <div id="div_Notification_{normalize-space(ID)}_Discussion"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                    <table cellspacing="0" border="0" width="100%">
                        <tr>
                            <td valign="top">
                                <img src="{$TemplatePathURL}Web/Icons/Note%201/32%20Bit%20Alpha%20png/Note%201%2016%20n%20p.png"></img>
                            </td>
                            <td valign="top" align="left" width="100%">
                                <xsl:value-of select ="Item/NotesHtml" disable-output-escaping ="yes"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </xsl:if >
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="NoteBookEntryAdded">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    A new
                    <font color="#17375E">
                        <b>
                            Note
                        </b>
                    </font> has been added to the
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </a>&#xa0;

                        </b>
                    </font>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_NoteBook"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top">
                            <img src="{$TemplatePathURL}Web/Icons/Discussions/32%20Bit%20Alpha%20png/Discussions%2032%20h%20p.png"></img>
                        </td>
                        <td valign="top" align="left" width="100%">
                            <!--<a href="{normalize-space($HostName)}Discussion.aspx?ID={normalize-space(Item/ID)}">-->
                            <b>
                                <xsl:value-of select="Item/Name"/>
                            </b>
                            <!--</a>-->
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="DiscussionAddedActive">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    A new
                    <font color="#17375E">
                        <b>
                            Discussion
                        </b>
                    </font> has been added to the
                    <font color="#17375E">
                        <b>
                            <a href="{normalize-space($HostName)}Community.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </a>&#xa0;

                        </b>
                    </font>
                    <!--</xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>-->
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_Discussion"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top">
                            <img src="{$TemplatePathURL}Web/Icons/Discussions/32%20Bit%20Alpha%20png/Discussions%2032%20h%20p.png"></img>
                        </td>
                        <td valign="top" align="left" width="100%">
                            <a href="{normalize-space($HostName)}Discussion.aspx?ID={normalize-space(Item/ID)}">
                                <b>
                                    <xsl:value-of select="Item/Name"/>
                                </b>
                            </a>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="NoteCreated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                             "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added a
                    <font color="#17375E">
                        <b>Comment</b>
                    </font> under
                    <a>
                        <font color="#17375E">
                            <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                <b onClick='return ActionViewMode(
                                                "{normalize-space(ParentItem/ID)}", 
                                                "div_Item_{normalize-space(ID)}_Operation",
                                                "no"
                                                )' class='onMouseOver'>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                            <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                <b>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                        </font>
                    </a>
                    in the
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent" style="margin-left:50px;">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <xsl:if test ="Item/NotesHtml">
                <div id="div_Notification_{normalize-space(ID)}_Notes"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                    <table cellspacing="0" border="0" width="100%">
                        <tr>
                            <td valign="top">
                                <img src="{$TemplatePathURL}Web/Icons/Note%201/32%20Bit%20Alpha%20png/Note%201%2016%20n%20p.png"></img>
                            </td>
                            <td valign="top" align="left" width="100%">
                                <xsl:value-of select ="Item/NotesHtml" disable-output-escaping ="yes"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </xsl:if >
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="NoteChanged">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png" class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    modified a
                    <font color="#17375E">
                        <b>Comment</b>
                    </font> under
                    <a>
                        <font color="#17375E">
                            <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                <b onClick='return ActionViewMode(
                                                "{normalize-space(ParentItem/ID)}", 
                                                "div_Item_{normalize-space(ID)}_Operation",
                                                "no"
                                                )' class='onMouseOver'>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                            <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                <b>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                        </font>
                    </a>
                    in the
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent" style="margin-left:50px;">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <xsl:if test ="Item/NotesHtml">
                <div id="div_Notification_{normalize-space(ID)}_Notes" style="margin-left:50px; margin-top:3px;">
                    <table cellspacing="0" border="0" width="100%">
                        <tr>
                            <td valign="top">
                                <img src="{$TemplatePathURL}Web/Icons/Note%201/32%20Bit%20Alpha%20png/Note%201%2016%20n%20p.png"></img>
                            </td>
                            <td valign="top" align="left" width="100%">
                                <xsl:value-of select ="Item/NotesHtml" disable-output-escaping="yes"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </xsl:if >
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="NoteDeleted">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    deleted a
                    <font color="#17375E">
                        <b>Note</b>
                    </font> under
                    <a>
                        <font color="#17375E">
                            <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                <b onClick='return ActionViewMode(
                                                "{normalize-space(ParentItem/ID)}", 
                                                "div_Item_{normalize-space(ID)}_Operation",
                                                "no"
                                                )' class='onMouseOver'>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                            <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                <b>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                        </font>
                    </a>
                    in the
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left: 50px;margin-top:3px;margin-bottom:5px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top">
                            <img src="{$TemplatePathURL}Web/Icons/Note%201/32%20Bit%20Alpha%20png/Note%201%2016%20n%20p.png"></img>
                        </td>
                        <td valign="top" align="left" width="100%">
                            <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                                <font color="#17375E">
                                    <b>
                                        <xsl:value-of select="normalize-space(Item/Name)"/>
                                    </b>
                                </font>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="div_Item_{normalize-space(ID)}_Operation_Parent">
                <div id="div_Item_{normalize-space(ID)}_Operation"></div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="DiscussionAddedUser">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added
                    <font color="#17375E">
                        <b>
                            Discussion : <a href="{normalize-space($HostName)}Discussion.aspx?ID={normalize-space(Item/ID)}">
                                <xsl:value-of select="Item/Name"/>
                            </a>
                        </b>
                    </font> under
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        of the
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <!--<a href="{normalize-space($HostName)}Discussion.aspx?ID={normalize-space(PrimaryItem/ID)}">-->
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                        <!--</a>-->
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ActionCreated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> under
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        of the
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <xsl:call-template name="displayAction"></xsl:call-template>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ActionChangd">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px;">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    modified an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> under
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        of the
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <xsl:call-template name="displayAction"></xsl:call-template>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ActionDeleted">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    deleted an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> under
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </font>
                        </a>
                        of the
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left: 50px;margin-top:3px;margin-bottom:5px;;margin-top:3px;margin-bottom:5px;">
                <div id="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}_Name">
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <img src="{$TemplatePathURL}Web/Icons/Action/32%20Bit%20Alpha%20png/Action%2016%20n%20p.png" ></img>
                        &#xa0;
                        <font color="#17375E">
                            <xsl:if test="normalize-space(Item/TypeID) = 8 or normalize-space(Item/TypeID) = 9">
                                <b class='onMouseOver'>
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </b>
                            </xsl:if>
                            <xsl:if test="normalize-space(Item/TypeID) != 8 and normalize-space(Item/TypeID) != 9">
                                <b>
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </b>
                            </xsl:if>
                        </font>
                    </span>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ActionCompleted">
        <xsl:variable name ="TemplatePathURL" select="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    completed an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> under
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        of the
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <xsl:call-template name="displayAction"></xsl:call-template>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ChallengeAdded">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                              "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added a new Challenge
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(PrimaryItem/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png"></img>
                    &#xa0;
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Challenge.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="GoalCreated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                              "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added a new Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(PrimaryItem/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png"></img>
                    &#xa0;
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="GoalChanged">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    modified a Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(PrimaryItem/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png" ></img>
                    &#xa0;
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <img id="div_Notification_{normalize-space(ID)}_seperator_image"
                 src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="GoalCompleted">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    completed a Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(PrimaryItem/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png"></img>
                    &#xa0;
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="SecureItMemberRightUpdated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    changed your
                    <font color="#17375E">
                        <b>Right</b>
                    </font> for
                    <xsl:if test ="normalize-space(PrimaryItem/ID) != normalize-space(ParentItem/ID)">
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        under
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="SecureItMemberAdded">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"></xsl:variable>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    <xsl:if test="normalize-space(Item/TypeID) = 3 and TargetID &gt; 0">
                        added you to a Brand
                    </xsl:if>
                    <xsl:if test="normalize-space(Item/TypeID) = 3 and TargetID &lt;= 0">
                        added you to a Portal
                    </xsl:if>
                    <xsl:if test ="normalize-space(Item/TypeID) = 4 or normalize-space(Item/TypeID) = 5">
                        added you to a Goal
                    </xsl:if>
                    <xsl:if test ="normalize-space(Item/TypeID) = 2">
                        added you to a LifeSpace
                    </xsl:if>
                    <xsl:if test ="normalize-space(Item/TypeID) = 8 or normalize-space(Item/TypeID) = 9">
                        added you to an
                        <font color="#17375E">
                            <b>Action</b>
                        </font> under
                        <a>
                            <font color="#17375E">
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9 ">
                                    <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                    <b>
                                        <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                    </b>
                                </xsl:if>
                            </font>
                        </a>
                        of
                        <xsl:value-of select="normalize-space(Actor/FirstName)"/>'s
                        <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                <font color="#17375E">
                                    <b>
                                        <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                    </b>
                                </font>
                            </a>
                        </xsl:if>
                        <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </xsl:if>
                        Goal
                    </xsl:if>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>

            <xsl:if test="normalize-space(Item/TypeID) = 8 or normalize-space(Item/TypeID) = 9">
                <xsl:call-template name="displayAction"></xsl:call-template>
            </xsl:if>

            <xsl:if test="normalize-space(Item/TypeID) != 8 and normalize-space(Item/TypeID) != 9 and normalize-space(Item/TypeID) != 4 and normalize-space(Item/TypeID) != 5 and normalize-space(Item/TypeID) != 2">
                <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(Item/Name)"/>
                            </b>
                        </font>
                    </span>
                    <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                        <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                    </div>
                </div>
            </xsl:if>

            <xsl:if test="normalize-space(Item/TypeID) = 4 or normalize-space(Item/TypeID) = 5">
                <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <font color="#17375E">
                            <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png"></img>
                            &#xa0;
                            <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(Item/ID)}">
                                <b>
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </b>
                            </a>
                        </font>
                    </span>
                    <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                        <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                    </div>
                </div>
            </xsl:if>

            <xsl:if test="normalize-space(Item/TypeID) = 2">
                <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                     style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <font color="#17375E">
                            <img src="{$TemplatePathURL}Web/Icons/Goal/32%20Bit%20Alpha%20png/Goal%2016%20n%20p.png"></img>
                            &#xa0;
                            <a href="{normalize-space($HostName)}LifeSpace.aspx?ID={normalize-space(Item/ID)}">
                                <b>
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </b>
                            </a>
                        </font>
                    </span>
                    <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                        <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                    </div>
                </div>
            </xsl:if>

            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="UserRegistered">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    <xsl:if test ="normalize-space(Item/TypeID) = 4 or normalize-space(Item/TypeID) = 5">
                        has just registered to LifeSpace
                    </xsl:if>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="AccountActivated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"></xsl:variable>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png" class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>'s
                        </b>
                    </font>
                    <xsl:if test ="normalize-space(Item/TypeID) = 4 or normalize-space(Item/TypeID) = 5">
                        account has been activated.
                    </xsl:if>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ActionAssigned">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has assigned you an Action
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Item/Name)"/>
                        </b>
                    </font>
                    under
                    <a>
                        <font color="#17375E">
                            <xsl:if test="normalize-space(ParentItem/TypeID) = 8 or normalize-space(ParentItem/TypeID) = 9">
                                <b onClick='return ActionViewMode(
                                                    "{normalize-space(ParentItem/ID)}", 
                                                    "div_Item_{normalize-space(ID)}_Operation",
                                                    "no"
                                                    )' class='onMouseOver'>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                            <xsl:if test="normalize-space(ParentItem/TypeID) != 8 and normalize-space(ParentItem/TypeID) != 9">
                                <b>
                                    <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                </b>
                            </xsl:if>
                        </font>
                    </a>
                    of
                    <xsl:value-of select="normalize-space(Actor/FirstName)"/>'s
                    <xsl:if test ="count (../../Notifications/ProjectURL) != 0">
                        <a href="{normalize-space($HostName)}Goal.aspx?ID={normalize-space(PrimaryItem/ID)}">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="count (../../Notifications/ProjectURL) = 0">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(PrimaryItem/Name)"/>
                            </b>
                        </font>
                    </xsl:if>
                    Goal
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="RelationshipRequest">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    created a relationship with you. Please confirm.
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div align="left" style="margin-left : 25px; margin-top: 5px;">
                <input id="txt_relationship_confirm" value="Accept" type="button" class="button"
                       onClick='return confirmRelationship("{normalize-space(Relationship/ID)}", 
                                                   "div_Notification_{normalize-space(ID)}", 
                                                    "{normalize-space(ID)}", 
                                                    "{normalize-space(Item/ID)}",
                                                    "{normalize-space(Relationship/RelatedUserID)}");'
                       runat="server"></input>
                &#xa0;
                <input id="txt_relationship_unconfirm" value="Decline" type="button" class="button"
                       onClick='return unConfirmRelationship("{normalize-space(ID)}", 
                                                    "div_Notification_{normalize-space(ID)}");'
                       runat="server"></input>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="RelationshipRequestConfirmed">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"></xsl:variable>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    has approved your relationship request.
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="displayAction">

        <xsl:variable name="ItemDivPrefix">
            <xsl:text>div_Notification_</xsl:text>
            <xsl:value-of select ="normalize-space(ID)"></xsl:value-of>
            <xsl:text>_Item_</xsl:text>
            <xsl:value-of select ="normalize-space(Item/ID)"></xsl:value-of>
        </xsl:variable>

        <div id="{normalize-space($ItemDivPrefix)}"
             style="margin-left:15px; margin-right: 5px; margin-bottom: 10px;">
            <xsl:call-template name="Item">
                <xsl:with-param name="TemplatePathURL" select="normalize-space(../../Notifications/TemplateURL)"></xsl:with-param>
                <xsl:with-param name="ItemID" select="normalize-space(Item/ID)"></xsl:with-param>
                <xsl:with-param name="GoalID" select="normalize-space(PrimaryItem/ID)"></xsl:with-param>
                <xsl:with-param name="Status" select="normalize-space(Item/Status)"></xsl:with-param>
                <xsl:with-param name="Level" select="normalize-space(Item/Level)"></xsl:with-param>
                <xsl:with-param name="ParentParentID" select="normalize-space(Item/ParentParentID)"></xsl:with-param>
                <xsl:with-param name="ParentID" select="normalize-space(ParentItem/ID)"></xsl:with-param>
                <xsl:with-param name="UpperSiblingID" select="normalize-space(Item/UpperSiblingID)"></xsl:with-param>
                <xsl:with-param name="LowerSiblingID" select="normalize-space(Item/LowerSiblingID)"></xsl:with-param>

                <xsl:with-param name="Mode">
                    <xsl:choose>
                        <xsl:when test="../../Notifications/Mode = 'EmailDigest'">
                            <xsl:value-of select="../../Notifications/Mode"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:text>WhatsNew</xsl:text>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:with-param>

                <xsl:with-param name="PermissionID" select="normalize-space(Item/PermissionID)"></xsl:with-param>
                <xsl:with-param name="LeftDays" select="normalize-space(Item/LeftDays)"></xsl:with-param>
                <xsl:with-param name="DueDate" select="normalize-space(Item/DueDate)"></xsl:with-param>
                <xsl:with-param name="Responsible" select="normalize-space(Item/Responsible)"></xsl:with-param>

                <xsl:with-param name="TotalCount" select="normalize-space(Item/TotalCount)"></xsl:with-param>
                <xsl:with-param name="TotalChildCount" select="normalize-space(Item/TotalChildCount)"></xsl:with-param>
                <xsl:with-param name="Completed" select="normalize-space(Item/Completed)"></xsl:with-param>
                <xsl:with-param name="PastDueCount" select="normalize-space(Item/PastDueCount)"></xsl:with-param>
                <xsl:with-param name="Name" select="normalize-space(Item/Name)"></xsl:with-param>
                <xsl:with-param name="TypeID" select="normalize-space(Item/TypeID)"></xsl:with-param>
                <xsl:with-param name="ItemDivPrefix" select ="normalize-space($ItemDivPrefix)"></xsl:with-param>

                <xsl:with-param name="RefItemTypeID" select="normalize-space(RefItemTypeID)"/>
                <xsl:with-param name="RefItemID" select="normalize-space(RefItemID)"/>
            </xsl:call-template>
        </div>
    </xsl:template>

    <xsl:template name ="groupByVariables">
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Days"
               name="div_Notification_{normalize-space(ID)}_Days"
               value="{round(normalize-space(CreatedMinutes) div 1440)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Actor_FirstName"
               value="{normalize-space(Actor/FirstName)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Actor_LastName"
               value="{normalize-space(Actor/LastName)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Actor_ID"
               value="{normalize-space(Actor/ID)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Type_ID"
               value="{normalize-space(Item/TypeID)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Goal_ID"
               value="{normalize-space(PrimaryItem/ID)}"></input>
        <input type="hidden" id="div_Notification_{normalize-space(ID)}_Goal_Name"
               value="{normalize-space(PrimaryItem/Name)}"></input>
    </xsl:template>

    <xsl:template name ="EventLoginfo">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px;">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;">
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Dispatcher Info
                    </span>
                </b>

            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px">
                <table  width="90%">
                    <tr>
                        <td>
                            <!--<span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif"
                     class="onMouseOver"></img>
              </span>&#xa0;-->
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <b>
                                        <xsl:value-of select="Item/Name"/>
                                    </b>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name="EventLogEmailDispatcherInfo">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"></xsl:variable>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div style="padding-top:5px;padding-Bottom:5px;">
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Dispatcher Info
                    </span>
                </b>

            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;">
                <!--<span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
					<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" class="onMouseOver"></img>
				</span>&#xa0;-->
                <table width="90%">
                    <tr>
                        <td>
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="EventLogEmailDispatcherError">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div style="padding-top:5px;padding-Bottom:5px;" >
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Dispatcher Error
                    </span>
                </b>

            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; font-size: 10pt; vertical-align: top; 
                 margin-bottom:5px; padding:10px;width:80%;">
                <!--<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" class="onMouseOver"></img>-->
                <table width="90%">
                    <tr>
                        <td>
                            <span style="DISPLAY: inline-block; WIDTH: 450px; overflow: hidden; 
                                  font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name" disable-output-escaping="yes"/>
                                </font>
                            </span>
                            &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>


    <xsl:template name="EventLogEmailCreaterInfo">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"></xsl:variable>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div style="padding-top:5px;padding-Bottom:5px;">
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Creator Info
                    </span>
                </b>

            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;">
                <!--<span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
					<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" class="onMouseOver"></img>
				</span>&#xa0;-->
                <table width="90%">
                    <tr>
                        <td>
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>
    <!--/////////////////////////////////////////-->

    <!--<xsl:template name ="EventLogEmailCreaterInfo">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;">
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Creator Info
                    </span>
                </b>

            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;">

                -->
    <!--<span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
					<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" 
                    class="onMouseOver"></img>
				</span>&#xa0;-->
    <!--
                <table width="90%">
                    <tr>
                        <td>
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>-->

    <xsl:template name ="EventLogEmailCreaterError">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;" >
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Email Creator Error
                    </span>
                </b>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;" >
                <!--<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" 
                class="onMouseOver"></img>-->
                <table  width="90%">
                    <tr>
                        <td>

                            <span style="DISPLAY: inline-block; WIDTH: 450px; overflow: hidden; 
                                  font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name" disable-output-escaping="yes"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>

                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="EventLogSubmittedSurvey">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;" >
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Worksheet
                    </span>
                </b>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;" >
                <!--<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" 
                class="onMouseOver"></img>-->
                <table  width="90%">
                    <tr>
                        <td>

                            <span style="DISPLAY: inline-block; WIDTH: 450px; overflow: hidden; 
                                  font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name" disable-output-escaping="yes"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>

                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="EventLogCustomized">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <div id="div_Notification_{normalize-space(ID)}">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;" >
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        <xsl:value-of select="Item/Subject" disable-output-escaping="yes"/>
                    </span>
                </b>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;" >
                <!--<img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Exclamation.gif" 
                class="onMouseOver"></img>-->
                <table  width="90%">
                    <tr>
                        <td>

                            <span style="DISPLAY: inline-block; WIDTH: 450px; overflow: hidden; 
                                  font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <xsl:value-of select="Item/Name" disable-output-escaping="yes"/>
                                </font>
                                &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                            </span>

                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>


    <xsl:template name ="EventLogAddComment">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName"></xsl:variable>

        <div id="div_Notification_{normalize-space(ID)}">
            <xsl:call-template name="groupByVariables"></xsl:call-template>

            <div style="padding-top:5px;padding-Bottom:5px;">
                <b>
                    <xsl:if test ="$Mode != 'EmailDigest'">
                        <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                            <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                                 class="onMouseOver"></img>
                        </span>
                    </xsl:if>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt; font-weight: bold;	color: #17375E;">
                        Comment Added
                    </span>
                </b>
            </div>
            <div id="div_Notification_{normalize-space(ID)}_Summary"
                 style="background-color: #F2F2F2; border: 1px dashed #D9D9D9; font-family: Calibri, Verdana, Arial; 
                        font-size: 10pt; vertical-align: top; margin-bottom:5px; padding:10px; width: 80%;" >
                <table  width="90%">
                    <tr>
                        <td>


                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <b>
                                        <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                                        <xsl:value-of select="normalize-space(Actor/LastName)"/>&#xa0;
                                    </b>
                                </font>
                                added a Comment under the
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 22">
                                    <a target="_blank" href="{normalize-space($HostName)}Publication.aspx?ID={normalize-space(PrimaryItem/ID)}">
                                        <font color="#17375E">
                                            <b class='onMouseOver'>
                                                <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                            </b>
                                        </font>
                                    </a>
                                </xsl:if>
                                <xsl:if test="normalize-space(ParentItem/TypeID) = 19">
                                    <a target="_blank" href="{normalize-space($HostName)}Content.aspx?ID={normalize-space(ParentItem/ID)}">
                                        <font color="#17375E">

                                            <b class='onMouseOver'>
                                                <xsl:value-of select="normalize-space(ParentItem/Name)"/>
                                            </b>
                                        </font>
                                    </a>
                                </xsl:if>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg" ></img>
        </div>
    </xsl:template>

    <xsl:template name ="ResponseAdded">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    added a Response in
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <font color="#17375E">
                            <b>
                                <a href="{normalize-space($HostName)}ClientPortal.aspx?ID={normalize-space(Item/ID)}"
                                   target="_blank">
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </a>&#xa0;
                            </b>
                        </font>
                    </span>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id="div_Notification_Responses_add"
                style="margin-left:50px; margin-top:5px;margin-right:15px;">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_SavedResponseNotification_Subject_add_{normalize-space(ID)}" class="link" name="collapsed" style="margin-left:5px;
                                 background-color: rgb(242, 242, 242); 
                                 border: 1px dashed rgb(217, 217, 217); font-family: Calibri, Verdana, Arial; font-size: 10pt; vertical-align: top;"
                                 onclick="notifications_ExpandDetail('div_SavedResponseNotification_Subject_add_{normalize-space(ID)}');">
                                <itemExpansionStatus id="div_SavedResponseNotification_Subject_add_{normalize-space(ID)}_expansionStatus" status="collapsed"></itemExpansionStatus>
                                <b>
                                    <xsl:value-of select ="CRMResponse/Subject"/>
                                </b>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_SavedResponseNotification_Subject_add_{normalize-space(ID)}_body" style="display:none;margin-left:5px;
                                 background-color: rgb(242, 242, 242); 
                                 border: 1px dashed rgb(217, 217, 217); font-family: Calibri, Verdana, Arial; font-size: 10pt; vertical-align: top;">
                                <xsl:value-of select ="CRMResponse/Body" disable-output-escaping ="yes"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <xsl:if test="CRMResponse/Approved !='Approved'">
                <div align="left" style="margin-left : 25px; margin-top: 5px;">
                    <input id="txt_Response_approved_add" value="Approve" type="button" class="button"
                           runat="server"
                           onClick="clientPortal_ApproveResponse('{normalize-space(CRMResponse/ID)}','{normalize-space(ID)}',
                       'div_Notification_{normalize-space(ID)}',
                       '{normalize-space(Item/ID)}','Approved');"></input>

                </div>
            </xsl:if>
            <!--<div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                 style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>-->
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg"
                  style="margin-top: 5px;"></img>
        </div>
    </xsl:template>

    <xsl:template name ="ResponseUpdated">
        <xsl:variable name ="TemplatePathURL" select ="normalize-space(../../Notifications/TemplateURL)"/>
        <xsl:variable name="Mode" select ="normalize-space(../../Notifications/Mode)"/>
        <xsl:variable name ="HostName">
            <xsl:choose>
                <xsl:when test="count(../../Notifications/HostName) != 0">
                    <xsl:value-of select="normalize-space(../../Notifications/HostName)"/>
                    <xsl:text>/</xsl:text>
                </xsl:when>
                <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div id="div_Notification_{normalize-space(ID)}" style="margin-top:10px">
            <xsl:call-template name="groupByVariables"></xsl:call-template>
            <div id="div_Notification_{normalize-space(ID)}_Summary">
                <xsl:if test ="$Mode != 'EmailDigest'">
                    <span onClick='return notifications_Delete("{normalize-space(ID)}",
                               "div_Notification_{normalize-space(ID)}");'>
                        <img src="{$TemplatePathURL}Web/Icons/Delete%203/32%20Bit%20Alpha%20png/Delete%203%2016%20n%20p.png"
                             class="onMouseOver"></img>
                    </span>&#xa0;
                </xsl:if>
                <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                            <xsl:value-of select="normalize-space(Actor/LastName)"/>
                        </b>
                    </font>
                    updated a Response in
                    <span style="font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                        <font color="#17375E">
                            <b>
                                <a href="{normalize-space($HostName)}ClientPortal.aspx?ID={normalize-space(Item/ID)}"
                                   target="_blank">
                                    <xsl:value-of select="normalize-space(Item/Name)"/>
                                </a>&#xa0;
                            </b>
                        </font>
                    </span>
                    &#xa0;<xsl:call-template name="TimeStamp"></xsl:call-template>
                </span>
            </div>
            <div id="div_Notification_Responses_update"
                style="margin-left:50px; margin-top:5px;margin-right:15px;">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_SavedResponseNotification_Subject_update_{normalize-space(ID)}" style="margin-left:5px;
                                 background-color: rgb(242, 242, 242); 
                                 border: 1px dashed rgb(217, 217, 217); font-family: Calibri, Verdana, Arial; font-size: 10pt; vertical-align: top;"
                                 onclick="notifications_ExpandDetail('div_SavedResponseNotification_Subject_update_{normalize-space(ID)}');"
                                  name="collapsed" class="link">
                                <itemExpansionStatus id="div_SavedResponseNotification_Subject_update_{normalize-space(ID)}_expansionStatus" status="collapsed"></itemExpansionStatus>
                                <b>
                                    <xsl:value-of select ="CRMResponse/Subject"/>
                                </b>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_SavedResponseNotification_Subject_update_{normalize-space(ID)}_body" style="display:none;margin-left:5px;
                                 background-color: rgb(242, 242, 242); 
                                 border: 1px dashed rgb(217, 217, 217); font-family: Calibri, Verdana, Arial; font-size: 10pt; vertical-align: top;">
                                <xsl:value-of select ="CRMResponse/Body" disable-output-escaping ="yes"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <xsl:if test="CRMResponse/Approved !='Approved'">
                <div align="left" style="margin-left : 25px; margin-top: 5px;">
                    <input id="txt_Response_approved_update" value="Approve" type="button" class="button"
                           runat="server"
                           onClick="clientPortal_ApproveResponse('{normalize-space(CRMResponse/ID)}','{normalize-space(ID)}',
                       'div_Notification_{normalize-space(ID)}',
                       '{normalize-space(Item/ID)}','Approved');"></input>
                </div>
            </xsl:if>
            <!--<div id ="div_Notification_{normalize-space(ID)}_Item_{normalize-space(Item/ID)}"
                style="margin-left:50px; margin-top:3px; margin-bottom:5px;">
                <div id="div_Item_{normalize-space(ID)}_Opertion_Parent">
                    <div id="div_Item_{normalize-space(ID)}_Operation"></div>
                </div>
            </div>-->
            <img  id="div_Notification_{normalize-space(ID)}_seperator_image"
                  src="{$TemplatePathURL}Web/Images/seperator.jpg"
                  style="margin-top: 5px;"></img>
        </div>
    </xsl:template>


</xsl:stylesheet>