﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="../GenericTemplates/AutoSuggestUsers.xslt"/>
    <xsl:import href="../ShareITDataList.xslt"/>
    <xsl:import href="BrandAutoSuggest.xslt"/>

    <xsl:template match="/">
        <xsl:variable name ="BrandID" select="normalize-space(BrandAdminCountData/BrandID)"></xsl:variable>
        <xsl:variable name ="CommunityBrandID" select="normalize-space(BrandAdminCountData/BrandCommunityID)"></xsl:variable>
        <xsl:variable name ="TemplateURL" select="normalize-space(BrandAdminCountData/TemplateURL)"></xsl:variable>
        <xsl:variable name="HostName" select="normalize-space(BrandAdminCountData/HostName)"></xsl:variable>
        <xsl:variable name ="BrandPermissionID" select="normalize-space(BrandAdminCountData/BrandPermissionID)"></xsl:variable>

        <xsl:variable name ="TodayVisits" select="normalize-space(BrandAdminCountData/Visits/Today/TotalTodayVisitors)"></xsl:variable>
        <xsl:variable name ="WeekVisits" select="normalize-space(BrandAdminCountData/Visits/Week/TotalWeekVisitors)"></xsl:variable>
        <xsl:variable name="MonthVisits" select="normalize-space(BrandAdminCountData/Visits/Month/TotalMonthVisitors)"></xsl:variable>

        <xsl:variable name ="TodayFollow" select="normalize-space(BrandAdminCountData/Follow/Today/TotalTodayFollow)"></xsl:variable>
        <xsl:variable name ="WeekFollow" select="normalize-space(BrandAdminCountData/Follow/Week/TotalWeekFollow)"></xsl:variable>
        <xsl:variable name="MonthFollow" select="normalize-space(BrandAdminCountData/Follow/Month/TotalMonthFollow)"></xsl:variable>

        <xsl:variable name="TotalPosts" select="normalize-space(BrandAdminCountData/PostsData/AllPosts/PostsCount)"></xsl:variable>
        <xsl:variable name="TotalDrafts" select="normalize-space(BrandAdminCountData/PostsData/AllPosts/Drafts)"></xsl:variable>

        <xsl:variable name="TotalVisits" select="normalize-space(BrandAdminCountData/Visits/All/TotalVisitors)"></xsl:variable>
        <xsl:variable name="TotalFollows" select="normalize-space(BrandAdminCountData/Follow/All/TotalFollowers)"></xsl:variable>

        <xsl:variable name ="TodayTemp" select="normalize-space(BrandAdminCountData/Templates/Today)"></xsl:variable>
        <xsl:variable name ="WeekTemp" select="normalize-space(BrandAdminCountData/Templates/ThisWeek)"></xsl:variable>
        <xsl:variable name="MonthTemp" select="normalize-space(BrandAdminCountData/Templates/ThisMonth)"></xsl:variable>
        <xsl:variable name ="AllTemp" select="normalize-space(BrandAdminCountData/Templates/Total)"></xsl:variable>

        <xsl:variable name ="TodayPubl" select="normalize-space(BrandAdminCountData/Publications/Today)"></xsl:variable>
        <xsl:variable name="WeekPubl" select="normalize-space(BrandAdminCountData/Publications/ThisWeek)"></xsl:variable>
        <xsl:variable name ="MonthPubl" select="normalize-space(BrandAdminCountData/Publications/ThisMonth)"></xsl:variable>
        <xsl:variable name ="AllPubl" select="normalize-space(BrandAdminCountData/Publications/Total)"></xsl:variable>

        <xsl:variable name="PortalTypeID" select="normalize-space(BrandAdminCountData/Brand/PortalTypeID)"></xsl:variable>
        <xsl:variable name="PortalType" select="normalize-space(BrandAdminCountData/Brand/PortalType)"></xsl:variable>
        <xsl:variable name="PortalItemID" select="normalize-space(BrandAdminCountData/Brand/PortalItemID)"></xsl:variable>


        <xsl:variable name="PostsText">
            <xsl:choose>
                <xsl:when test="$TotalPosts = 1">
                    <xsl:text>Post</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>Posts</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="DraftsText">
            <xsl:choose>
                <xsl:when test="$TotalDrafts = 1">
                    <xsl:text>Draft</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>Drafts</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name ="IsCommunityAdmin" select="normalize-space(BrandAdminCountData/IsCommunityAdmin)"></xsl:variable>
        <xsl:variable name="RoleName" select="normalize-space(BrandAdminCountData/UserRoles/Role/RoleName)"></xsl:variable>

        <xsl:choose>
            <xsl:when test="$BrandPermissionID != 4 and count(BrandAdminCountData/UserRoles/Role[RoleName = 'Brand Admin']) = 0">
                <div class="labelError">
                    <div id='divAuthenticationMessage' class='TournamentClubBackground margin10 padding30'>
                        <script language='javascript' type='text/javascript'>
                            DisplaySignUpPopUp('login', 'NonAuthCase', '');
                        </script>
                    </div>
                </div>
            </xsl:when>
            <xsl:otherwise>


                <div id="divBrandAdmin" style="background-color:White;" >

                    <xsl:call-template name="Statistic">
                        <xsl:with-param name ="TodayVisits" select="$TodayVisits"></xsl:with-param>
                        <xsl:with-param name ="WeekVisits" select="$WeekVisits"></xsl:with-param>
                        <xsl:with-param name="MonthVisits" select="$MonthVisits"></xsl:with-param>
                        <xsl:with-param name ="TodayFollow" select="$TodayFollow"></xsl:with-param>
                        <xsl:with-param name ="WeekFollow" select="$WeekFollow"></xsl:with-param>
                        <xsl:with-param name="MonthFollow" select="$MonthFollow"></xsl:with-param>
                        <xsl:with-param name="TotalPosts" select="$TotalPosts"></xsl:with-param>
                        <xsl:with-param name="TotalDrafts" select="$TotalDrafts"></xsl:with-param>
                        <xsl:with-param name="TotalVisits" select="$TotalVisits"></xsl:with-param>
                        <xsl:with-param name="TotalFollows" select="$TotalFollows"></xsl:with-param>
                        <xsl:with-param name ="TodayTemp" select="$TodayTemp"></xsl:with-param>
                        <xsl:with-param name ="WeekTemp" select="$WeekTemp"></xsl:with-param>
                        <xsl:with-param name="MonthTemp" select="$MonthTemp"></xsl:with-param>
                        <xsl:with-param name ="AllTemp" select="$AllTemp"></xsl:with-param>
                        <xsl:with-param name ="TodayPubl" select="$TodayPubl"></xsl:with-param>
                        <xsl:with-param name="WeekPubl" select="$WeekPubl"></xsl:with-param>
                        <xsl:with-param name ="MonthPubl" select="$MonthPubl"></xsl:with-param>
                        <xsl:with-param name ="AllPubl" select="$AllPubl"></xsl:with-param>
                    </xsl:call-template>

                    <xsl:call-template name="Admin">
                        <xsl:with-param name="PortalTypeID" select="$PortalTypeID"></xsl:with-param>
                        <xsl:with-param name="PortalType" select="$PortalType"></xsl:with-param>
                        <xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
                        <xsl:with-param name ="BrandID" select="$BrandID"></xsl:with-param>
                        <xsl:with-param name ="CommunityBrandID" select="$CommunityBrandID"></xsl:with-param>
                        <xsl:with-param name ="TemplateURL" select="$TemplateURL"></xsl:with-param>
                        <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
                        <xsl:with-param name ="BrandPermissionID" select="$BrandPermissionID"></xsl:with-param>
                        <xsl:with-param name="TotalPosts" select="$TotalPosts"></xsl:with-param>
                        <xsl:with-param name="TotalDrafts" select="$TotalDrafts"></xsl:with-param>
                    </xsl:call-template>

                    <xsl:call-template name="ShareIT">
                        <xsl:with-param name="BrandAdminCountData" select="BrandAdminCountData/."></xsl:with-param>
                        <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                    </xsl:call-template>

                    <!--<xsl:call-template name="CustomStyle">
                        <xsl:with-param name="BrandAdminCountData" select="BrandAdminCountData/."></xsl:with-param>
                        <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                    </xsl:call-template>-->

                </div>


            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="ShareIT">
        <xsl:param name="BrandAdminCountData" select="'N/A'"></xsl:param>
        <xsl:param name="BrandID" select="'N/A'"></xsl:param>
        <xsl:param name="Origin" select="'N/A'"></xsl:param>
        

        <div id="brandShareIt">
            <div class="" style="border:1px solid #D1D3D4;margin-top:30px;" id="div_ModuleBox">
                <table cellspacing="0" cellpadding="5" class="tableMaster">
                    <tbody>
                        <xsl:choose>
                            <xsl:when test="$Origin = 'Portal'">
                                <xsl:text></xsl:text>
                            </xsl:when>
                            <xsl:otherwise>
                                <tr>
                                    <td style="color:#FFFFFF;height:36px;" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient">
                                        <span style="" class="paddingTop15">Security</span>
                                    </td>
                                </tr>
                            </xsl:otherwise>
                        </xsl:choose>
                        <tr>
                            <td>
                                <div id="_ContainerBox">
                                    <center>
                                        <table cellpadding="5" cellspacing="5" width="90%">
                                            <tr>
                                                <td>
                                                    <div id="div_shareIt_{$BrandID}" style="margin-top: 10px;">
                                                        <div id="div_shareIt_{$BrandID}_ListShareITData" class="tableLocal" style="margin-left: 10px;">
                                                            <xsl:call-template name="ShareItDataList">
                                                                <xsl:with-param name="ShareITRecords" select="$BrandAdminCountData/ShareITRecords/."></xsl:with-param>
                                                                <xsl:with-param name="SourceID" select="$BrandAdminCountData/ShareITRecords/SourceID"></xsl:with-param>
                                                                <xsl:with-param name="Origin" select="$BrandAdminCountData/ShareITRecords/Origin"></xsl:with-param>
                                                            </xsl:call-template>
                                                        </div>

                                                        <xsl:call-template name="BrandAutoSuggest">
                                                            <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                                                            <xsl:with-param name="TargetDivID">
                                                                <xsl:text>div_shareIt_</xsl:text>
                                                                <xsl:value-of select="$BrandID"/>
                                                            </xsl:with-param>
                                                            <xsl:with-param name="Origin">
                                                                <xsl:text>BrandShareIt</xsl:text>
                                                            </xsl:with-param>
                                                        </xsl:call-template>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                    </center>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </xsl:template>

    <xsl:template name="Admin">
        <xsl:param name="PortalTypeID" select="'N/A'"></xsl:param>
        <xsl:param name="PortalType" select="'N/A'"></xsl:param>
        <xsl:param name="PortalItemID" select="'N/A'"></xsl:param>

        <xsl:param name ="BrandID" select="'N/A'"></xsl:param>
        <xsl:param name ="CommunityBrandID" select="'N/A'"></xsl:param>
        <xsl:param name ="TemplateURL" select="'N/A'"></xsl:param>
        <xsl:param name="HostName" select="'N/A'"></xsl:param>
        <xsl:param name ="BrandPermissionID" select="'N/A'"></xsl:param>
        <xsl:param name="TotalPosts" select="'N/A'"></xsl:param>
        <xsl:param name="TotalDrafts" select="'N/A'"></xsl:param>

        <xsl:variable name="PostsText">
            <xsl:choose>
                <xsl:when test="$TotalPosts = 1">
                    <xsl:text>Post</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>Posts</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <xsl:variable name="DraftsText">
            <xsl:choose>
                <xsl:when test="$TotalDrafts = 1">
                    <xsl:text>Draft</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>Drafts</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <div class="" style="border:1px solid #D1D3D4;margin-top:30px;" id="div_ModuleBox">
            <table cellspacing="0" cellpadding="5" class="tableMaster">
                <tbody>
                    <tr>
                        <td style="color:#FFFFFF;height:36px;" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient">
                            <span style="" class="paddingTop15">Admin</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="_ContainerBox">
                                <center>
                                    <table cellpadding="5" cellspacing="5" width="90%">
                                        <tr>
                                            <td>
                                                <div id="div_EditBrandInfo" style="display:inline;margin-top:15px;">
                                                    <xsl:choose>
                                                        <xsl:when test="$PortalTypeID = 1">
                                                            <a style="font-family: 'PT Sans', sans-serif;font-size: 13px;color: #4B4B4B;font-weight:700;text-decoration:none;" href="http://{$HostName}/CreateCoach.aspx?ID={$BrandID}">
                                                                Edit Coach Info
                                                            </a>
                                                        </xsl:when>
                                                        <xsl:when test="$PortalTypeID = 4">
                                                            <a style="font-family: 'PT Sans', sans-serif;font-size: 13px;color: #4B4B4B;font-weight:700;text-decoration:none;" href="http://{$HostName}/CreateCorporate.aspx?ID={$BrandID}">
                                                                Edit Corporate Info
                                                            </a>
                                                        </xsl:when>
                                                        <xsl:otherwise>
                                                            <a style="font-family: 'PT Sans', sans-serif;font-size: 13px;color: #4B4B4B;font-weight:700;text-decoration:none;" href="http://{$HostName}/CreateBrand.aspx?ID={$BrandID}">
                                                                Edit Brand Info
                                                            </a>
                                                        </xsl:otherwise>
                                                    </xsl:choose>

                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div id="div_ShowAllPostsLink" style="display: inline; margin-top: 15px;" class="onMouseOver">
                                                    <a style="font-family: 'PT Sans', sans-serif;font-size: 13px;color: #4B4B4B;font-weight:700;text-decoration:none;" onClick="brand_ViewAllPosts(
                                                                '{$BrandID}', '-99', 'divBrandAdmin');">
                                                        View All Posts
                                                        &#xa0;
                                                        (<xsl:value-of select ="$TotalPosts"/>&#xa0;<xsl:value-of select ="$PostsText"/>,
                                                        &#xa0;
                                                        <xsl:value-of select ="$TotalDrafts"/>&#xa0;<xsl:value-of select ="$DraftsText"/>)
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div id="div_ShowAllPostsLink" style="display: inline; margin-top: 15px;">
                                                    <a style="font-family: 'PT Sans', sans-serif;font-size: 13px;color: #4B4B4B;font-weight:700;text-decoration:none;" target="_blank" href="http://{$HostName}/ClientPortal.aspx?ID={$PortalItemID}">
                                                        Open My Portal
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </center>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </xsl:template>

    <xsl:template name="Statistic">
        <xsl:param name ="TodayVisits" select="'N/A'"></xsl:param>
        <xsl:param name ="WeekVisits" select="'N/A'"></xsl:param>
        <xsl:param name="MonthVisits" select="'N/A'"></xsl:param>

        <xsl:param name ="TodayFollow" select="'N/A'"></xsl:param>
        <xsl:param name ="WeekFollow" select="'N/A'"></xsl:param>
        <xsl:param name="MonthFollow" select="'N/A'"></xsl:param>

        <xsl:param name="TotalPosts" select="'N/A'"></xsl:param>
        <xsl:param name="TotalDrafts" select="'N/A'"></xsl:param>

        <xsl:param name="TotalVisits" select="'N/A'"></xsl:param>
        <xsl:param name="TotalFollows" select="'N/A'"></xsl:param>

        <xsl:param name ="TodayTemp" select="'N/A'"></xsl:param>
        <xsl:param name ="WeekTemp" select="'N/A'"></xsl:param>
        <xsl:param name="MonthTemp" select="'N/A'"></xsl:param>
        <xsl:param name ="AllTemp" select="'N/A'"></xsl:param>

        <xsl:param name ="TodayPubl" select="'N/A'"></xsl:param>
        <xsl:param name="WeekPubl" select="'N/A'"></xsl:param>
        <xsl:param name ="MonthPubl" select="'N/A'"></xsl:param>
        <xsl:param name ="AllPubl" select="'N/A'"></xsl:param>


        <div class="" style="border:1px solid #D1D3D4;" id="div_ModuleBox">
            <table cellspacing="0" cellpadding="5" class="tableMaster">
                <tbody>
                    <tr>
                        <td style="color:#FFFFFF;height:36px;" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient">
                            <span class="paddingTop15">Statistics</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="_ContainerBox">
                                <center>
                                    <table width="90%" cellpadding="3" cellspacing="3">
                                        <tr>
                                            <td width="50%" >
                                                <span class="packageTitle">
                                                    <xsl:text>Visitors</xsl:text>
                                                </span>
                                            </td>
                                            <td width="50%" >
                                                <span class="packageTitle">
                                                    <xsl:text>Followers</xsl:text>
                                                </span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="50%">
                                                <center>
                                                    <table width="88%"  border="1" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>Today</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Week</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Month</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>All</xsl:text>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TodayVisits"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$WeekVisits"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$MonthVisits"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TotalVisits"/>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </center>
                                            </td>
                                            <td width="50%">
                                                <center>
                                                    <table width="88%"  border="1" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>Today</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Week</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Month</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>All</xsl:text>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TodayFollow"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$WeekFollow"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$MonthFollow"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TotalFollows"/>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                        <tr style="padding-top:15px;">
                                            <td width="50%" >
                                                <span class="packageTitle">
                                                    <xsl:text>Publications</xsl:text>
                                                </span>
                                            </td>
                                            <td width="50%" >
                                                <span class="packageTitle">
                                                    <xsl:text>Templates</xsl:text>
                                                </span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="50%">
                                                <center>
                                                    <table width="88%"  border="1" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>Today</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Week</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Month</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>All</xsl:text>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TodayPubl"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$WeekPubl"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$MonthPubl"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$AllPubl"/>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </center>
                                            </td>
                                            <td width="50%">
                                                <center>
                                                    <table width="88%"  border="1" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>Today</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Week</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>This Month</xsl:text>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;" width="22%">
                                                                <span class="publicationSummary">
                                                                    <xsl:text>All</xsl:text>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$TodayTemp"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$WeekTemp"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$MonthTemp"/>
                                                                </span>
                                                            </td>
                                                            <td align="center" style="text-align:center;">
                                                                <span class="publicationSummary">
                                                                    <xsl:value-of select ="$AllTemp"/>
                                                                </span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                    </table>
                                </center>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>


    </xsl:template>

    <xsl:template name="CustomStyle">
        <xsl:param name="BrandAdminCountData" select="'N/A'"></xsl:param>
        <xsl:param name="BrandID" select="'N/A'"></xsl:param>

        <div class="" style="border:1px solid #D1D3D4;margin-top:30px;" id="div_ModuleBox">
            <table cellspacing="0" cellpadding="5" class="tableMaster">
                <tbody>
                    <tr>
                        <td style="color:#FFFFFF;height:36px;" class="verticallyMiddle moduleBoxHeaderRightSide moduleBoxGradient">
                            <span style="" class="paddingTop15">Custom Styles</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="_ContainerBox">
                                <table style="margin-left:35px;margin-bottom:20px;" cellpadding="3" cellspacing="3">
                                    <xsl:for-each select="$BrandAdminCountData/DynamicCSS/CSS">
                                        <tr>
                                            <td>
                                                <span class="label">
                                                    <xsl:value-of select="DisplayName"/>
                                                </span>
                                            </td>
                                            <td>
                                                <input  id="dynamicClass_{BrandCustomStyleID}" type="text" value="{Color}" style="width:70px; margin-right:10px;"
                                                        onblur="BrandDetail_UpdateDynamicCSS('{$BrandID}' ,'{ClassName}', 'dynamicClass_{BrandCustomStyleID}','{DisplayName}', '{BaseStyle}');"></input>
                                                <xsl:variable name="classss" >
                                                    <xsl:text>color {valueElement:'dynamicClass_</xsl:text>
                                                    <xsl:value-of  select="BrandCustomStyleID"/>
                                                    <xsl:text>'}</xsl:text>
                                                </xsl:variable>
                                                <input class="{$classss}" style="width:20px;"
                                                       onblur="BrandDetail_UpdateDynamicCSS('{$BrandID}' ,'{ClassName}', 'dynamicClass_{BrandCustomStyleID}','{DisplayName}', '{BaseStyle}');"></input>
                                            </td>
                                        </tr>
                                    </xsl:for-each>
                                    <tr>
                                        <td colspan="2" style="text-align:center;">
                                            <input type="button" class="button" value="Restore Defaults" style="margin-top:10px;"
                                                   onclick="BrandDetail_RestoreDefaultCSS('{$BrandID}');"></input>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </xsl:template>

</xsl:stylesheet>
