﻿<?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="TopMenuBar.xslt"/>
	<xsl:import href="../GenericTemplates/StringReplace.xslt"/>

	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">
		<xsl:variable name="LogOffURL" select="AjaxRequest/LogOffURL"></xsl:variable>
		<xsl:variable name="Settings" select="AjaxRequest/Settings/."></xsl:variable>
		<xsl:variable name="CustomXML" select="AjaxRequest/Settings/CustomXML"></xsl:variable>
		<xsl:variable name="BrandXml" select="AjaxRequest/UserBrands/."></xsl:variable>
		<xsl:variable name="MBrandID" select="AjaxRequest/Params/MBrandID"></xsl:variable>
		<xsl:variable name="PortalItemID" select="AjaxRequest/PortalItemID"></xsl:variable>
		<xsl:variable name="MasterPortalItemID">
			<xsl:choose>
				<xsl:when test="AjaxRequest/Params/MBrandItemID[text()]">
					<xsl:value-of select="normalize-space(AjaxRequest/Params/MBrandItemID)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="AjaxRequest/Settings/MasterPortalItemID"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="GoalItemID" select="normalize-space(AjaxRequest/Params/ItemID)" />
		<xsl:variable name="ItemFolders" select="AjaxRequest/ItemFolders/."></xsl:variable>
		<xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>
		<xsl:variable name="IsSecureConnection" select="AjaxRequest/IsSecureConnection"></xsl:variable>
		<xsl:variable name="LoggedInUser" select="AjaxRequest/LoggedInUser/User/UserData"></xsl:variable>
		<xsl:variable name="OwnerID" select="AjaxRequest/OwnerID"></xsl:variable>
		<xsl:variable name="OwnerName" select="AjaxRequest/OwnerName"></xsl:variable>
		<xsl:variable name="PermissionID" select="normalize-space(AjaxRequest/Permissions/ItemPermission/PermissionID)"></xsl:variable>
		<xsl:variable name="HideTop" select="AjaxRequest/Params/HideTop"></xsl:variable>
		<xsl:variable name="Theme" select="AjaxRequest/Settings/Theme"></xsl:variable>
		<xsl:variable name="currentModule" select="AjaxRequest/Settings/Module"></xsl:variable>
		<xsl:variable name="DeepURL" select="AjaxRequest/Settings/DeepURL/@active"></xsl:variable>
		<xsl:variable name="IsCoach">
			<xsl:choose>
				<xsl:when test="AjaxRequest/Permissions/ItemPermission/Coach[text()]">
					<xsl:value-of select="normalize-space(AjaxRequest/Permissions/ItemPermission/Coach)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:number value="0"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="IsParticipant">
			<xsl:choose>
				<xsl:when test="AjaxRequest/Permissions/ItemPermission/Participant[text()]">
					<xsl:value-of select="normalize-space(AjaxRequest/Permissions/ItemPermission/Participant)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:number value="0"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="PostCall" select="AjaxRequest/PostCall/."></xsl:variable>
		<xsl:variable name="ItemDetail" select="AjaxRequest/ItemDetailData/ItemDetail/."></xsl:variable>
		<xsl:variable name="ItemName" select="AjaxRequest/Params/Item"></xsl:variable>
		<xsl:variable name="ItemImageURL" select="AjaxRequest/Params/ItemImageURL"></xsl:variable>
		<xsl:variable name="SuccessKey" select="normalize-space(AjaxRequest/Params/SuccessKey)"></xsl:variable>
		<xsl:variable name="Action" select="AjaxRequest/Action"></xsl:variable>
		<xsl:variable name="GoalXML" select="AjaxRequest/Items/Item"></xsl:variable>
		<xsl:variable name="PortalTypeID" select="AjaxRequest/Params/PortalTypeID"></xsl:variable>
		<xsl:variable name="PortalID" select="AjaxRequest/Params/PortalID"></xsl:variable>
		<xsl:variable name="SelectedUserID" select="AjaxRequest/Params/SelectedUserID"></xsl:variable>
		<xsl:variable name="LoadType" select="AjaxRequest/Params/LoadType"></xsl:variable>
		<xsl:variable name="ViewID" select="AjaxRequest/Params/ViewID"></xsl:variable>
		<xsl:variable name="divID" select="AjaxRequest/Params/divID"></xsl:variable>
		<xsl:variable name="Authenticated" select="AjaxRequest/Authenticated"></xsl:variable>
		<xsl:variable name="MBrandItemID" select="AjaxRequest/Params/MBrandItemID"></xsl:variable>
		<xsl:variable name="OpenTo" select="AjaxRequest/OpenTo"></xsl:variable>
		<xsl:variable name="EnterprisePermissionID" select="AjaxRequest/EnterprisePermissionID"></xsl:variable>
		<xsl:variable name="ItemPermissionID" select="AjaxRequest/ItemPermissionID"></xsl:variable>
		<xsl:variable name="EscapedItemName">
			<xsl:call-template name="replaceCharsInString">
				<xsl:with-param name="stringIn" select="$ItemName"></xsl:with-param>
				<xsl:with-param name="charsIn">
					<xsl:text>'</xsl:text>
				</xsl:with-param>
				<xsl:with-param name="charsOut">
					<xsl:text>\'</xsl:text>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:variable>
		<xsl:variable name="RoleName">
			<xsl:choose>
				<xsl:when test="normalize-space(AjaxRequest/UserRoles/Role[RoleName = 'Brand Admin'])">
					<xsl:text>True</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>False</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</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="ClientManagerItemID">
			<xsl:choose>
				<xsl:when test="AjaxRequest/UserBrands/Brand[(PermissionID >= -2) 
                          and (ItemID = $MasterPortalItemID or ParentPortalItemID = $MasterPortalItemID)]/ItemID[text()]">
					<xsl:value-of select="AjaxRequest/UserBrands/Brand[(PermissionID >= -2) 
                                  and (ItemID = $MasterPortalItemID or ParentPortalItemID = $MasterPortalItemID)]/ItemID"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:number value="0"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="BusinessPlanCall">
			<xsl:text>LoadBusinessPlanningDashboard(</xsl:text>
			<xsl:value-of select="$MasterPortalItemID"/>
			<xsl:text>, </xsl:text>
			<xsl:value-of select="$PortalItemID"/>
			<xsl:text>,</xsl:text>
			<xsl:value-of select="$OwnerID"></xsl:value-of>
			<xsl:text>, 'div_Goal_</xsl:text>
			<xsl:value-of select="$GoalItemID"/>
			<xsl:text>_Operations',1);</xsl:text>
		</xsl:variable>
		<xsl:variable name="LogoClick">
			<xsl:choose>
				<xsl:when test="$SuccessKey = 'Number'">
					<!--LoadNumberGoal_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations',1,1,7);-->
					LoadMyNumbersDashboard_3_0_Goal(<xsl:value-of select="$MasterPortalItemID"/>, <xsl:value-of select="$GoalItemID"/>
					,'div_Goal_<xsl:value-of select="$GoalItemID"/>_Operations');
				</xsl:when>
				<xsl:when test="$SuccessKey = 'BusinessPlanning'">
					<xsl:value-of select="$BusinessPlanCall"/>
				</xsl:when>
				<xsl:when test="$SuccessKey = 'Coaching'">
					LoadCoachingDashboard_3_0(<xsl:value-of select="$MasterPortalItemID"/>
					,<xsl:value-of select="$PortalItemID"/>
					, <xsl:value-of select="$OwnerID"/>
					,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations');
				</xsl:when>
				<xsl:when test="$SuccessKey='Pipeline'">
					<xsl:text>
					portal_LoadMyPipeline3_0(</xsl:text>
					<xsl:value-of select="$PortalItemID"/>
					<xsl:text>, 'div_Goal_</xsl:text>
					<xsl:value-of select="$GoalItemID"></xsl:value-of>
					<xsl:text>_Operations',</xsl:text>
					<xsl:value-of select="$OwnerID"/>
					<xsl:text>, 0, 25, 1,</xsl:text>
					<xsl:value-of select="$GoalItemID"></xsl:value-of>
					<xsl:text>);</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:choose>
						<xsl:when test="$IsCoach = 1 and $IsParticipant = 0">
							LoadGoalActionDashboard_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>
							,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations'
							, 0);
						</xsl:when>
						<xsl:otherwise>
							LoadGoalActionDashboard_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>
							,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations'
							, <xsl:value-of select="$LoggedInUser/UserID"/>);
						</xsl:otherwise>
					</xsl:choose>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:choose>
			<xsl:when test="$HideTop ='Yes'">
				<style>
					.ritetheme {
					top: 26px;
					padding-left:0px;padding-right:0px;
					}
				</style>

			</xsl:when>
			<xsl:otherwise>
				<xsl:if test="$Action='LoadGoal'">
					<xsl:call-template name="TopMenuBar">
						<xsl:with-param name="Settings" select="$Settings"></xsl:with-param>
						<xsl:with-param name="BrandXml" select="$BrandXml"></xsl:with-param>
						<xsl:with-param name="CustomXML" select="$CustomXML"></xsl:with-param>
						<xsl:with-param name="LogOffURL" select="$LogOffURL"></xsl:with-param>
						<xsl:with-param name="Protocol" select="$Protocol"></xsl:with-param>
						<xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
						<xsl:with-param name="MBrandItemID" select="$MasterPortalItemID"></xsl:with-param>
						<xsl:with-param name="ClientManagerItemID" select="$ClientManagerItemID"></xsl:with-param>
						<xsl:with-param name="LoggedInUser" select="$LoggedInUser"></xsl:with-param>
						<xsl:with-param name="MenuType">
							<xsl:text>Short</xsl:text>
						</xsl:with-param>
					</xsl:call-template>
				</xsl:if>
			</xsl:otherwise>
		</xsl:choose>

		<xsl:variable name="ContainerClass">
			<xsl:choose>
				<xsl:when test="$Action='LoadGoal'">
					<xsl:text>container-fluid</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text></xsl:text>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:variable>
		<xsl:variable name="RightSecWidth">
			<xsl:choose>
				<xsl:when test="$LoadType = 'QuickStart'">
					<xsl:text>width:100% !important;</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text></xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="ShowHideTaskFunction">
			<xsl:choose>
				<xsl:when test="$LoadType = 'QuickStart'">
					<xsl:text></xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>ShowHideTask('ddl_EmployeeBoxTask','span_EmployeeBoxTask');</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="ShowHideTaskHover">
			<xsl:choose>
				<xsl:when test="$LoadType = 'QuickStart'">
					<xsl:text>cursor:default</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text></xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<div class="{$ContainerClass}">
			<script>removeWorksheetCss();</script>

			<xsl:choose>
				<xsl:when test="$PermissionID &gt;= 0">
					<!-- header -->
					<div id="divMainGoal" class="row bord">
						<xsl:variable name="ShowLeftMenu">
							<xsl:choose>
								<xsl:when test="$LoadType = 'QuickStart'">
									<xsl:text>display:none;</xsl:text>
								</xsl:when>
								<xsl:otherwise>
									<xsl:text></xsl:text>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:variable>
						<div class="col-lg-1 pading left-section1" style="{$ShowLeftMenu}" >

							<xsl:variable name="FormattedImageURL">
								<xsl:choose>
									<xsl:when test="$IsSecureConnection = 1 and $ItemImageURL !=''">
										<xsl:call-template name="replaceCharsInString">
											<xsl:with-param name="stringIn" select="$ItemImageURL"></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="$ItemImageURL"/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:variable>

							<a href="javascript:void(0);">
								<h5 id="lnk_{$GoalItemID}_Goal" class="HideH"
									onclick="{$LogoClick}
									SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','{$ItemName}',1);
									document.getElementById('slidepanel').style.display='none';">
									<span class="heding">
										<img src="{$FormattedImageURL}" id="GoalImg_{$GoalItemID}"></img>
									</span>
									<!--<span class="heding HideSpn" >
										<xsl:value-of select="$ItemName"/>
									</span>-->
								</h5>
							</a>
							<div class="navbar-header">
								<button id="btnGoalMenu" type="button" class="navbar-toggle LeftTogle" data-toggle="collapse" data-target="#myNavbarLeft">
									<span class="icon-bar" style="background: #000;"></span>
									<span class="icon-bar" style="background: #000;"></span>
									<span class="icon-bar" style="background: #000;"></span>
								</button>
							</div>
							<div class="navbar-collapse collapse" id="myNavbarLeft" style="padding:0px;">
								<ul class="nav navbar-nav text-left">
									<xsl:if test="$SuccessKey = 'Number'">
										<li onclick="SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Numbers',0);
											LoadMyNumbersDashboard_3_0_Goal({$MasterPortalItemID},{$GoalItemID},'div_Goal_{$GoalItemID}_Operations');
											document.getElementById('slidepanel').style.display='none';">
											<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo1" class="CentrImg">
												<span>
													<img src="{$Protocol}{$HostName}/image/graph.png" Title="Numbers"></img>
												</span>
												<span class="HideSpn">Numbers</span>
											</a>
											<div id="demo1" class="collapse">

											</div>
										</li>
										<li onclick="SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Numbers',0);
											LoadNumberGoal_3_0({$GoalItemID},'div_Goal_{$GoalItemID}_Operations',1,1,7);
											document.getElementById('slidepanel').style.display='none';">
											<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo1" class="CentrImg">
												<span>
													<i class="glyphicon glyphicon-th-large" style="font-size: 19px;  color: #929292;  vertical-align: top; "></i>
												</span>
												<span class="HideSpn">Grid</span>
											</a>
											<div id="demo1" class="collapse">

											</div>
										</li>
									</xsl:if>
									<xsl:if test="$SuccessKey != 'Number'">
										<li>
											<a id="btnHomeGoalClick30" href="javascript:void(0);" data-toggle="collapse" data-target="#demo2" class="CentrImg" onclick="{$LogoClick}
									SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Home',0);
									document.getElementById('slidepanel').style.display='none';">
												<span Title="Home">
													<i class="glyphicon glyphicon-home" style="  font-size: 19px;  color: #929292;  /* vertical-align: top; */"></i>
												</span>
												<span class="HideSpn" >	Home	</span>
											</a>
											<div id="demo2" class="">
											</div>
										</li>
									</xsl:if>
									<li>
										<!--<a href="#" data-toggle="collapse" data-target="#demo2" class="CentrImg"
										   onclick="SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Topics',0);LoadActionGoalTopic_3_0({$GoalItemID},'div_Goal_{$GoalItemID}_Operations');document.getElementById('slidepanel').style.display='none';">-->
										<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo2" class="CentrImg"
										   onclick="SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Topics',0);
										   LoadActionGoalTopic_3_0({$GoalItemID},'div_Goal_{$GoalItemID}_Operations');
										   document.getElementById('slidepanel').style.display='none';removeWorksheetCss();">
											<span>
												<img src="{$Protocol}{$HostName}/image/topics.png" Title="Topics"></img>
											</span>
											<span class="HideSpn">
												Topics
											</span>
										</a>
										<div id="demo2" class="">
											<!--<table>
												<xsl:for-each select="$ItemDetail/ItemData">
													<tr>
														<td onclick="">
															<a href="javascript:void(0);" onClick="LoadCoreGoalTask_3_0('{$GoalItemID}', 'div_Goal_{$GoalItemID}_Operations', '', '', 1,'{ItemID}')">
																<xsl:value-of select="./Item"/>
															</a>
														</td>
													</tr>
												</xsl:for-each>
											</table>-->

										</div>
									</li>
									<li onclick="$('#ddl_{$GoalItemID}_TopicFilter').val($('#ddl_{$GoalItemID}_TopicFilter option:first').val());
										SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Tasks',0);
										LoadGoalTask_3_0({$GoalItemID},'div_Goal_{$GoalItemID}_Operations','Topic','asc',1);
										document.getElementById('slidepanel').style.display='none';removeWorksheetCss();">
										<a href="javascript:void(0);" id="lnkTask30" data-toggle="collapse" data-target="#demo3" class="CentrImg" Title="Tasks">
											<span>
												<img src="{$Protocol}{$HostName}/image/tasks.png" Title="Tasks"></img>
											</span>
											<span class="HideSpn">Tasks</span>
										</a>
										<div id="demo3" class="collapse">

										</div>
									</li>
									<li onclick="removeWorksheetCss();SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Notes',0);goal_LoadNotebook('div_Goal_{$GoalItemID}_Operations',{$GoalItemID});document.getElementById('slidepanel').style.display='none';">
										<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo4" class="CentrImg" Title="Notes">
											<span>
												<img src="{$Protocol}{$HostName}/image/notes.png" Title="Notes"></img>
											</span>
											<span class="HideSpn">Notes</span>
										</a>
										<div id="demo4" class="collapse">

										</div>
									</li>
									<li>
										<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo5" class="CentrImg" Title="Resources">
											<span>
												<img src="{$Protocol}{$HostName}/image/resources.png" Title="Resources"></img>
											</span>
											<span class="HideSpn">Resources</span>
										</a>
										<div id="demo5" class="collapse">

										</div>
									</li>
									<xsl:choose>
										<xsl:when test="$PermissionID &gt; 0">
											<li onclick="removeWorksheetCss();SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Security',0);Dashboard_GoalShareIt_Version2('div_Goal_{$GoalItemID}_Operations',{$GoalItemID});document.getElementById('slidepanel').style.display='none';">
												<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo6" class="CentrImg" Title="Security">
													<span>
														<img src="{$Protocol}{$HostName}/image/security.png" Title="Security"/>
													</span>
													<span class="HideSpn">Security</span>
												</a>
												<div id="demo6" class="collapse">

												</div>
											</li>
										</xsl:when>
									</xsl:choose>
									<xsl:choose>
										<xsl:when test="$PermissionID &gt; 0">
											<li onclick="removeWorksheetCss();SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','Settings',0);">
												<a href="javascript:void(0);" Title="Setting" class="CentrImg" onclick="DisplayGoalSetting_3_0('{$GoalItemID}','div_Goal_{$GoalItemID}_Operations');document.getElementById('slidepanel').style.display='none';">
													<img src="{$Protocol}{$HostName}/image/Setting.png" Title="Setting"/>
													<span class="HideSpn">Settings</span>
												</a>
											</li>
										</xsl:when>
									</xsl:choose>
									<li onclick="removeWorksheetCss();Goal_LoadDetailXml({$GoalItemID},'div_Goal_{$GoalItemID}_Operations','span_MyProgress_{$GoalItemID}', 0, 1, 7);
							SetTitleOfGoal_3_0('span_{$GoalItemID}_GoalTitle','{$ItemName}',1);document.getElementById('slidepanel').style.display='none';">
										<a href="javascript:void(0);" data-toggle="collapse" data-target="#demo5" class="CentrImg" Title="Resources">
											<span>
												<img src="{$Protocol}{$HostName}/image/goal.png" Title="Resources"></img>
											</span>
											<span class="HideSpn">
												Outline
											</span>
										</a>
										<div id="demo5" class="collapse">

										</div>
									</li>
								</ul>
							</div>
						</div>
						<div id="divMainGoalSubDiv" class="col-lg-11 RiteTxt right-section1" style="{$RightSecWidth}">
							<h2 class="txt colr NW" >
								<!--<span >
									<img src="{$ItemImageURL}" class="HeadingImg"/>
								</span>-->
								<span class="spanTask" id="span_EmployeeBoxTask" onclick="{$ShowHideTaskFunction}" style="{$ShowHideTaskHover}">
									<xsl:choose>
										<xsl:when test="$LoggedInUser/UserID != $OwnerID">
											<xsl:choose>
												<xsl:when test="not(normalize-space(substring-before($OwnerName, '@')))">
													<xsl:value-of select="$OwnerName"></xsl:value-of>:
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="normalize-space(substring-before($OwnerName, '@'))"></xsl:value-of>:
												</xsl:otherwise>
											</xsl:choose>
										</xsl:when>
									</xsl:choose>
									<xsl:value-of select="$ItemName"/>
								</span>
								<xsl:choose>
									<xsl:when test="$LoadType = 'QuickStart'">
										<xsl:text></xsl:text>
									</xsl:when>
									<xsl:otherwise>
										<select id="ddl_EmployeeBoxTask" style="display:none"  PrevGoalID="{$GoalItemID}" Protocol="{$Protocol}" HostName="{$HostName}" onchange="reLoadGoal_3_0('{$divID}','{$PortalTypeID}','{$PortalID}','{$Action}','{$SelectedUserID}','{$LoadType}');">
											<xsl:for-each select="$GoalXML">
												<xsl:sort select="Item"/>
												<xsl:choose>
													<xsl:when test="$GoalItemID=ItemID">
														<option value="{ItemID}" selected="selected" imgURL="{ImageURL}" succKey="{SuccessKey}">
															<xsl:value-of select="Item" />
														</option>
													</xsl:when>
													<xsl:otherwise>
														<option value="{ItemID}" imgURL="{ImageURL}" succKey="{SuccessKey}">
															<xsl:value-of select="Item" />
														</option>
													</xsl:otherwise>
												</xsl:choose>

											</xsl:for-each>
										</select>

									</xsl:otherwise>
								</xsl:choose>
								<span class="glyphicon glyphicon-menu-right" style="display:none" id="glyph">
								</span>
								<span class="spanTask" id="span_{$GoalItemID}_GoalTitle"></span>
							</h2>
							<xsl:if test="$LoadType='SameWindow' or $LoadType='MyActivity' or $LoadType = 'QuickStart'">
								<xsl:variable name="goalHref">
									<xsl:choose>
										<xsl:when test="$DeepURL = 1">
											<xsl:value-of select="$Protocol"/>
											<xsl:value-of select="$HostName"/>
											<xsl:text>/</xsl:text>
											<xsl:value-of select="$currentModule"/>
											<xsl:text>/</xsl:text>
											<xsl:value-of select="$MasterPortalItemID"/>
											<xsl:text>/Programs/</xsl:text>
											<xsl:value-of select="$GoalItemID"/>
										</xsl:when>
										<xsl:when test="$Theme/@active ='true' and $Theme/@transformBaseTemplatePath='false'">
											<xsl:value-of select="$Protocol"/>
											<xsl:value-of select="$HostName"/>
											<xsl:text>/Program/</xsl:text>
											<xsl:value-of select="$GoalItemID"/>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="$Protocol"/>
											<xsl:value-of select="$HostName"/>
											<xsl:text>/Goal.aspx?ID=</xsl:text>
											<xsl:value-of select="$GoalItemID"/>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
								<a id="btnOpenNewWindowGoal" title="Open Goal in New Window" class="OpenNewTabAnchor" href="{$goalHref}" target="_blank" >
									<img class="verticallyMiddle" src="{$Protocol}{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/Ver_2_0/BT_goalNewWindow.png" style="border: 0px; cursor: pointer;"
									onmouseover="this.src='{$Protocol}{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/Ver_2_0/BT_goalNewWindow_hover.png';this.style.cursor='pointer';"
									onmouseout="this.src='{$Protocol}{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/Ver_2_0/BT_goalNewWindow.png';"/>
								</a>
							</xsl:if>
							<div class="goalOperationBackground RiteIner" id="div_Goal_{$GoalItemID}_Operations">
								<script>
									<xsl:choose>
										<xsl:when test="$SuccessKey = 'Number'">
											<xsl:choose>
												<xsl:when test="not($ViewID) or $ViewID=''">
													<!--LoadNumberGoal_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations',1,1,7);-->
													LoadMyNumbersDashboard_3_0_Goal(<xsl:value-of select="$MasterPortalItemID"/>, <xsl:value-of select="$GoalItemID"/>
													,'div_Goal_<xsl:value-of select="$GoalItemID"/>_Operations');
												</xsl:when>
												<xsl:otherwise>
													SetTitleOfGoal_3_0('span_<xsl:value-of select="$GoalItemID"></xsl:value-of>_GoalTitle','Tasks',0);LoadGoalTask_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations','Topic','asc',1,<xsl:value-of select="$ViewID"></xsl:value-of>);
												</xsl:otherwise>
											</xsl:choose>
										</xsl:when>
										<xsl:when test="$SuccessKey = 'Coaching'">
											LoadCoachingDashboard_3_0(<xsl:value-of select="$MasterPortalItemID"/>
											,<xsl:value-of select="$PortalItemID"/>
											, <xsl:value-of select="$OwnerID"/>
											,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations');
										</xsl:when>
										<xsl:when test="$SuccessKey='Pipeline'">
											<xsl:text>portal_LoadMyPipeline3_0(</xsl:text>
											<xsl:value-of select="$PortalItemID"/>
											<xsl:text>, 'div_Goal_</xsl:text>
											<xsl:value-of select="$GoalItemID"></xsl:value-of>
											<xsl:text>_Operations',</xsl:text>
											<xsl:value-of select="$OwnerID"/>
											<xsl:text>, 0, 25, 1,</xsl:text>
											<xsl:value-of select="$GoalItemID"></xsl:value-of>
											<xsl:text>);</xsl:text>
										</xsl:when>
										<xsl:otherwise>
											<xsl:choose>
												<xsl:when test="not($ViewID) or $ViewID=''">
													<xsl:choose>
														<xsl:when test="$SuccessKey = 'BusinessPlanning'">
															<xsl:value-of select="$BusinessPlanCall"/>
														</xsl:when>
														<xsl:when test="$IsCoach = 1 and $IsParticipant = 0">
															LoadGoalActionDashboard_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>
															,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations'
															,0);
														</xsl:when>
														<xsl:otherwise>
															LoadGoalActionDashboard_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>
															,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations'
															,<xsl:value-of select="$LoggedInUser/UserID"/>);
														</xsl:otherwise>
													</xsl:choose>
												</xsl:when>
												<xsl:otherwise>
													SetTitleOfGoal_3_0('span_<xsl:value-of select="$GoalItemID"></xsl:value-of>_GoalTitle','Tasks',0);LoadGoalTask_3_0(<xsl:value-of select="$GoalItemID"></xsl:value-of>,'div_Goal_<xsl:value-of select="$GoalItemID"></xsl:value-of>_Operations','Topic','asc',1,<xsl:value-of select="$ViewID"></xsl:value-of>);
												</xsl:otherwise>
											</xsl:choose>
										</xsl:otherwise>
									</xsl:choose>
								</script>
							</div>
						</div>
					</div>
				</xsl:when>
				<xsl:otherwise>
					<div style="padding-top:33px">
						<xsl:variable name="LoggedInUserID">
							<xsl:value-of select="$LoggedInUser/UserID"/>
						</xsl:variable>
						<xsl:choose>
							<xsl:when test="($OpenTo = 3) and normalize-space($Authenticated) = 'True' and $ItemPermissionID &lt; 0 ">

								<xsl:choose>
									<xsl:when test="$RoleName = 'True' or $EnterprisePermissionID &gt;= 4">
										<xsl:choose>
											<xsl:when test="$MBrandItemID !=''">
												You are not Authorized to view this Goal <button type="button" id="addMeInGoal" class="btn btn-primary" onClick="return shareIT_addBrandAdmintoShareIT('{$GoalItemID}','Goal','{$MasterPortalItemID}');">Add Me</button>

											</xsl:when>
											<xsl:otherwise>
												You are not Authorized to view this Goal <button type="button" id="addMeInGoal" class="btn btn-primary" onclick="return shareIT_addBrandAdmintoShareIT('{$GoalItemID}','Goal','{$MasterPortalItemID}');" fn="loadGoal_3_0('{$GoalItemID}','{$divID}','{$EscapedItemName}','{$ItemImageURL}','{SuccessKey}','-99','{$PortalID}','{$LoggedInUserID}','MyActivity');">Add Me</button>

											</xsl:otherwise>
										</xsl:choose>
									</xsl:when>
									<xsl:otherwise>

										You are not Authorized to view this Goal

									</xsl:otherwise>
								</xsl:choose>
							</xsl:when>

						</xsl:choose>

					</div>
				</xsl:otherwise>
			</xsl:choose>

			<script>
				$(document).ready(function(){
				$('.LeftTogle').click(function(){
				$('#myNavbarLeft ul li').css('display','block');

				});
				});
			</script>
			<script>
				<!--<xsl:text disable-output-escaping="yes">-->
				$(window).resize(function(){
				width = $(window).width();

				if (width &lt;= 480)
				{
				$('#myNavbarLeft').addClass('collapse');

				}else{
				$('#myNavbarLeft').removeClass('collapse');
				$('#myNavbarLeft').css('height', 'auto');
				}
				});
				<!--</xsl:text>-->
			</script>

		</div>


	</xsl:template>

</xsl:stylesheet>
