﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template name="ClientPortalRightContent">
        <xsl:param name="ItemID" select="'N/A'"/>
        <xsl:param name="ItemType" select="'N/A'"/>
        <xsl:param name="ItemName" select="'N/A'"/>
        <xsl:param name="TemplateURL" select ="'N/A'"/>
        <xsl:param name="PortalTypeID" select ="'N/A'"/>
        <xsl:param name="ClientUserID" select="'N/A'"/>
        <xsl:param name="PermissionID" select="'N/A'"></xsl:param>
        <xsl:param name="ProPackageID" select="'N/A'"></xsl:param>
        <xsl:param name="LoggedInUserID" select="'N/A'"></xsl:param>
        <xsl:param name="PortalDashBoardModules" select="'N/A'"></xsl:param>

        <xsl:choose>
            <xsl:when test="($ProPackageID = 4 or $ProPackageID = 8) and $PortalTypeID = 8">

                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:25px;">
                    <div id="divClientPortalOperations_TeamMembers">
                        <div id="divCoachesRight_4" style="margin-bottom:20px;"></div>
                    </div>
                    <div id="divClientPortalOperations_NumberAndMetricContainer">
                        <div id="divCoachesRight_1" style="margin-bottom:20px;"></div>
                    </div>

                    <div id="divClientPortalOperations_LeaderBoardContainer">
                        <table width="100%">
                            <tr>
                                <td  style="display:none;">
                                    <div id="divCoachesRight_2" ></div>
                                </td>
                            </tr>

                        </table>
                    </div>
                    <div id="divClientPortalOperations_RecentActivity">
                        <div id="divCoachesRight_3" style="margin-bottom:20px; margin-top:5px;"></div>
                    </div>
                </div>
            </xsl:when>
            <xsl:when test ="$PortalTypeID = 4">
                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:25px;">
                    <div id="divClientPortalOperations_NumberAndMetricContainer">
                        <div id="divCoachesRight_1" style="margin-bottom:20px;"></div>
                    </div>
                    <div id="divClientPortalOperations_LeaderBoardContainer">
                        <table width="100%">
                            <tr>
                                <td width="70%">
                                    <div id="divCoachesRight_4" ></div>
                                </td>
                                <td width="30%" style="display:none;">
                                    <div id="divCoachesRight_2" ></div>
                                </td>
                            </tr>

                        </table>
                    </div>
                    <div id="divClientPortalOperations_RecentActivity">
                        <div id="divCoachesRight_3" style="margin-bottom:20px; margin-top:5px;"></div>
                    </div>
                </div>
            </xsl:when>
            <xsl:when test="$PortalTypeID = 1 or ($ProPackageID = 3 and $PortalTypeID = 8)">
                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:20px;">
                    <div id="divCoachesRight_1" style="margin-bottom:20px; margin-top:2px;"></div>
                    <div id="divCoachesRight_2" style="margin-bottom:20px; margin-top:2px;"></div>
                    <div id="divCoachesRight_3" style="margin-bottom:20px; margin-top:2px;"></div>
                    <div id="divCoachesRight_4" style="margin-bottom:20px; margin-top:2px;"></div>
                </div>
            </xsl:when>
            <xsl:when test="$PortalTypeID = 8 and $ProPackageID = 2">
                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:20px;">
                    <div id="divCoachesRight_1" style="margin-bottom:20px; margin-top:2px;"></div>
                </div>
            </xsl:when>
            <xsl:when test="$PortalTypeID = 6 or $PortalTypeID = 5">
                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:20px; margin-top:5px;">
                    <div id="divTournamentRight_1" style="margin-bottom:20px; margin-top:5px;"></div>
                    <div id="divTournamentRight_2" style="margin-bottom:20px; margin-top:5px;"></div>
                    <div id="divTournamentRight_3" style="margin-bottom:20px; margin-top:5px;"></div>
                </div>
                <div id="div_Planner_AddTournament"></div>
            </xsl:when>
            <xsl:when test="$ProPackageID != 6 and $PortalTypeID = 2">
                <div id="divClientPortalOperations_Container" style="display:block;margin-bottom:20px; margin-top:5px;">
                    <div id="divTournamentRight_2" style="margin-bottom:20px; margin-top:5px;"></div>
                    <div id="divTournamentRight_3" style="margin-bottom:20px; margin-top:5px;"></div>
                    <div id="divTournamentRight_1" style="margin-bottom:20px; margin-top:5px;"></div>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <div id="divClientPortalOperations_Container" style="display:none;margin-bottom:20px; margin-top:5px;">
                </div>
            </xsl:otherwise>
        </xsl:choose>

        <xsl:choose>
            <xsl:when test="$ProPackageID != 7 and $PortalTypeID = 2">
                <script language="javascript" type="text/javascript">
                    Portal_getPortalTeamMembers('divTournamentRight_1','<xsl:value-of select ="$ItemID"/>','6','1','1','default','','');
                </script>

                <script language="javascript" type="text/javascript">
                    Portal_getPTPatientAccounts('divTournamentRight_2','<xsl:value-of select ="$ItemID"/>');
                </script>
            </xsl:when>
            <xsl:when test="$PortalTypeID = 8 and $ProPackageID = 2">
                <script language="javascript" type="text/javascript">
                    Portal_getPortalChallenges('divCoachesRight_1',"<xsl:value-of select ="$ItemID"/>");
                </script>
            </xsl:when>
            <xsl:when test="($ProPackageID = 4 or $ProPackageID = 8) and $PortalTypeID = 8">

                <script language="javascript" type="text/javascript">
                    <xsl:choose>
                        <xsl:when test="$ProPackageID = 8">
                            Portal_getPortalTeamMembers('divCoachesRight_4','<xsl:value-of select ="$ItemID"/>','6','1','1','client','','');
                        </xsl:when>
                        <xsl:otherwise>
                            Portal_getPortalTeamMembers('divCoachesRight_4','<xsl:value-of select ="$ItemID"/>','6','1','1','internal','','');
                        </xsl:otherwise>
                    </xsl:choose>
                </script>


                <script language="javascript" type="text/javascript">
                    Portal_getProjectLists('divCoachesRight_1','<xsl:value-of select ="$ItemID"/>','-1','-99','-99','2')
                </script>


                <script language="javascript" type="text/javascript">
                    Coaches_GetNotificationForCoaches("divCoachesRight_3","<xsl:value-of select ="$ItemID"/>", "CoachesNotifications","10");
                </script>


            </xsl:when>
            <xsl:when test ="$PortalTypeID = 4">
                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData("divCoachesRight_4","<xsl:value-of select ="$ItemID"/>", "GetLeaderBoardBox",
                    "<xsl:value-of select ="$PortalTypeID"/>");
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData('divCoachesRight_2',<xsl:value-of select ="$ItemID"/>,"GetCorporatePortalEmployees")
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_GetNotificationForCoaches("divCoachesRight_3","<xsl:value-of select ="$ItemID"/>", "CoachesNotifications","10");
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData("divCoachesRight_1","<xsl:value-of select ="$ItemID"/>","GetNumbersAndMetrics",
                    "<xsl:value-of select ="$PortalTypeID"/>");
                </script>
            </xsl:when>

            <xsl:when test="$PortalTypeID = 1 or ($ProPackageID = 3 and $PortalTypeID = 8)">
                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData("divCoachesRight_1","<xsl:value-of select ="$ItemID"/>", "GetCoachWelcomeMessage",
                    "<xsl:value-of select ="$PortalTypeID"/>");
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_GetNotificationForCoaches('divCoachesRight_2',<xsl:value-of select ="$ItemID"/>,"CoachesNotifications","10")
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData("divCoachesRight_3","<xsl:value-of select ="$ItemID"/>", "GetCoachesProfile",
                    "<xsl:value-of select ="$PortalTypeID"/>");
                </script>

                <script language="javascript" type="text/javascript">
                    Coaches_getDashBoardData("divCoachesRight_4","<xsl:value-of select ="$ItemID"/>","GetCoachesClientList",
                    "<xsl:value-of select ="$PortalTypeID"/>");
                </script>
            </xsl:when>

            <xsl:when test="$ProPackageID = 7 and $PortalTypeID = 2">

                <script language="javascript" type="text/javascript">
                    portal_LoadLocalOffice(<xsl:value-of select="$ItemID"/>,'divClientPortalOperations_Container', 25, 1);
                </script>

            </xsl:when>

            <xsl:when test="$PortalTypeID = 6">
                <script language="javascript" type="text/javascript">
                    loadTournamentPlannerBox('divTournamentRight_1',<xsl:value-of select="$ItemID"/>,<xsl:value-of select="$ClientUserID"/>,'clubportal');
                </script>
            </xsl:when>
            <xsl:when test="$PortalTypeID = 5">
                <script language="javascript" type="text/javascript">
                    loadTournamentPlannerBox('divTournamentRight_1',<xsl:value-of select="$ItemID"/>,<xsl:value-of select="$ClientUserID"/>,'hostportal');
                </script>
            </xsl:when>
            <xsl:when test="$ProPackageID = 5 or $ProPackageID = 9">
                <script language="javascript" type="text/javascript">
                    portal_LoadLocalOffice(<xsl:value-of select="$ItemID"/>,'divClientPortalOperations_Container', 25, 1);
                </script>
            </xsl:when>
        </xsl:choose>
    </xsl:template>
</xsl:stylesheet>
