﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:variable name="TargetURL">
        <xsl:choose>
            <xsl:when test="EmailNotifications/MasterBrandDomainURL">
                <xsl:value-of select="EmailNotifications/MasterBrandDomainURL"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text>https://www.coachsimple.net</xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="TypeID">
        <xsl:value-of select="EmailNotifications/TypeID"/>
    </xsl:variable>

    <xsl:variable name="MasterBrandDomainName">
        <xsl:choose>
            <xsl:when test="EmailNotifications/MasterBrandDomain">
                <xsl:value-of select="EmailNotifications/MasterBrandDomain"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text>LifeSpace</xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>

    <xsl:template match="/">
        <xsl:variable name="NotificationTypeID" select="EmailNotifications/NotificationTypeID"/>
        <xsl:variable name="GoalType" select="Emailnotifications/GoalType"></xsl:variable>
        <xsl:variable name="CommPromoteKey" select="EmailNotifications/CommPromoteKey"></xsl:variable>
        <xsl:variable name="TransactionStatus" select="EmailNotifications/TransactionStatus"></xsl:variable>
        <xsl:variable name="ItemName" select="EmailNotifications/ItemName"></xsl:variable>
        <xsl:variable name="TransactionID" select="EmailNotifications/TransactionID"></xsl:variable>
        <xsl:variable name="SubscriptionID" select="EmailNotifications/SubscriptionID"></xsl:variable>
        <xsl:variable name="Amount" select="EmailNotifications/Amount"></xsl:variable>
        <xsl:variable name="TransactionDate" select="EmailNotifications/TransactionDate"></xsl:variable>
        <xsl:variable name="PackageName" select="EmailNotifications/Package"></xsl:variable>
        <xsl:variable name="TransactionMessage" select="EmailNotifications/TransactionMessage"></xsl:variable>
        <xsl:variable name="FirstName" select="EmailNotifications/FirstName"></xsl:variable>
        <xsl:variable name="LastName" select="EmailNotifications/LastName"></xsl:variable>
        <xsl:variable name="Address" select="EmailNotifications/MailingStreet"></xsl:variable>
        <xsl:variable name="City" select="EmailNotifications/MailingCity"></xsl:variable>
        <xsl:variable name="State" select="EmailNotifications/MailingState"></xsl:variable>
        <xsl:variable name="Postal" select="EmailNotifications/MailingPostalCode"></xsl:variable>
        <xsl:variable name="GoalOwnerID" select="EmailNotifications/GoalOwnerID"></xsl:variable>
        <xsl:variable name="GoalOwnerName" select="EmailNotifications/GoalOwnerName"></xsl:variable>
        <xsl:variable name="UserID" select="EmailNotifications/UserID"></xsl:variable>
        <xsl:variable name="GoalOpenPage">
            <xsl:choose>
                <xsl:when test="$GoalType = 2">
                    <xsl:text>Challenge</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>Goal</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="NotificationLogoURLPath">
            <xsl:choose>
                <xsl:when test="EmailNotifications/SettingsXML">
                    <xsl:value-of select="EmailNotifications/SettingsXML/Setting[SettingKey = 'NotificationLogoURLPath']/SettingValue"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/logo.png</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="NotificationHeaderColor">
            <xsl:choose>
                <xsl:when test="EmailNotifications/SettingsXML">
                    <xsl:value-of select="EmailNotifications/SettingsXML/Setting[SettingKey = 'NotificationHeaderColor']/SettingValue"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>#3F3F41</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="NotificationHeaderCornerLeft">
            <xsl:choose>
                <xsl:when test="EmailNotifications/SettingsXML">
                    <xsl:value-of select="EmailNotifications/SettingsXML/Setting[SettingKey = 'NotificationRoundCornerLeft']/SettingValue"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/LtTop.png</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="NotificationHeaderCornerRight">
            <xsl:choose>
                <xsl:when test="EmailNotifications/SettingsXML">
                    <xsl:value-of select="EmailNotifications/SettingsXML/Setting[SettingKey = 'NotificationRoundCornerRight']/SettingValue"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/RtTop.png</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="NotificationSenderName">
            <xsl:choose>
                <xsl:when test="EmailNotifications/SettingsXML">
                    <xsl:value-of select="EmailNotifications/SettingsXML/Setting[SettingKey = 'NotificationSenderName']/SettingValue"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>LifeSpace</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>


        <html>
            <head>
            </head>
            <body>
                <table width="100%" cellspacing="0" cellpadding="0" style="width: 100.0%; background: #f2f2f2;padding-bottom:10.5pt;padding-top:10.5pt;">
                    <tbody>
                        <tr>
                            <td valign="top" style="padding: 0in 0in 0in 0in; min-height: 10px">
                                <div align="center">
                                    <table width="600" cellspacing="0" cellpadding="0" border="0" style="width: 6.25in;background: {$NotificationHeaderColor}">
                                        <tbody>
                                            <tr style="min-height: 7.5pt">
                                                <td width="25" valign="top" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt">
                                                    <p style="line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <img width="10" height="10" border="0" src="{$NotificationHeaderCornerLeft}" />
                                                            <u></u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                                <td style="padding: 0in 0in 0in 0in; min-height: 7.5pt">
                                                    <p style="line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <u></u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                                <td width="25" valign="top" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt;min-height: 10px">
                                                    <p align="right" style="text-align: right; line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <img width="10" height="10" border="0" src="{$NotificationHeaderCornerRight}" />
                                                            <u></u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="padding: 0in 0in 0in 0in">
                                                </td>
                                                <td style="padding: 0in 0in 0in 0in">
                                                    <table width="100%" cellspacing="0" cellpadding="0" border="0" style="width: 100.0%">
                                                        <tbody>
                                                            <tr>
                                                                <td style="padding: 0in 0in 0in 0in">
                                                                    <p style="margin:0;">
                                                                        <img width="143" height="32" border="0" alt="{$NotificationSenderName}" src="{$NotificationLogoURLPath}" />
                                                                        <u></u>
                                                                        <u></u>
                                                                    </p>
                                                                </td>
                                                                <td style="padding: 0in 0in 0in 0in">
                                                                    <div>
                                                                        <div align="right">
                                                                            <table cellspacing="0" cellpadding="0" border="0">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td style="padding: 0in 3.75pt 0in 0in">
                                                                                            <div>
                                                                                                <p align="right" style="text-align: right;margin:0;font-size:12.5pt;">
                                                                                                    <b>
                                                                                                        <span style="color: white;">

                                                                                                        </span>
                                                                                                    </b>
                                                                                                    <u></u>
                                                                                                    <u></u>
                                                                                                </p>
                                                                                            </div>
                                                                                            <div>
                                                                                                <p align="right" style="text-align: right;margin:0;">
                                                                                                    <span style="color: #b5bbc2">

                                                                                                        <u></u>
                                                                                                        <u></u>
                                                                                                    </span>
                                                                                                </p>
                                                                                            </div>
                                                                                        </td>
                                                                                        <td style="padding: 0in 0in 0in 0in">
                                                                                            <p style="line-height: 45.0pt;margin:0;">
                                                                                                <span style="font-size: 45.0pt; color: white">

                                                                                                    <u> </u>
                                                                                                    <u></u>
                                                                                                </span>
                                                                                            </p>
                                                                                        </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                                <td style="padding: 0in 0in 0in 0in">
                                                </td>
                                            </tr>
                                            <tr style="min-height: 7.5pt">
                                                <td width="25" valign="bottom" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt;min-height: 10px">
                                                    <p style="line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <u> </u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                                <td style="padding: 0in 0in 0in 0in; min-height: 7.5pt">
                                                    <p style="line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <u> </u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                                <td width="25" valign="bottom" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt;min-height: 10px">
                                                    <p align="right" style="text-align: right; line-height: 0%;margin:0;">
                                                        <span style="font-size: 1.0pt">
                                                            <u> </u>
                                                            <u></u>
                                                        </span>
                                                    </p>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <p align="center" style="text-align: center;margin:0;">
                                    <u></u>
                                    <u> </u>
                                </p>
                                <div align="center">
                                    <table width="600" cellspacing="0" cellpadding="0" border="0" style="width: 6.25in;background: #D2D3D4">
                                        <tbody>
                                            <tr>
                                                <td style="padding: 0in 0in 0in 0in; min-height: 10px">
                                                    <table width="100%" cellspacing="0" cellpadding="0" border="1" style="width: 100.0%;
															background: white; border-top: none; border-left: solid #e4e4e4 1.0pt; border-bottom: none;border-right: solid #e4e4e4 1.0pt">
                                                        <tbody>
                                                            <tr style="min-height: 7.5pt">
                                                                <td width="10" valign="top" style="width: 7.5pt; border: none; padding: 0in 0in 0in 0in;
														min-height: 7.5pt">
                                                                    <p style="line-height: 0%;margin:0;">
                                                                        <span style="font-size: 1.0pt">
                                                                            <u> </u>
                                                                            <u></u>
                                                                        </span>
                                                                    </p>
                                                                </td>
                                                                <td style="border: none; padding: 0in 0in 0in 0in; min-height: 7.5pt; min-height: 10px">
                                                                    <p style="line-height: 0%;margin:0;">
                                                                        <span style="font-size: 1.0pt">
                                                                            <u> </u>
                                                                            <u></u>
                                                                        </span>
                                                                    </p>
                                                                </td>
                                                                <td width="10" valign="top" style="width: 7.5pt; border: none; padding: 0in 0in 0in 0in;min-height: 7.5pt; min-height: 10px">
                                                                    <p align="right" style="text-align: right; line-height: 0%;margin:0;">
                                                                        <span style="font-size: 1.0pt">
                                                                            <u> </u>
                                                                            <u></u>
                                                                        </span>
                                                                    </p>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        <!--</tbody>
                </table>-->





                        <!--<div id="divEmailDigest_Container" style="margin-left:3%;z-index: 1; background-color: #FFFFFF;" align="center">
                    <div style="padding-top: 10px; margin-bottom: 20px;">
                        <table  cellpadding="0" border="0" cellspacing="0">-->
                        <tr>
                            <td>
                                <table width="600" cellspacing="0" cellpadding="0" style="width: 100.0%;">
                                    <tbody>
                                        <tr>
                                            <td>
                                                <div align="center">
                                                    <table width="600" cellspacing="0" cellpadding="0" border="0" style="width: 6.25in;background:#ffffff;">
                                                        <tbody>
                                                            <tr>
                                                                <td style="padding: 0.3in 1.0pt 10.0pt 0.2in;">
                                                                    <span style="font-size: 10.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                                                                        <!--<span  align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">-->
                                                                        <xsl:choose>
                                                                            <xsl:when test ="normalize-space($NotificationTypeID)= 40">
                                                                                Hi <xsl:value-of select ="EmailNotifications/UserName"/>,
                                                                            </xsl:when>
                                                                            <xsl:otherwise>
                                                                                Dear <xsl:value-of select ="EmailNotifications/UserName"/>,
                                                                            </xsl:otherwise>
                                                                        </xsl:choose>
                                                                    </span>
                                                                </td>
                                                            </tr>
                                                            <tr height="5"></tr>
                                                            <tr>
                                                                <td style="padding: 0in 1.0pt 10.0pt 0.2in;">
                                                                    <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 49">
                                                                            <xsl:call-template name="ChallengeAdded"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 2">
                                                                            <xsl:call-template name="GoalChanged"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 3">
                                                                            <xsl:call-template name="GoalCompleted"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 4">
                                                                            <xsl:call-template name="ActionCreated">
                                                                                <xsl:with-param name="TypeID" select="$TypeID"></xsl:with-param>

                                                                            </xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 5">
                                                                            <xsl:call-template name="ActionChanged"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 6">
                                                                            <xsl:call-template name="ActionCompleted"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 7">
                                                                            <xsl:call-template name="NoteCreated"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 8">
                                                                            <xsl:call-template name="NoteChanged"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 12 or
                                                                                        normalize-space($NotificationTypeID)= 1">
                                                                            <xsl:call-template name="SecureItMemberAdded">
                                                                                <xsl:with-param name="GoalType" select="$GoalType"></xsl:with-param>
                                                                                <xsl:with-param name="GoalOpenPage" select="$GoalOpenPage"></xsl:with-param>
                                                                            </xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 13">
                                                                            <xsl:call-template name="SecureItMemberRightUpdated"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 14">
                                                                            <xsl:call-template name="UserRegistered"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 15">
                                                                            <xsl:call-template name="AccountActivated"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 16">
                                                                            <xsl:call-template name="ActionAssigned"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 17">
                                                                            <xsl:call-template name="RelationshipRequest"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 18">
                                                                            <xsl:call-template name="RelationshipRequestConfirmed"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 26">
                                                                            <xsl:call-template name="DiscussionAddedUser"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 21">
                                                                            <xsl:call-template name="DiscussionAddedActive"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 22">
                                                                            <xsl:call-template name="CommentsAddedinDiscussion"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 35">
                                                                            <xsl:call-template name="IsUnauthorizedUser"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 36">
                                                                            <xsl:call-template name="FollowItUser"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 37">
                                                                            <xsl:call-template name="NewBlogPosts"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 38">
                                                                            <xsl:call-template name="CreateBrand"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 39">
                                                                            <xsl:call-template name="PromoterRegistration"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 40">
                                                                            <xsl:call-template name="BrandReview"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 45">
                                                                            <xsl:call-template name="ResponseAdded"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 46">
                                                                            <xsl:call-template name="ResponseUpdated"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 47">
                                                                            <xsl:call-template name="NoteBookEntryAdded"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 48">
                                                                            <xsl:call-template name="JoinChallenge"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 50">
                                                                            <xsl:call-template name="SurveySubmitted"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 51">
                                                                            <xsl:call-template name="SurveyReturned"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 52">
                                                                            <xsl:call-template name="SurveyReviewed"></xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 54">
                                                                            <xsl:call-template name="CommunityFollower">
                                                                                <xsl:with-param name="CommPromoteKey" select="$CommPromoteKey"></xsl:with-param>
                                                                            </xsl:call-template>
                                                                        </xsl:if>
                                                                        <xsl:if test ="normalize-space($NotificationTypeID)= 56">
                                                                            <xsl:call-template name="BuyPackage">
                                                                                <xsl:with-param name="ItemName" select="$ItemName"></xsl:with-param>
                                                                                <xsl:with-param name="TransactionStatus" select="$TransactionStatus"></xsl:with-param>
                                                                                <xsl:with-param name="TransactionID" select="$TransactionID"></xsl:with-param>
                                                                                <xsl:with-param name="SubscriptionID" select="$SubscriptionID"></xsl:with-param>
                                                                                <xsl:with-param name="Amount" select="$Amount"></xsl:with-param>
                                                                                <xsl:with-param name="TransactionDate" select="$TransactionDate"></xsl:with-param>
                                                                                <xsl:with-param name="PackageName" select="$PackageName"></xsl:with-param>
                                                                                <xsl:with-param name="FirstName" select="$FirstName"></xsl:with-param>
                                                                                <xsl:with-param name="LastName" select="$LastName"></xsl:with-param>
                                                                                <xsl:with-param name="Address" select="$Address"></xsl:with-param>
                                                                                <xsl:with-param name="City" select="$City"></xsl:with-param>
                                                                                <xsl:with-param name="State" select="$State"></xsl:with-param>
                                                                                <xsl:with-param name="Postal" select="$Postal"></xsl:with-param>
                                                                            </xsl:call-template>
                                                                        </xsl:if>
                                                                    </span>
                                                                </td>
                                                            </tr>
                                                            <tr height="5"></tr>
                                                            <td>
                                                                <span>&#xa0;</span>
                                                            </td>
                                                            <tr height="5"></tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </body>
        </html>
    </xsl:template>

    <xsl:template name ="SurveySubmitted">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_FollowIt">
                <span style="font-size: 8.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                    <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                    has submitted
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                    </a>
                    <span>
                        Worksheet in
                    </span>
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">

                        <xsl:choose>
                            <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <span style="text-transform: capitalize;">
                                    <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                </span> : <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                            </xsl:otherwise>
                        </xsl:choose>


                        <!--<xsl:value-of select="EmailNotifications/PrimaryItem"/>-->
                    </a>
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="SurveyReturned">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_FollowIt">
                <span style="font-size: 8.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                    <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                    has requested you change your
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                    </a>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        Worksheet answers.
                    </span>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>


    <xsl:template name ="NoteCreated">

        <xsl:choose>
            <xsl:when test="EmailNotifications/ParentItemType = 22">
                <div id="div_Notification" style="margin-top:10px;">
                    <div id="div_Notification_Summary">
                        <span style="font-size: 8.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                            <span style="text-transform: capitalize;">
                                <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>
                            </span>&#xa0;
                            added a comment to
                            <a href="{$TargetURL}/Publication.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </a>
                        </span>
                    </div>
                    <div id="div_Notification_Notes">
                        <table cellspacing="0" border="0" cellpadding="0" width="100%">
                            <tr>
                                <td style="padding: 0.2in 1.0pt 10.0pt 0.2in;">
                                    <div id="div_Note" style="margin-left:5px; font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                                        <div id="div_Note_View">
                                            <div id="divNote">
                                                <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                    <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div style="margin-top:10px;">
                    <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        <b>Click here to view, reply or discuss:</b>
                        <a href="{$TargetURL}/Publication.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                            <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                        </a>
                    </span>
                </div>
            </xsl:when>
            <xsl:otherwise>

                <div id="div_Notification" style="margin-top:10px;">
                    <div id="div_Notification_Summary">
                        <span style="font-size: 8.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                            <span style="text-transform: capitalize;">
                                <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>
                            </span>&#xa0;
                            added a comment to
                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </a>
                            in
                            <font color="#17375E" style="text-transform: capitalize;">
                                <b>
                                    <xsl:choose>
                                        <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <span style="text-transform: capitalize;">
                                                <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                            </span> : <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </b>
                            </font> <!--:
                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}" target="_blank">
                                <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                            </a>-->
                        </span> Goal
                        <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                            in
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                                </b>
                            </font>
                        </xsl:if>
                    </div>
                    <div id="div_Notification_Notes">
                        <table cellspacing="0" border="0" cellpadding="0" width="100%">
                            <tr>
                                <td style="padding: 0.2in 1.0pt 10.0pt 0.2in;">
                                    <div id="div_Note" style="margin-left:5px; font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                                        <div id="div_Note_View">
                                            <div id="divNote">
                                                <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                    <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div style="margin-top:10px;">
                    <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        <b>Click here to view, reply or discuss:</b>
                        <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                            <!--<xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>-->
                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                        </a>
                    </span>
                </div>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


    <xsl:template name ="BrandReview">
        <xsl:variable name ="Address" select ="normalize-space(EmailNotifications/PrimaryAddress)"></xsl:variable>
        <xsl:variable name ="Phone" select ="normalize-space(EmailNotifications/PrimaryPhone)"></xsl:variable>
        <xsl:variable name ="Logo" select ="normalize-space(EmailNotifications/BrandLogoSmallURL)"></xsl:variable>
        <xsl:variable name ="Website" select ="normalize-space(EmailNotifications/CompanyWebsiteURL)"></xsl:variable>
        <div id="div_Notification" style="margin-top:10px; margin-bottom: 10px;">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    We would like to thank you for your application to setup your Marketplace Community on LifeSpace. We will help you complete the application
                    and get you started using your new community on LifeSpace.
                    <br/><br/>The LifeSpace Marketplace is a growing network of local companies and industry experts, specializing in Fitness, Finance, Relationships, Entertainment, Personal Growth and all other key areas of
                    life that LifeSpace users focus on. We encourage our Marketplace Specialists to build their own custom communities, providing great content and knowledge
                    not only to your own personal networks, but also to the entire LifeSpace universe of users. In other words, if you have knowledge and products to share,
                    we will help you promote it to your communities, our communities and all over the internet, helping you to build your brand following, find new customers
                    and keep existing ones.
                    <br/><br/>Right now the Marketplace is in our beta launch, which means we are reviewing applications and approving them individually. During this beta phase, companies
                    that join us will not be paying any fees to be apart of the Marketplace and will receive extra assistance from our team in setting up your pages graphically
                    as well as assistance with bringing in your great content.
                    <br/><br/>If you have applied for our Marketplace in error, simply reply and let us know. However, if you are interested in taking advantage of our powerful tools and
                    free assistance, please help us continue this process by providing some additional information. You may simply reply to this e-mail with all the information
                    we are requesting below:<br/><br/>
                    <xsl:if test ="$Address = '' or $Phone = '' or $Logo = '' or $Website = ''">
                        <b>
                            We noticed that you are missing some information on your application. Please provide us with the following:
                        </b>
                        <br/>
                        <br/>
                    </xsl:if>
                    <xsl:if test ="$Logo = ''">
                        <b>Brand Logo:</b>
                        <br/>
                    </xsl:if>
                    <xsl:if test ="$Website = ''">
                        <b>Website URL:</b>
                        <br/>
                    </xsl:if>
                    <xsl:if test ="$Address = ''">
                        <b>Primary Address:</b>
                        <br/>
                    </xsl:if>
                    <xsl:if test ="$Phone = ''">
                        <b>Primary Phone:</b>
                        <br/>
                    </xsl:if>
                    <br/>
                    <b>
                        Please answer the following questions:
                        <br/><br/>1. Please describe your areas of expertise and what type of knowledge you would like to share in the LifeSpace Marketplace?
                        <br/><br/>2. How did you hear about the LifeSpace Marketplace? Did a LifeSpace representative invite you to participate or did you
                        find us through LifeSpace or via a search engine?
                        <br/><br/>3. Please describe your current social media marketing strategy and whether you would like to use the LifeSpace
                        Marketplace to enhance this strategy. Or is participating in the Marketplace the beginning of your social media
                        marketing strategy?
                        <br/><br/>4. We can help you setup your pages graphically, can help publish content effectively and will provide marketing
                        assistance to reach existing LifeSpace users and new ones on the internet. We are prepared to make this investment
                        of time and resources to ensure your success at no cost to you. In return, we ask you to devote a few hours to assist
                        us with this setup process, a few hours per month to continue to add fresh content, and a willingness to promote your
                        community to your existing network of friends, customers and prospects. Do you agree that you have the time and interest
                        in building a great community and a desire to promote it to your own contacts and networks?
                    </b><br/><br/>Thank you once again for your participation in the LifeSpace Marketplace. We are excited to add your expertise to our knowledge
                    base and look forward to helping you expand your business and build your social following using our powerful platform.
                    <br/><br/>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>To view your Marketplace page:</b>
                <a href="{$TargetURL}/{normalize-space(EmailNotifications/BrandKey)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/<xsl:value-of select ="EmailNotifications/BrandKey"/>
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>To change your settings:</b>
                <a href="{$TargetURL}/Settings.aspx" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Settings.aspx
                </a>
            </span>
        </div>
        <div style="margin-top:20px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                --<br/>
                LifeSpace<br/>
                Dream It! Plan It! Do It! Track It!<br/>
                <a href="{$TargetURL}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>
                </a><br/>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="PromoterRegistration">
        <div id="div_Notification" style="margin-top:10px; margin-bottom: 10px;">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>
                            &#xa0;
                        </b>
                    </font>has aplied to be a Promoter.
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Promoter Admin page:</b>
                <a href="{$TargetURL}/PromoterAdmin.aspx" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/PromoterAdmin.aspx
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <xsl:choose>
                    <xsl:when test="contains($TargetURL, 'lifespace')">
                        <b>Open LifeSpace:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'vaco')">
                        <b>Open Vaco.me:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'happiness')">
                        <b>Open Happiness:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'partypongclub')">
                        <b>Open PartyPong:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'dragonkick')">
                        <b>Open DragonKick:</b>
                    </xsl:when>
                </xsl:choose>
                <a href="{$TargetURL}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="NewBlogPosts">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/AuthorDisplayName)"/>
                        </b>
                    </font>
                    posted a new blog post
                </span>
            </div>
            <div id="div_Notification_Sumamry"
                 style="margin-top:10px;">
                <table cellspacing="0" border="0" cellpadding="0">
                    <tr>
                        <td>
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                                <font color="#17375E">
                                    <b>
                                        <a href="{$TargetURL}/Publication.aspx?ID={normalize-space(EmailNotifications/ItemID)}&amp;Ref=EM.Not">
                                            <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                        </a>&#xa0;
                                    </b>
                                </font>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Publication">
                                <p id="lbl_itemSummary" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt;" wrap="true">
                                    <xsl:value-of select ="EmailNotifications/PublicationSummary"/>
                                </p>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Alter Communities I follow:</b>
                <a href="{$TargetURL}/CommunityWizard.aspx" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/CommunityWizard.aspx
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Alter My Notification Settings:</b>
                <a href="{$TargetURL}/Settings.aspx" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Settings.aspx
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <xsl:choose>
                    <xsl:when test="contains($TargetURL, 'lifespace')">
                        <b>Open LifeSpace:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'vaco')">
                        <b>Open Vaco.me:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'happiness')">
                        <b>Open Happiness:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'partypongclub')">
                        <b>Open PartyPong:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'dragonkick')">
                        <b>Open DragonKick:</b>
                    </xsl:when>
                    <xsl:otherwise>
                        <b>
                            Open <xsl:value-of select="$MasterBrandDomainName"/>:
                        </b>
                    </xsl:otherwise>
                </xsl:choose>
                <a href="{$TargetURL}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="CreateBrand">
        <xsl:variable name ="Type" select ="normalize-space(EmailNotifications/BrandCategory)"></xsl:variable>
        <xsl:variable name ="Name" select ="normalize-space(EmailNotifications/BrandKey)"></xsl:variable>
        <xsl:variable name ="Description" select ="normalize-space(EmailNotifications/BrandDescription)"></xsl:variable>
        <xsl:variable name ="Email" select ="normalize-space(EmailNotifications/BrandCompanyEmail)"></xsl:variable>
        <xsl:variable name ="LogoURL" select ="normalize-space(EmailNotifications/BrandLogoSmallURL)"></xsl:variable>
        <xsl:variable name ="Website" select ="normalize-space(EmailNotifications/CompanyWebsiteURL)"></xsl:variable>
        <xsl:variable name ="CouponCode" select ="normalize-space(EmailNotifications/BrandCouponCode)"></xsl:variable>
        <xsl:variable name ="PublicYN" select ="normalize-space(EmailNotifications/BrandPublicYN)"></xsl:variable>

        <xsl:variable name ="Address1" select="normalize-space(EmailNotifications/PrimaryAddress)"></xsl:variable>
        <xsl:variable name ="Address2" select="normalize-space(EmailNotifications/Address2)"></xsl:variable>
        <xsl:variable name ="Address3" select="normalize-space(EmailNotifications/Address3)"></xsl:variable>
        <xsl:variable name ="City" select="normalize-space(EmailNotifications/City)"></xsl:variable>
        <xsl:variable name ="State" select="normalize-space(EmailNotifications/State)"></xsl:variable>
        <xsl:variable name ="PostalCode" select="normalize-space(EmailNotifications/PostalCode)"></xsl:variable>
        <xsl:variable name ="Country" select="normalize-space(EmailNotifications/Country)"></xsl:variable>
        <xsl:variable name ="PhoneMain" select="normalize-space(EmailNotifications/PrimaryPhone)"></xsl:variable>
        <xsl:variable name ="OwnerName" select="normalize-space(EmailNotifications/BrandOwnerName)"></xsl:variable>
        <xsl:variable name ="OwnerEmailID" select="normalize-space(EmailNotifications/BrandOwnerEmail)"></xsl:variable>

        <div id="div_Notification" style="margin-top:10px; margin-bottom: 10px;">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <a href="{$TargetURL}/{normalize-space(EmailNotifications/BrandKey)}">
                                <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                            </a>&#xa0;
                        </b>
                    </font>has setup their brand.
                </span>
            </div>
        </div>
        <div id="div_BrandDetail" style="margin-top:10px; margin-bottom: 10px;">
            <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Band Key:&#xa0;</b>
                <xsl:value-of select ="$Name"/>
                <br/>
                <b>Brand Coupon Code:&#xa0;</b>
                <xsl:value-of select ="$CouponCode"/>
                <br/>
                <b>Type:&#xa0;</b>
                <xsl:value-of select ="$Type"/>
                <br/>
                <b>Description:&#xa0;</b>
                <xsl:value-of select ="$Description"/>
                <br/>
                <xsl:if test ="$PublicYN = 1">
                    <b>Public:&#xa0;</b>Yes
                    <br/>
                </xsl:if>
                <xsl:if test ="$PublicYN = 0">
                    <b>Public:&#xa0;</b>No
                    <br/>
                </xsl:if>
                <b>Logo URL:&#xa0;</b>
                <xsl:value-of select ="$LogoURL"/>
                <br/>
                <b>Website:&#xa0;</b>
                <xsl:value-of select ="$Website"/>
                <br/>
                <b>Email:&#xa0;</b>
                <xsl:value-of select ="$Email"/>
                <br/>

                <b>Address1:&#xa0;</b>
                <xsl:value-of select ="$Address1"/>
                <br/>
                <b>Address2:&#xa0;</b>
                <xsl:value-of select ="$Address2"/>
                <br/>
                <b>City, State Zip:&#xa0;</b>
                <xsl:value-of select ="$City"/>,&#xa0;<xsl:value-of select ="$State"/>&#xa0;<xsl:value-of select ="$PostalCode"/>
                <br/>
                <b>Country:&#xa0;</b>
                <xsl:value-of select ="$Country"/>
                <br/>
                <b>Phone:&#xa0;</b>
                <xsl:value-of select ="$PhoneMain"/>
                <br/>
                <b>Owner's Name:&#xa0;</b>
                <xsl:value-of select ="$OwnerName"/>
                <br/>
                <b>Owner's EmailID:&#xa0;</b>
                <xsl:value-of select ="$OwnerEmailID"/>
                <br/>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>View application:</b>
                <a href="{$TargetURL}/CreateBrand.aspx?ID={normalize-space(EmailNotifications/BrandID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/CreateBrand.aspx?ID=<xsl:value-of select="EmailNotifications/BrandID"/>
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Brand Page:</b>
                <a href="{$TargetURL}/{normalize-space(EmailNotifications/BrandKey)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/<xsl:value-of select ="EmailNotifications/BrandKey"/>
                </a>
            </span>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <xsl:choose>
                    <xsl:when test="contains($TargetURL, 'lifespace')">
                        <b>Open LifeSpace:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'vaco')">
                        <b>Open Vaco.me:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'happiness')">
                        <b>Open Happiness:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'partypongclub')">
                        <b>Open PartyPong:</b>
                    </xsl:when>
                    <xsl:when test="contains($TargetURL, 'dragonkick')">
                        <b>Open DragonKick:</b>
                    </xsl:when>
                </xsl:choose>
                <a href="{$TargetURL}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="FollowItUser">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_FollowIt">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    is now following the
                    <a href="{$TargetURL}/Community.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                            </b>
                        </font>
                    </a>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        Community
                    </span>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Community.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Community.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>


    <xsl:template name ="SurveyReviewed">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_FollowIt">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    has reviewed
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                            </b>
                        </font>
                    </a>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        Worksheet.
                    </span>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>












    <xsl:template name ="JoinChallenge">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_FollowIt">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    has joined the
                    <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                            </b>
                        </font>
                    </a>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        Challenge
                    </span>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Challenge.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="CommentsAddedinDiscussion">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added a new
                    <font color="#17375E">
                        <b>
                            Comment
                        </b>
                    </font> on the <font color="#17375E">
                        <b>
                            <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}">
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </a>&#xa0;
                        </b>
                    </font>
                    <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                        Discussion
                    </span>
                </span>
            </div>
            <div id="div_Notification_Discussion"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Comments" 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;">
                                <div id="div_Note_View">
                                    <div id="divComments" style="border-bottom: 1px solid #BCBCBC;	padding-bottom: 2px; margin-bottom: 5px;">
                                        <div>
                                            <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>To Reply, Comment or View Discussion:</b>
                <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Discussion.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ParentItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="IsUnauthorizedUser">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                            (<xsl:value-of select="normalize-space(EmailNotifications/ActorEmail)"/>)
                        </b>
                    </font>
                    has made
                    <font color="#17375E">
                        <b>
                            5+ unauthorized
                        </b>
                    </font> item views today
                </span>
            </div>
        </div>
    </xsl:template>

    <xsl:template name ="NoteBookEntryAdded">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_NoteBook">
                <span style="font-size: 8.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
                    <span style="text-transform: capitalize;">
                        <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                    </span>
                    added a new Note to
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:choose>
                            <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <span style="text-transform: capitalize;">
                                    <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                </span> : <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </xsl:otherwise>
                        </xsl:choose>


                        <!--<xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>-->
                    </a>&#xa0;

                    <xsl:if test ="EmailNotifications/ParentItemType = 5">
                        Goal
                    </xsl:if>
                    <xsl:if test ="EmailNotifications/ParentItemType = 18">
                        Community
                    </xsl:if>
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#6D6E71">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <div id="div_Notification_NoteBook">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td style="padding: 0.2in 1.0pt 10.0pt 0.2in;">
                            <div id="div_Note" style="margin-left:5px; font-family: Calibri, Verdana, Arial; font-size: 10pt;">
                                <div id="div_Note_View">
                                    <div id="divNote">
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                            <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Click here to view, reply or discuss:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <!--<xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>-->
                    <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                </a>
            </span>
            <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                in
                <font color="#17375E">
                    <b>
                        <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                    </b>
                </font>
            </xsl:if>
        </div>

    </xsl:template>


    <xsl:template name ="DiscussionAddedActive">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added a new
                    <font color="#17375E">
                        <b>
                            Discussion
                        </b>
                    </font> to the <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>&#xa0;
                        </b>
                    </font>
                    <xsl:if test ="EmailNotifications/ParentItemType = 5">
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                            Goal
                        </span>
                    </xsl:if>
                    <xsl:if test ="EmailNotifications/ParentItemType = 18">
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                            Community
                        </span>
                    </xsl:if>
                </span>
            </div>
            <div id="div_Notification_Discussion"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left: 15px;" wrap="true">
                                            <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                    <xsl:if test ="EmailNotifications/ItemDescription != ''">
                                        <div id="div_Description" 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;">
                                            <div id="div_Note_View">
                                                <div id="divDescription" style="border-bottom: 1px solid #BCBCBC;	padding-bottom: 2px; margin-bottom: 5px;">
                                                    <div>
                                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                            <xsl:apply-templates select ="EmailNotifications/ItemDescription"></xsl:apply-templates>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </xsl:if>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Discussion.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="DiscussionAddedUser">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Discussion">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added a
                    <font color="#17375E">
                        <b>
                            Discussion
                        </b>
                    </font> under the
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                        </b>
                    </font>
                    <xsl:if test ="EmailNotifications/ParentItemType = 5">
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                            Goal
                        </span>
                    </xsl:if>
                    <xsl:if test ="EmailNotifications/ParentItemType = 18">
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                            Community
                        </span>

                    </xsl:if>
                </span>
            </div>
            <div id="div_Notification_Discussion"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left: 15px;" wrap="true">
                                            <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                    <xsl:if test ="EmailNotifications/ItemDescription != ''">
                                        <div id="div_Description" 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;">
                                            <div id="div_Note_View">
                                                <div id="divDescription" style="border-bottom: 1px solid #BCBCBC;	padding-bottom: 2px; margin-bottom: 5px;">
                                                    <div>
                                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                            <xsl:apply-templates select ="EmailNotifications/ItemDescription"></xsl:apply-templates>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </xsl:if>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Discussion.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>



    <xsl:template name ="NoteChanged">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    modified a
                    <font color="#17375E">
                        <b>Comment</b>
                    </font> under
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                        </b>
                    </font>
                    in the
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                        </b>
                    </font>
                </span>
            </div>
            <div id="div_Notification_Notes"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Note" 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;">
                                <div id="div_Note_View">
                                    <div id="divNote" style="border-bottom: 1px solid #BCBCBC;	padding-bottom: 2px; margin-bottom: 5px;">

                                        <div>
                                            <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial; font-size: 10pt; width: 80%" wrap="true">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </span>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>To Reply, Comment or View Discussion:</b>
                <a href="{$TargetURL}/Discussion.aspx?ID={normalize-space(EmailNotifications/ParentItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Discussion.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ParentItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="GoalChanged">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    modified a Goal

                </span>
            </div>
            <div id ="div_Notification_Item"
                 style="margin-left:50px; margin-top:3px;">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    &#xa0;
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:choose>
                                    <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                        <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <span style="text-transform: capitalize;">
                                            <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                        </span> : <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </b>
                        </font>
                    </a>
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="GoalCompleted">
        <div id="div_Notification" style="margin-top:10px">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    completed a Goal

                </span>
            </div>
            <div id ="div_Notification_Item"
                 style="margin-left:50px; margin-top:3px;">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    &#xa0;
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:choose>
                                    <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                        <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <span style="text-transform: capitalize;">
                                            <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                        </span> : <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </b>
                        </font>
                    </a>
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="ChallengeAdded">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added a new Challenge
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                        </b>
                    </font>
                </span>
            </div>
            <div id="div_Notification_Action"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left: 15px;" wrap="true">
                                            <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Challenge.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="ActionCreated">
        <xsl:param name="TypeID" select="'n/a'"></xsl:param>




        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added

                    <xsl:choose>
                        <xsl:when test="$TypeID=14">
                            a <font color="#17375E">
                                <b>Worksheet</b>
                            </font>
                        </xsl:when>
                        <xsl:otherwise>
                            an <font color="#17375E">
                                <b>Action</b>
                            </font>
                        </xsl:otherwise>
                    </xsl:choose>

                    under
                    <xsl:if test ="EmailNotifications/ParentItem != EmailNotifications/PrimaryItem">
                        <font color="#17375E">
                            <b>

                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        of the
                    </xsl:if>
                    <font color="#17375E">
                        <b>
                            <xsl:choose>
                                <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                    <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                </xsl:when>
                                <xsl:otherwise>
                                    <span style="text-transform: capitalize;">
                                        <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                    </span> : <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                </xsl:otherwise>
                            </xsl:choose>
                        </b>
                    </font>
                    Goal
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <div id="div_Notification_Action"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left: 15px;" wrap="true">
                                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="ActionChanged">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    updated an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> to you under
                    <xsl:if test ="EmailNotifications/ParentItem != EmailNotifications/PrimaryItem">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        of the
                    </xsl:if>
                    <font color="#17375E">
                        <b>
                            <xsl:choose>
                                <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                    <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                </xsl:when>
                                <xsl:otherwise>
                                    <span style="text-transform: capitalize;">
                                        <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                    </span> : <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                                </xsl:otherwise>
                            </xsl:choose>

                        </b>
                    </font>
                    Goal
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>
            </div>
            <div id="div_Notification_Action"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left:15px;" wrap="true">
                                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="ActionCompleted">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    completed an
                    <font color="#17375E">
                        <b>Action</b>
                    </font> under
                    <xsl:if test ="EmailNotifications/ParentItem != EmailNotifications/PrimaryItem">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        of the
                    </xsl:if>
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                        </b>
                    </font>
                    Goal
                </span>
            </div>
            <div id="div_Notification_Action"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left:15px;" wrap="true">
                                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="SecureItMemberAdded">
        <xsl:param name="GoalType" select="'N/A'"></xsl:param>
        <xsl:param name="GoalOpenPage" select="'N/A'"></xsl:param>


        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    <xsl:if test="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &gt; 0">
                        added you to a Brand
                    </xsl:if>
                    <xsl:if test="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &lt;= 0">
                        added you to a Portal
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 4 or normalize-space(EmailNotifications/TypeID) = 5">
                        added you to a Goal
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 2">
                        added you to a Lifespace
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 8 or normalize-space(EmailNotifications/TypeID) = 9">
                        added you to an
                        <font color="#17375E">
                            <b>Action</b>
                        </font> under
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        of
                        <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>'s
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                            </b>
                        </font>
                        Goal
                    </xsl:if>
                </span>
            </div>
            <div style="margin-left:50px; margin-top:3px;">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    &#xa0;
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 4 or normalize-space(EmailNotifications/TypeID) = 5">
                        <xsl:choose>
                            <xsl:when test="EmailNotifications/GoalType = 2">
                                <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                    <font color="#17375E">
                                        <b>
                                            <xsl:choose>
                                                <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                                    <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <span style="text-transform: capitalize;">
                                                        <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                                    </span> : <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </b>

                                    </font>
                                </a>
                                <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                                    in
                                    <font color="#17375E">
                                        <b>
                                            <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                                        </b>
                                    </font>
                                </xsl:if>
                            </xsl:when>
                            <xsl:otherwise>
                                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                    <font color="#17375E">
                                        <b>
                                            <xsl:choose>
                                                <xsl:when test="EmailNotifications/GoalOwnerID = EmailNotifications/UserID">
                                                    <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <span style="text-transform: capitalize;">
                                                        <xsl:value-of select="normalize-space(EmailNotifications/GoalOwnerName)"/>
                                                    </span> : <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </b>

                                    </font>
                                </a>
                                <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                                    in
                                    <font color="#17375E">
                                        <b>
                                            <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                                        </b>
                                    </font>
                                </xsl:if>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 2">
                        <a href="{$TargetURL}/LifeSpace.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &gt; 0">
                        <a href="{$TargetURL}/{normalize-space(EmailNotifications/BrandKey)}" target="_blank">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &lt;= 0">
                        <a href="{$TargetURL}/ClientPortal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                            <font color="#17375E">
                                <b>
                                    <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                                </b>
                            </font>
                        </a>
                    </xsl:if>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 4 or normalize-space(EmailNotifications/TypeID) = 5">
                    <xsl:choose>
                        <xsl:when test="EmailNotifications/GoalType = 2">
                            <a href="{$TargetURL}/Challenge.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                <xsl:value-of select="$TargetURL"></xsl:value-of>/Challenge.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                            </a>
                        </xsl:when>
                        <xsl:otherwise>
                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                            </a>
                        </xsl:otherwise>
                    </xsl:choose>

                </xsl:if>
                <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 2">
                    <a href="{$TargetURL}/LifeSpace.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:value-of select="$TargetURL"></xsl:value-of>/LifeSpace.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                    </a>
                </xsl:if>
                <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &lt;= 0">
                    <a href="{$TargetURL}/ClientPortal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:value-of select="$TargetURL"></xsl:value-of>/ClientPortal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                    </a>
                </xsl:if>
                <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 3 and normalize-space(EmailNotifications/targetID) &gt; 0">
                    <a href="{$TargetURL}/{normalize-space(EmailNotifications/BrandKey)}" target="_blank">
                        <xsl:value-of select="$TargetURL"></xsl:value-of>/<xsl:value-of select="normalize-space(EmailNotifications/BrandKey)"></xsl:value-of>
                    </a>
                </xsl:if>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="SecureItMemberRightUpdated">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(Actor/FirstName)"/>&#xa0;
                        </b>
                    </font>
                    changed your
                    <font color="#17375E">
                        <b>Right</b>
                    </font> for
                    <xsl:if test ="normalize-space(EmailNotifications/PrimaryItemID) != normalize-space(EmailNotifications/ParentItemID)">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        under
                    </xsl:if>
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                        </b>
                    </font>
                    Goal

                </span>
            </div>
            <div style="margin-left:50px; margin-top:3px;">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    &#xa0;
                    <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                            </b>
                        </font>
                    </a>
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/ItemID)"></xsl:value-of>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="ActionAssigned">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    <xsl:choose>
                        <xsl:when test="$TypeID=14">
                            assigned a <font color="#17375E">
                                <b>Worksheet</b>
                            </font>
                        </xsl:when>
                        <xsl:otherwise>
                            assigned an <font color="#17375E">
                                <b>Action</b>
                            </font>
                        </xsl:otherwise>
                    </xsl:choose>
                    to you
                    <font color="#17375E">
                        <b>
                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>
                            </a>
                        </b>
                    </font>
                    under
                    <xsl:if test ="EmailNotifications/ParentItem != EmailNotifications/PrimaryItem">
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/ParentItem)"/>
                            </b>
                        </font>
                        of
                    </xsl:if>
                    <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>'s
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/PrimaryItem)"/>
                        </b>
                    </font>
                    Goal
                    <xsl:if test="normalize-space(EmailNotifications/PortalName) != ''">
                        in
                        <font color="#17375E">
                            <b>
                                <xsl:value-of select="normalize-space(EmailNotifications/PortalName)"/>
                            </b>
                        </font>
                    </xsl:if>
                </span>

            </div>
            <div id="div_Notification_Action"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Action" style="margin-left:5px">
                                <div>
                                    <div>
                                        <span id="lbl_itemNote" class="label" style="font-family: Calibri, Verdana, Arial;	font-size: 10pt; margin-left:15px;" wrap="true">
                                            <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                                                <xsl:apply-templates select ="EmailNotifications/Item"></xsl:apply-templates>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Open Item:</b>
                <a href="{$TargetURL}/Goal.aspx?ID={normalize-space(EmailNotifications/PrimaryItemID)}&amp;ViewID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                    <xsl:value-of select="$TargetURL"></xsl:value-of>/Goal.aspx?ID=<xsl:value-of select="normalize-space(EmailNotifications/PrimaryItemID)"></xsl:value-of>
                    <xsl:text>&amp;ViewID=</xsl:text><xsl:value-of select="normalize-space(EmailNotifications/ItemID)"/>
                </a>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="UserRegistered">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 4 or normalize-space(EmailNotifications/TypeID) = 5">
                        has just registered to LifeSpace
                    </xsl:if>
                </span>
            </div>
            <div></div>
        </div>
    </xsl:template>

    <xsl:template name ="AccountActivated">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;'s
                        </b>
                    </font>
                    <xsl:if test ="normalize-space(EmailNotifications/TypeID) = 4 or normalize-space(EmailNotifications/TypeID) = 5">
                        account has been activated.
                    </xsl:if>
                </span>
            </div>
            <div></div>
        </div>
    </xsl:template>

    <xsl:template name ="RelationshipRequest">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    created a relationship with you. Please confirm.

                </span>
            </div>
            <div style="margin-left:50px; margin-top:3px;">

            </div>
        </div>
        <div style="margin-top:10px;">

        </div>
    </xsl:template>

    <xsl:template name ="RelationshipRequestConfirmed">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    has approved your relationship request.

                </span>
            </div>
            <div style="margin-left:50px; margin-top:3px;">

            </div>
        </div>
        <div style="margin-top:10px;">

        </div>
    </xsl:template>

    <xsl:template name ="TimeStamp">
        <xsl:variable name="CreatedMinutes" select="EmailNotifications/CreatedMinutes"/>
        <i>
            <font color="#17375E">
                <xsl:if test ="$CreatedMinutes &lt; 1">
                    &#xa0;<xsl:value-of select="round(normalize-space($CreatedMinutes) * 60)"/> second(s) ago
                </xsl:if>
                <xsl:if test ="$CreatedMinutes &gt;= 1 and $CreatedMinutes &lt; 60">
                    &#xa0;<xsl:value-of select="round(normalize-space($CreatedMinutes))"/> minute(s) ago
                </xsl:if>
                <xsl:if test ="$CreatedMinutes &gt;= 60 and $CreatedMinutes &lt; 1440 ">
                    &#xa0;<xsl:value-of select="round(normalize-space($CreatedMinutes) div 60)"/> hour(s) ago
                </xsl:if>
                <xsl:if test ="$CreatedMinutes &gt; 1440 ">
                    &#xa0;<xsl:value-of select="round(normalize-space($CreatedMinutes) div 1440)"/> day(s) ago
                </xsl:if>
            </font>
        </i>
    </xsl:template>

    <xsl:template match="EmailNotifications/Item">
        <xsl:call-template name="break"></xsl:call-template>
    </xsl:template>

    <xsl:template match="ReplyNote">
        <xsl:call-template name="break"></xsl:call-template>
    </xsl:template>

    <xsl:template name="break">
        <xsl:param name="text" select="."/>
        <xsl:choose>
            <xsl:when test="contains($text, '&#xD;&#xa;')">
                <xsl:value-of select="substring-before($text, '&#xD;&#xa;')"/>
                <br/>
                <xsl:call-template name="break">
                    <xsl:with-param name="text" select="substring-after($text,'&#xD;&#xa;')"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$text" disable-output-escaping="yes"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name ="ResponseAdded">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    added a Response in
                    <a href="{$TargetURL}/ClientPortal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:apply-templates select ="EmailNotifications/ItemName"></xsl:apply-templates>
                    </a>. Please approve.
                </span>
            </div>
            <div id="div_Notification_Responses"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Note_Subject" 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;">
                                <b>
                                    <xsl:value-of select ="EmailNotifications/ResponseSubject"/>
                                </b>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Note_Body" 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;">
                                <xsl:value-of select ="EmailNotifications/ResponseHTML" disable-output-escaping ="yes"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
        </div>
    </xsl:template>


    <xsl:template name ="ResponseUpdated">
        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ActorName)"/>&#xa0;
                        </b>
                    </font>
                    updated a response in
                    <a href="{$TargetURL}/ClientPortal.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                        <xsl:apply-templates select ="EmailNotifications/ItemName"></xsl:apply-templates>
                    </a>. Please approve.
                </span>
            </div>
            <div id="div_Notification_Responses"
                 style="margin-left:50px; margin-top:3px;">
                <table cellspacing="0" border="0" cellpadding="0" width="100%">
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Note_Subject" 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;">
                                <b>
                                    <xsl:value-of select ="EmailNotifications/ResponseSubject"/>
                                </b>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="left">
                            <div id="div_Note_Body" 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;">
                                <xsl:value-of select ="EmailNotifications/ResponseHTML" disable-output-escaping ="yes"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="margin-top:10px;">
        </div>
    </xsl:template>


    <xsl:template name ="CommunityFollower">
        <xsl:param name="CommPromoteKey" select="'N/A'"></xsl:param>


        <div id="div_Notification" style="margin-top:10px;">
            <div id="div_Notification_Summary">
                You have been added to the
                <span style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                    <font color="#17375E">
                        <b>
                            <xsl:value-of select="normalize-space(EmailNotifications/ItemName)"/>&#xa0;
                        </b>
                    </font>
                    community where you can view articles, access valuable resources and participate in discussions.
                </span>
            </div>
        </div>
        <div style="margin-top:10px;">
            <span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
                <b>Click here to view the group:</b>

                <xsl:choose>
                    <xsl:when test="$CommPromoteKey != ''">
                        <a href="{$TargetURL}/{$CommPromoteKey}" target="_blank">
                            <xsl:value-of select="$TargetURL"></xsl:value-of>/<xsl:value-of select="normalize-space(EmailNotifications/ItemName)"></xsl:value-of>
                        </a>
                    </xsl:when>
                    <xsl:otherwise>
                        <a href="{$TargetURL}/Community.aspx?ID={normalize-space(EmailNotifications/ItemID)}" target="_blank">
                            <xsl:value-of select="$TargetURL"></xsl:value-of>/<xsl:value-of select="normalize-space(EmailNotifications/ItemName)"></xsl:value-of>
                        </a>
                    </xsl:otherwise>
                </xsl:choose>
            </span>
        </div>
    </xsl:template>

    <xsl:template name ="BuyPackage">
        <xsl:param name="ItemName" select="'N/A'"></xsl:param>
        <xsl:param name="TransactionStatus" select="'N/A'"></xsl:param>
        <xsl:param name="TransactionID" select="'N/A'"></xsl:param>
        <xsl:param name="SubscriptionID" select="'N/A'"></xsl:param>
        <xsl:param name="Amount" select="'N/A'"></xsl:param>
        <xsl:param name="TransactionDate" select="'N/A'"></xsl:param>
        <xsl:param name="PackageName" select="'N/A'"></xsl:param>
        <xsl:param name="TransactionMessage" select="'N/A'"></xsl:param>
        <xsl:param name="FirstName" select="'N/A'"></xsl:param>
        <xsl:param name="LastName" select="'N/A'"></xsl:param>
        <xsl:param name="Address" select="'N/A'"></xsl:param>
        <xsl:param name="City" select="'N/A'"></xsl:param>
        <xsl:param name="State" select="'N/A'"></xsl:param>
        <xsl:param name="Postal" select="'N/A'"></xsl:param>
        <div id="div_Notification_BuyPackage" style="margin-top:10px;">
            <div id="div_Notification_">
                <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;margin-right:3px">
                    <font color="#6D6E71">
                        <b>
                            <xsl:value-of select="$TransactionStatus"/>
                        </b>
                    </font>
                </span>
                <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;">
                    <font color="#6D6E71">
                        <b>
                            transaction has occurred in
                        </b>
                    </font>
                </span>
                <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;">
                    <font color="#6D6E71">
                        <b>
                            <xsl:value-of select="$ItemName"/>
                        </b>
                    </font>
                </span>
                <xsl:if test="$TransactionID = 0">
                    <div>
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;color:#6D6E71">Reason : </span>
                        <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;color:#6D6E71">
                            <xsl:value-of select="$TransactionMessage"/>
                        </span>
                    </div>
                </xsl:if>

                <table width="100%" style="margin-top:10px">
                    <tr>
                        <td cosan="2">
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;">
                                <font color="#6D6E71">
                                    <b>
                                        Package Info :
                                    </b>
                                </font>
                            </span>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>Package Name</span>
                        </td>
                        <td width="80%">
                            <span>
                                <xsl:value-of select="$PackageName"/>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>Transaction ID :</span>
                        </td>
                        <td>
                            <span>
                                <xsl:value-of select="$TransactionID"/>
                            </span>
                        </td>
                    </tr>
                    <xsl:if test="$TransactionID &gt; 0">
                        <tr>
                            <td>
                                <span>Subscription ID :</span>
                            </td>
                            <td>
                                <span>
                                    <xsl:value-of select="$SubscriptionID"/>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span>Amount :</span>
                            </td>
                            <td>
                                <span>
                                    <xsl:value-of select="$Amount"/>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <span>Transaction Date</span>
                            </td>
                            <td>
                                <span>
                                    <xsl:value-of select="$TransactionDate"/>
                                </span>
                            </td>
                        </tr>
                    </xsl:if>

                </table>
                <table  width="100%" style="margin-top:10px">
                    <tr>
                        <td cosan="2">
                            <span style="font-family: Calibri, Verdana, Arial;font-size: 12pt;">
                                <font color="#6D6E71">
                                    <b>
                                        Contact Info :
                                    </b>
                                </font>
                            </span>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>Name :</span>
                        </td>
                        <td width="80%">
                            <span style="margin-right:5px;">
                                <xsl:value-of select="$FirstName"/>
                            </span>
                            <span>
                                <xsl:value-of select="$LastName"/>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>Address :</span>
                        </td>
                        <td width="80%">
                            <span>
                                <xsl:value-of select="$Address"/>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>City :</span>
                        </td>
                        <td width="80%">
                            <span>
                                <xsl:value-of select="$City"/>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>State :</span>
                        </td>
                        <td width="80%">
                            <span>
                                <xsl:value-of select="$State"/>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%">
                            <span>Postal :</span>
                        </td>
                        <td width="80%">
                            <span>
                                <xsl:value-of select="$Postal"/>
                            </span>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </xsl:template>
</xsl:stylesheet>
