﻿<?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:import href="../GenericTemplates/StringReplace.xslt"/>
	<xsl:import href="../Coaches/CoachesClientList.xslt"/>
	<xsl:import href="EmployeeNumberTabGraph.xslt"/>
	<xsl:import href="CoachManagerDisplay.xslt"/>
	<xsl:import href="ObserverDisplay.xslt"/>

	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">
		<xsl:variable name="UserID" select="AjaxRequest/Params/UserID"></xsl:variable>
		<xsl:variable name="Source" select="AjaxRequest/Params/Source"></xsl:variable>
		<xsl:variable name="UserName" select="AjaxRequest/User/UserData/DisplayName"></xsl:variable>
		<xsl:variable name="Email" select="AjaxRequest/User/UserData/Email"></xsl:variable>
		<xsl:variable name="UserImage" select="AjaxRequest/User/UserData/FbPicURL"></xsl:variable>
		<xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
		<xsl:variable name="HostName" select="AjaxRequest/HostName"></xsl:variable>
		<xsl:variable name="UserXML" select="AjaxRequest/PermissionXML/."></xsl:variable>
		<xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalID"></xsl:variable>
		<xsl:variable name="ClientManagersXML" select="AjaxRequest/ClientManagerXML/."/>
		<xsl:variable name="ManagersXML" select="AjaxRequest/ManagerXML/."/>
		<xsl:variable name="PermissionID" select="AjaxRequest/PermissionID"></xsl:variable>
		<xsl:variable name="PortalCoachManagerXML" select="AjaxRequest/PortalCoachManagerXML/."></xsl:variable>
		<xsl:variable name="PortalObserverXML" select="AjaxRequest/PortalObserverXML/."></xsl:variable>
		<xsl:variable name="SettingsXML" select="AjaxRequest/Settings/."></xsl:variable>
		<xsl:variable name="MasterPortalItemID" select="AjaxRequest/Settings/MasterPortalItemID"></xsl:variable>
		<xsl:variable name="LoggedInUserMasterPermissionID" select="AjaxRequest/LoggedInUserMasterPermissionID"></xsl:variable>
		<xsl:variable name="IsSecureConnection" select="AjaxRequest/IsSecureConnection"/>
		<xsl:variable name="LoggedInUserPermissionID" select="AjaxRequest/LoggedInUserPermissionID"></xsl:variable>
		<xsl:variable name="ClientManagerID" select="$PortalObserverXML/PortalObserver/ManagerUserID"></xsl:variable>
		<xsl:variable name="CoachManagerID" select="$PortalCoachManagerXML/PortalCoachManager/ManagerUserID"></xsl:variable>
		
		<xsl:variable name="Protocol">
			<xsl:choose>
				<xsl:when test="$IsSecureConnection = 1">
					<xsl:text>https://</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>http://</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="DisplayClientManagerDD">
			<xsl:choose>
				<xsl:when test="$ClientManagerID != ''">
					<xsl:text>none</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>inline</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="DisplayCoachManagerDD">
			<xsl:choose>
				<xsl:when test="$CoachManagerID != ''">
					<xsl:text>none</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>inline</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="DisplayClientManagerAddMoreButton">
			<xsl:choose>
				<xsl:when test="$ClientManagerID != ''">
					<xsl:text>inline</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>none</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="DisplayCoachManagerAddMoreButton">
			<xsl:choose>
				<xsl:when test="$CoachManagerID != ''">
					<xsl:text>inline</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>none</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="FormattedUserImage">
			<xsl:choose>
				<xsl:when test="$IsSecureConnection = 1">
					<xsl:call-template name="replaceCharsInString">
						<xsl:with-param name="stringIn" select="$UserImage"></xsl:with-param>
						<xsl:with-param name="charsIn">
							<xsl:text>http://</xsl:text>
						</xsl:with-param>
						<xsl:with-param name="charsOut">
							<xsl:text>https://</xsl:text>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$UserImage"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>


		<div id="div_EmployeeDetail_{$UserID}">
			<table class="tableMaster" cellpadding="0" cellspacing="0" >
				<tr>
					<td width="2%"></td>
					<td width="5%">
						<div id="div_UserImage_{$UserID}">
							<xsl:choose>
								<xsl:when test="$LoggedInUserMasterPermissionID &gt;= 4">
									<xsl:choose>
										<xsl:when test="$UserImage != ''">
											<img src="{$FormattedUserImage}" id="img_User_{$UserID}"
                                                 onload='setWidthAndHeightImage(this,"100");' class='marginTop5 onMouseOver' PortalItemID='{$PortalItemID}'
                                                 onclick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=Users&amp;cropRatio=2&amp;requiredHeight=135&amp;requiredWidth=135&amp;requiredFileName=Portrait&amp;Key=UploadPathUserImage&amp;UserID={$UserID}',
																'Upload_Image','530','390','{$UserID}','UploadUserImage','div_UserImage_{$UserID}',null,0);"></img>
										</xsl:when>
										<xsl:otherwise>
											<img src="{$TemplateURL}/Web/Images/Ver_2_0/DefaultUserPic.jpg" id="img_User_{$UserID}"
                                                 onload='setWidthAndHeightImage(this,"100");'
                                                 class='marginTop5 onMouseOver' PortalItemID='{$PortalItemID}'
                                                 onclick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=Users&amp;cropRatio=2&amp;requiredHeight=135&amp;requiredWidth=135&amp;requiredFileName=Portrait&amp;Key=UploadPathUserImage&amp;UserID={$UserID}',
																'Upload_Image','530','390','{$UserID}','UploadUserImage','div_UserImage_{$UserID}',null,0);"></img>
										</xsl:otherwise>
									</xsl:choose>

								</xsl:when>
								<xsl:otherwise>
									<xsl:choose>
										<xsl:when test="$UserImage != ''">
											<img src="{$FormattedUserImage}"
                                                 onload='setWidthAndHeightImage(this,"100");' class='marginTop5'></img>
										</xsl:when>
										<xsl:otherwise>
											<img src="{$TemplateURL}/Web/Images/Ver_2_0/DefaultUserPic.jpg"
                                                 onload='setWidthAndHeightImage(this,"100");'  class='marginTop5'></img>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:otherwise>
							</xsl:choose>
						</div>
					</td>
					<td width="58%" class="verticallyMiddle textLeft">
						<span id="span_UserName" class="labelGoalTitle sentenceFont marginLeft5">
							<xsl:choose>
								<xsl:when test="not(normalize-space(substring-before($UserName, '@')))">
									<xsl:value-of select="$UserName"></xsl:value-of>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="normalize-space(substring-before($UserName, '@'))"></xsl:value-of>
								</xsl:otherwise>
							</xsl:choose>
							<!--	<xsl:value-of select="$UserName"/>-->
						</span>
						<div id="span_UserEmail" class="publicationSummary marginLeft5">

							<xsl:value-of select="$Email"/>
						</div>
					</td>

					<td width="35%">
						<table class="tableMaster" cellpadding="2" cellspacing="1">
							<tr>
								<td width="20%" class="vertcallyMiddle">
									<div class="packageTitle marginRight5 textRight" style="padding-top:3px;">Coach/Manager:</div>
								</td>
								<td class="vertcallyMiddle" style="padding-top:3px;">
									<table id="tab_CoachManagers" class="tableMaster" cellpadding="0" cellspacing="1">
										<xsl:for-each select="$PortalCoachManagerXML/PortalCoachManager">
											<xsl:if test="position() mod 1 = 0">
												<tr id="tr_CoachManagers_{ManagerUserID}">
													<td id="td_CoachManagers"  width="50%" class="verticallyMiddle">
														<xsl:call-template name="CoachManagerDisplayTemplate">
															<xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
															<xsl:with-param name="ManagerUserID" select="ManagerUserID"></xsl:with-param>
															<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
															<xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
															<xsl:with-param name="ManagerName" select="ManagerName"></xsl:with-param>
															<xsl:with-param name="LoggedInUserPermissionID" select="$LoggedInUserPermissionID"></xsl:with-param>
														</xsl:call-template>
													</td>
												</tr>
											</xsl:if>
										</xsl:for-each>
										<tr id="tr_AddNewCoachManager">
											<td class="verticallyMiddle">
												<xsl:if test="$LoggedInUserPermissionID &gt;= 3">
													<span id="span_AddCoachManager" class="publicationSummary onMouseOver"
														  style="display:{$DisplayCoachManagerAddMoreButton};"
														  onclick="document.getElementById('opt_Manager').style.display='inline';
																   document.getElementById('opt_Manager').selectedIndex='0';
																   document.getElementById('span_AddCoachManager').style.display='none';"
														  onmouseover="document.getElementById('span_AddCoachManager').style.textDecoration='underline';"
														  onmouseout="document.getElementById('span_AddCoachManager').style.textDecoration='none';">Add More...</span>
												</xsl:if>
											</td>
										</tr>
									</table>
									<xsl:if test="$LoggedInUserPermissionID &gt;= 3">
										<select id="opt_Manager" class="smallDropdown" style="display:{$DisplayCoachManagerDD};"
												onchange="SaveCoachManager('opt_Manager','{$PortalItemID}','{$UserID}');">
											<option value="-99">-Select-</option>
											<xsl:for-each select="$ManagersXML/Manager">
												<option value="{UserID}">
													<xsl:value-of select="DisplayName"/>
												</option>
											</xsl:for-each>
										</select>
									</xsl:if>
								</td>
							</tr>
							<xsl:if test="$PermissionID = 0 or $PermissionID=-1 or $PermissionID=-2">
								<tr>
									<td class="vertcallyMiddle">
										<div class="packageTitle marginRight5 textRight">Observer:</div>
									</td>
									<td class="vertcallyMiddle">
										<table id="tab_Observers" class="tableMaster" cellpadding="0" cellspacing="1">
											<xsl:for-each select="$PortalObserverXML/PortalObserver">
												<xsl:if test="position() mod 1 = 0">
													<tr id="tr_Observers_{ManagerUserID}">
														<td id="td_Observers" width="50%">
															<xsl:call-template name="ObserverDisplayTemplate">
																<xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
																<xsl:with-param name="ManagerUserID" select="ManagerUserID"></xsl:with-param>
																<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
																<xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
																<xsl:with-param name="ManagerName" select="ManagerName"></xsl:with-param>
																<xsl:with-param name="LoggedInUserPermissionID" select="$LoggedInUserPermissionID"></xsl:with-param>
															</xsl:call-template>
														</td>
													</tr>
												</xsl:if>
											</xsl:for-each>
											<tr id="tr_AddNewObserver">
												<td>
													<xsl:if test="$LoggedInUserPermissionID &gt;= 3">
														<span id="span_AddObserver" class="publicationSummary onMouseOver" style="display:{$DisplayClientManagerAddMoreButton};"
															  onclick="document.getElementById('opt_ClientManager').style.display='inline';
                                                                   document.getElementById('span_AddObserver').style.display='none';"
															  onmouseover="document.getElementById('span_AddObserver').style.textDecoration='underline';"
															  onmouseout="document.getElementById('span_AddObserver').style.textDecoration='none';">Add More...</span>
													</xsl:if>
												</td>
											</tr>
										</table>
										<xsl:if test="$LoggedInUserPermissionID &gt;= 3">
											<select id="opt_ClientManager" class="smallDropdown" style="display:{$DisplayClientManagerDD};"
													onchange="AdminOptionClientManager('opt_ClientManager','{$PortalItemID}','{$UserID}');">
												<option value="-99">-Select-</option>
												<xsl:for-each select="$ClientManagersXML/ClientManager">
													<option value="{UserID}">
														<xsl:value-of select="DisplayName"/>
													</option>
												</xsl:for-each>
											</select>
										</xsl:if>
									</td>
								</tr>
							</xsl:if>
						</table>
					</td>

				</tr>
				<tr>
					<td colspan="4">
						<table class="tableMaster" cellpadding="0" cellspacing="0">
							<tr>
								<td width="1%" style="border-bottom:1px solid #5E5E5E;"></td>
								<td width="85%">
									<div class="goalTabsBackground marginTop10">
										<table class="tableMaster textCenter verticallyMiddle capitalFont" height="32px"
                                                cellSpacing="0" cellPadding="0" >

											<xsl:choose>
												<xsl:when test="$PermissionID &gt;= -2 and $PermissionID &lt;= 0">
													<xsl:for-each select="$SettingsXML/ProfileTabs/ClientProfileTabs/Tab[Display='true']">
														<xsl:call-template name="ProfileMenuTabs">
															<xsl:with-param name="SettingsXML" select="$SettingsXML"></xsl:with-param>
															<xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
															<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
															<xsl:with-param name="Source" select="$Source"></xsl:with-param>
															<xsl:with-param name="MasterPortalItemID" select="$MasterPortalItemID"></xsl:with-param>
														</xsl:call-template>
													</xsl:for-each>
												</xsl:when>
												<xsl:otherwise>
													<xsl:for-each select="$SettingsXML/ProfileTabs/TeamMemberProfileTabs/Tab[Display='true']">
														<xsl:call-template name="ProfileMenuTabs">
															<xsl:with-param name="SettingsXML" select="$SettingsXML"></xsl:with-param>
															<xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
															<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
															<xsl:with-param name="Source" select="$Source"></xsl:with-param>
															<xsl:with-param name="MasterPortalItemID" select="$MasterPortalItemID"></xsl:with-param>
														</xsl:call-template>
													</xsl:for-each>
												</xsl:otherwise>
											</xsl:choose>


										</table>
									</div>
								</td>
								<td width="14%" style="border-bottom:1px solid #5E5E5E;">
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		<div id="Employee_NumberDetails">
			<div id="Employee_Operations_Filters" style="padding:10px;" class="marginTop10">

			</div>
			<div id="Employee_NumberTabData_Container" style="padding:10px;" class="marginTop10">
				<table class="tableMaster" cellpadding="0" cellspacing="0">
					<tr>
						<td width="70%">
							<xsl:call-template name="NumberTabGraph">
								<xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
								<xsl:with-param name="UserID" select="$UserID"></xsl:with-param>
							</xsl:call-template>
						</td>
						<td width="30%">
							<div id="Employee_NumberTabData">
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</xsl:template>




	<xsl:template name="ProfileMenuTabs">
		<xsl:param name="SettingsXML" select="'N/A'"></xsl:param>
		<xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
		<xsl:param name="UserID" select="'N/A'"></xsl:param>
		<xsl:param name="Source" select="'N/A'"></xsl:param>
		<xsl:param name="MasterPortalItemID" select="'N/A'"></xsl:param>

		<xsl:variable name="Version">
			<xsl:value-of select="$SettingsXML/BetaVersion"/>
		</xsl:variable>
		<xsl:variable name="MenuTabClass">
			<xsl:choose>
				<xsl:when test="Display = 'true' and position() = 1">
					<xsl:text>selectedMenuGoalTabs</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>defaultMenuGoal</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="TDIDs">
			<xsl:choose>
				<xsl:when test="Name = 'goals'">
					<xsl:text>cell_Goals</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'worksheets'">
					<xsl:text>cell_Worksheets</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'scorecard'">
					<xsl:text>cell_Scoreboard</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'opportunities'">
					<xsl:text>cell_Opportunities</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'numbers'">
					<xsl:text>cell_Numbers</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'notes'">
					<xsl:text>cell_Notes</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'tasks'">
					<xsl:text>cell_Tasks</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'usage'">
					<xsl:text>cell_Usage</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'Numbers_3_0'">
					<xsl:text>cell_Numbers_3_0</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'Activities_3_0'">
					<xsl:text>cell_Activities_3_0</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'Pipeline'">
					<xsl:text>cell_Pipeline</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'coaching'">
					<xsl:text>cell_Coaching</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'BusinessPlanning'">
					<xsl:text>cell_BusinessPlanning</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'UserDashboard'">
					<xsl:text>cell_</xsl:text>
					<xsl:value-of select="DashboardKey"/>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="OnClickFunction">
			<xsl:choose>
				<xsl:when test="Name = 'UserDashboard'">
					<xsl:text>LoadUserDashboard(</xsl:text>
					<xsl:value-of select="$MasterPortalItemID"/>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>,'Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="DashboardKey"/>
					<xsl:text>');</xsl:text>  
				</xsl:when>
				<xsl:when test="Name = 'coaching'">
					<xsl:text>LoadCoachingDashboard_3_0(</xsl:text>
					<xsl:value-of select="$MasterPortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>, 'Employee_Operations_Filters');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'goals'">
					<xsl:text>Corporate_getCorporateEmployeeDetails('</xsl:text>
					<xsl:text>Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>','4','</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>','0',1);</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'worksheets'">
					<xsl:text>portal_loadUserSurveys('</xsl:text>
					<xsl:text>Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>','</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>','</xsl:text>
					<xsl:number value="1"/>
					<xsl:text>','</xsl:text>
					<xsl:text>Header</xsl:text>
					<xsl:text>');</xsl:text>
					<xsl:text>DisplayEmployeeNumberTab('</xsl:text>
					<xsl:text>Employee_NumberTabData_Container','</xsl:text>
					<xsl:value-of select="$TDIDs"/>
					<xsl:text>');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'scorecard'">
					<xsl:text>portal_LoadMyScoreboard('</xsl:text>
					<xsl:value-of select="$PortalItemID"></xsl:value-of>
					<xsl:text>','Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$UserID"></xsl:value-of>
					<xsl:text>','Monthly');</xsl:text>
					<xsl:text>DisplayEmployeeNumberTab('</xsl:text>
					<xsl:text>Employee_NumberTabData_Container','</xsl:text>
					<xsl:value-of select="$TDIDs"/>
					<xsl:text>');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'opportunities'">
					<xsl:text>portal_LoadCRMOpportunitiesAndReports('</xsl:text>
					<xsl:value-of select="$PortalItemID"></xsl:value-of>
					<xsl:text>','Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$UserID"></xsl:value-of>
					<xsl:text>', 0, 25, 1, 0);</xsl:text>
					<xsl:text>DisplayEmployeeNumberTab('</xsl:text>
					<xsl:text>Employee_NumberTabData_Container','</xsl:text>
					<xsl:value-of select="$TDIDs"/>
					<xsl:text>');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'numbers'">
					<xsl:text>LoadNumberTabLayout('</xsl:text>
					<xsl:text>Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$PortalItemID"></xsl:value-of>
					<xsl:text>','</xsl:text>
					<xsl:value-of select="$UserID"></xsl:value-of>
					<xsl:text>','</xsl:text>
					<xsl:number value="1"/>
					<xsl:text>');</xsl:text>
					<xsl:text>DisplayEmployeeNumberTab('</xsl:text>
					<xsl:text>Employee_NumberTabData_Container','</xsl:text>
					<xsl:value-of select="$TDIDs"/>
					<xsl:text>');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'tasks'">
					<xsl:choose>
						<xsl:when test="$Version >= 3">
							<xsl:text>LoadPortalUserTasks_3_0('</xsl:text>
							<xsl:text>Employee_Operations_Filters','</xsl:text>
							<xsl:value-of select="$PortalItemID"/>
							<xsl:text>','</xsl:text>
							<xsl:value-of select="$UserID"></xsl:value-of>
							<xsl:text>','</xsl:text>
							<xsl:number value="1"/>
							<xsl:text>','</xsl:text>
							<xsl:text>Header</xsl:text>
							<xsl:text>');</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>LoadPortalUserTasks('</xsl:text>
							<xsl:text>Employee_Operations_Filters','</xsl:text>
							<xsl:value-of select="$PortalItemID"/>
							<xsl:text>','</xsl:text>
							<xsl:value-of select="$UserID"></xsl:value-of>
							<xsl:text>','</xsl:text>
							<xsl:number value="1"/>
							<xsl:text>','</xsl:text>
							<xsl:text>Header</xsl:text>
							<xsl:text>');</xsl:text>

						</xsl:otherwise>
					</xsl:choose>

				</xsl:when>
				<xsl:when test="Name = 'notes'">
					<xsl:text>LoadPortalUserNotes('</xsl:text>
					<xsl:text>Employee_Operations_Filters','</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>','</xsl:text>
					<xsl:value-of select="$UserID"></xsl:value-of>
					<xsl:text>','</xsl:text>
					<xsl:number value="1"/>
					<xsl:text>','</xsl:text>
					<xsl:text>Header</xsl:text>
					<xsl:text>');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'Numbers_3_0'">
					<xsl:text>LoadMyNumbersDashboard_3_0_Data(</xsl:text>
					<xsl:value-of select="$MasterPortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>, 'Employee_Operations_Filters');</xsl:text>
				</xsl:when>
				<xsl:when test="Name = 'Activities_3_0'">
					<xsl:text>LoadMyActivityDashboard_3_0(</xsl:text>
					<xsl:value-of select="$MasterPortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>, </xsl:text>
					<xsl:text>null</xsl:text>
					<xsl:text>, 'Employee_Operations_Filters');</xsl:text>
				</xsl:when>
				<xsl:when test="Name='Pipeline'">
					<xsl:text>portal_LoadMyPipeline(</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>, </xsl:text>
					<xsl:text>'Employee_Operations_Filters'</xsl:text>
					<xsl:text>, </xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>, 0, 25, 1);</xsl:text>
				</xsl:when>
				<xsl:when test="Name='BusinessPlanning'">
					<xsl:text>LoadBusinessPlanningDashboard(</xsl:text>
					<xsl:value-of select="$MasterPortalItemID"/>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$PortalItemID"></xsl:value-of>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>, 'Employee_Operations_Filters');</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<td width="10.625%" id="{$TDIDs}" class="textCenter verticallyMiddle {$MenuTabClass} padding2"
                   name="GoalMenuAction" source="{$Source}">
			<span id="span_Goals" class="onMouseOver"
                  onClick="{$OnClickFunction}
                           goal_HightlightSelectedLink('{$TDIDs}','defaultMenuGoal','selectedMenuGoalTabs','GoalMenuAction',0);">
				<xsl:choose>
					<xsl:when test="DisplayName and DisplayName != ''">
						<xsl:value-of select="DisplayName"/>
					</xsl:when>
					<xsl:when test="Name = 'goals'">
						<xsl:text>Programs</xsl:text>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="Name"/>
					</xsl:otherwise>
				</xsl:choose>
			</span>
		</td>
	</xsl:template>
</xsl:stylesheet>
