﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
        <xsl:variable name="HostName" select="AjaxRequest/HostName"></xsl:variable>
        <xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalID"></xsl:variable>
        <xsl:variable name="EmployeeCount" select="count(AjaxRequest/PermissionXML/Permission)"></xsl:variable>

        <xsl:variable name="EmployeeBoxHeight">
            <xsl:choose>
                <xsl:when test="$EmployeeCount &gt; 8">
                    <xsl:text>height:501px;</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text></xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>

        <div id="Employee_List_{$PortalItemID}" style="overflow:hidden;"
             onmouseover="this.style.overflowY = 'scroll';"
             onmouseout="setScrollOffOnMouseOut(event,'Employee_List_{$PortalItemID}');">
            <xsl:for-each select="AjaxRequest/PermissionXML/Permission">
                <div class="marginBottom10">
                    <table class="tableMaster" cellpadding="0" cellspacing="0">

                        <tr>
                            <td width="19%">
                                <xsl:choose>
                                    <xsl:when test="FbPicURL != ''">
                                        <img src="{FbPicURL}" style="display:none;" onload="setWidthAndHeightImage(this, 35);"></img>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <img src="{$TemplateURL}Web/Images/Ver_2_0/DefaultUserPic.jpg" style="display:none;"
                                             onload="setWidthAndHeightImage(this, 35);"></img>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </td>
                            <td width="81%" class="verticallyMiddle">
                                <span class="userName13 onMouseOver"
                                      onclick="LoadEmployeeDetail('{UserID}','divClientPortalOperations_Container','{$PortalItemID}')">
                                    <xsl:value-of select="DisplayName"/>
                                </span>
                            </td>
                        </tr>

                    </table>
                </div>
            </xsl:for-each>
        </div>

    </xsl:template>
</xsl:stylesheet>
