﻿<?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:output method="xml" indent="yes"/>

	<xsl:key name="LSItemIDKey" match="Items/Item/LSItemID" use="." />
	<xsl:template match="/">
		<xsl:variable name="MasterPortalItemID" select="AjaxRequest/Params/MasterPortalItemID"></xsl:variable>
		<xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalItemID"></xsl:variable>
		<xsl:variable name="GoalItemID" select="AjaxRequest/Params/GoalItemID"></xsl:variable>
		<xsl:variable name="UserID" select="AjaxRequest/Params/UserID"></xsl:variable>
		<xsl:variable name="SearchText" select="AjaxRequest/Params/SearchText"></xsl:variable>
		<xsl:variable name="Action" select="AjaxRequest/Action"></xsl:variable>
		<xsl:variable name="GoalList">
			<xsl:choose>
				<xsl:when test="$Action ='LoadActivityDashboardGoalSummaryForManagerProgram'">
					<xsl:copy-of select="AjaxRequest/Items/Item[StatusID &lt; 3 and OwnerID = $UserID]"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:copy-of select="AjaxRequest/Items/Item"/>
				</xsl:otherwise>
			</xsl:choose>
		</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="LoggedInUserID" select="AjaxRequest/LoggedInUserID"></xsl:variable>
		<xsl:variable name="parentDivID" select="AjaxRequest/Params/parentDivID"></xsl:variable>
		<xsl:variable name="UserBrands" select="AjaxRequest/UserBrands/."></xsl:variable>
		<xsl:variable name="List" select="AjaxRequest/Items/List"/>
		<xsl:variable name="LoggedInUserPortalPerm" select="AjaxRequest/Permissions/ItemPermission/PermissionID"></xsl:variable>
		<xsl:variable name="StatusID" select="AjaxRequest/Params/StatusID"></xsl:variable>
		<xsl:variable name="ItemStatusList" select="AjaxRequest/ItemStatus"></xsl:variable>

		<xsl:variable name="Theme" select="AjaxRequest/Settings/Theme"></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="PortalID">
			<xsl:choose>
				<xsl:when test="AjaxRequest/Params/PortalItemID='-99'">
					<xsl:value-of select="AjaxRequest/Params/MasterPortalItemID"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="AjaxRequest/Params/PortalItemID"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="OnClickViewAll">
			<xsl:text>LoadPortalUserTasks_3_0('</xsl:text>
			<xsl:value-of select="$parentDivID"/>
			<xsl:text>','</xsl:text>
			<xsl:value-of select="$PortalID"/>
			<xsl:text>','</xsl:text>
			<xsl:value-of select="$LoggedInUserID"/>
			<xsl:text>','1','Header');</xsl:text>
		</xsl:variable>
		<xsl:variable name="OnClickAddProgram">
			<xsl:choose>
				<xsl:when test="$MasterPortalItemID != $PortalID">
					<xsl:text>baseBrandAutoSuggest_selectAutoSuggetData('</xsl:text>
					<xsl:value-of select="$PortalID"/>
					<xsl:text>','</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>', 'N/A', 'PortalAddGoalWizardForSelectedUser', 'divShowGoalList','-99','-99','MarkAutoSuggestDataSelected_3_0','Activity');</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>getUserAndPortalDetailsByPortalID(</xsl:text>
					<xsl:value-of select="$PortalID"/>
					<xsl:text>, null, 'Activity', 'divShowGoalList');</xsl:text>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:variable>
		<xsl:variable name="OnClickAddWorkSheet">
			<xsl:choose>
				<xsl:when test="$MasterPortalItemID != $PortalID">
					<xsl:text>getGoalListByPortalItemID_3_0(</xsl:text>
					<xsl:value-of select="$PortalID"/>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$UserID"/>
					<xsl:text>,' AddWSPortalSpecific','divShowGoalList');</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>getGoalListByPortalItemID_3_0(</xsl:text>
					<xsl:value-of select="$PortalID"/>
					<xsl:text>,</xsl:text>
					<xsl:value-of select="$LoggedInUserID"/>
					<xsl:text>,' AddWSPortalSpecific','divShowGoalList');</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:if test="$Action !='LoadActivityDashboardGoalSummaryForManagerProgram'">
			<!--baseBrandAutoSuggest_selectAutoSuggetData('{$PortalID}','{$UserID}', 'N/A', 'PortalAddGoalWizardForSelectedUser', 'divShowGoalList','-99','-99','MarkAutoSuggestDataSelected_3_0','Activity');-->
			<div class="col-md-12 pading0 Borderd alter-color myprgrms nonebrdr" id="divAddExistingGoal">
				<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray adbtn" style="width:130px;line-height:30px;text-align:center;float:left;"
					 onclick="$('#divShowGoalList').css('display','inline');$('#divAddExistingGoal').css('display','none');$('#divGoalSummaryMyProgram').css('display','none');{$OnClickAddProgram}">
					<span class="glyphicon glyphicon-plus"></span>
					<span id="span_Cancel">ADD PROGRAM </span>
				</div>
				<!--<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray adbtn adprogrm"
						
							 onclick="$('#divShowGoalList').css('display','inline');$('#divAddExistingGoal').css('display','none');$('#divGoalSummaryMyProgram').css('display','none');{$OnClickAddWorkSheet}">
					<span class="glyphicon glyphicon-plus"></span>
					<span id="span_Cancel">ADD WORKSHEET </span>
				</div>-->
			</div>
			<div class="col-md-12 pading0 Borderd alter-color myprgrms p-B-20" id="divShowGoalList" style="display:none;float:left;">
			</div>
		</xsl:if>

		<div id="divGoalSummaryMyProgram" class="col-md-12 pading0 Borderd alter-color myprgrms">
			<div class="tab_grid Taskwid padded10"  style="background:#fff">
				<xsl:if test="$Action !='LoadActivityDashboardGoalSummaryForManagerProgram'">
					<!-- section-heading-->
					<div class="section-title">

						<div class="mrgnBtm10">
							<span style="width:auto" class="comwid">
								<xsl:text>My Programs</xsl:text>
							</span>

							<xsl:if test="count($UserBrands/Brand) &gt; 1">
								<span class="pull-right comwid comwid40 comwid12" style="width:auto;">
									<span class="onMouseOver pull-right inter "
										  id="spanSelectedPortal"
										  onclick="$('#spanSelectedPortal').css('display','none');
									  $('#ddlSelectedDashboardPortal').css('display','inline');">
										<xsl:choose>
											<xsl:when test="$PortalItemID = '' or $PortalItemID = -99 or $PortalItemID=$MasterPortalItemID">
												<xsl:text>All</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="$UserBrands/Brand[ItemID = $PortalItemID]/Item"/>
												<!--<xsl:value-of select="$PortalItemID"/>-->
											</xsl:otherwise>
										</xsl:choose>
									</span>

									<select class="form-control-dashboard pull-right" style="display:none;width:100%;"
											id="ddlSelectedDashboardPortal"
											onChange="LoadMyActivityDashboard_3_0_Selection({$MasterPortalItemID}, {$PortalItemID}, {$UserID}, {$GoalItemID}, '{$parentDivID}','{$StatusID}');">
										<xsl:for-each select="$UserBrands/Brand">
											<xsl:choose>
												<xsl:when test="($MasterPortalItemID = ItemID and $PortalItemID = -99)">
													<option value="{ItemID}" selected="">
														<xsl:text>All</xsl:text>
													</option>
												</xsl:when>
												<xsl:when test="($PortalItemID = ItemID and $PortalItemID != -99)">
													<option value="{ItemID}" selected="">
														<xsl:value-of select="Item"/>
													</option>
												</xsl:when>
												<xsl:otherwise>
													<option value="{ItemID}">
														<xsl:choose>
															<xsl:when test="$MasterPortalItemID = ItemID">
																<xsl:text>All</xsl:text>
															</xsl:when>
															<xsl:otherwise>
																<xsl:value-of select="Item"/>
															</xsl:otherwise>
														</xsl:choose>
													</option>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:for-each>
									</select>
								</span>
							</xsl:if>


							<span class="col-md-3 pull-right comwid">
								<input type="text" style="height:28px;width:100%;" title="Search..." placeholder="Search..." value="{$SearchText}" id="txtSearchText" onkeyup="LoadMyActivityDashboard_3_0_search({$MasterPortalItemID}, {$PortalItemID},{$UserID},  {$GoalItemID}, '{$parentDivID}',event,'{$StatusID}');"  class="proPageBoxInput form-control"></input>
							</span>
							<xsl:variable name="icnStatusFilter">
								<xsl:choose>
									<xsl:when test="$StatusID=0 or not($StatusID)">
										<xsl:text> fa fa-dot-circle-o</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=3">
										<xsl:text>fa fa-pause-circle</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=4">
										<xsl:text> fa fa-check-circle</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=5">
										<xsl:text>fa fa-times-circle</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=6">
										<xsl:text>fa fa-arrow-circle-o-down</xsl:text>
									</xsl:when>
									<xsl:otherwise>
										<xsl:text> fa fa-dot-circle-o</xsl:text>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:variable>
							<xsl:variable name="StatusTitle">
								<xsl:choose>
									<xsl:when test="$StatusID=0 or not($StatusID)">
										<xsl:text>Open Programs</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=3">
										<xsl:text>Paused</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=4">
										<xsl:text>Completed</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=5">
										<xsl:text>Deleted</xsl:text>
									</xsl:when>
									<xsl:when test="$StatusID=6">
										<xsl:text>Archived</xsl:text>
									</xsl:when>
									<xsl:otherwise>
										<xsl:text>Open Programs</xsl:text>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:variable>
							<span class="pull-right">
								<div class="btn-group">
									<button type="button" class="multiselect dropdown-toggle btn"
											data-toggle="dropdown" title="{$StatusTitle}" style="width: auto;padding-top: 0px; margin-top: -11px;  height: 40px;" aria-expanded="false">
										<span style="color: " class="onMouseOver {$icnStatusFilter} clsStatusFontStyle" id="ddlListStatus">
										</span>
									</button>
									<ul class="dropdown-menu clsDdlGoal" style="left:-10px;">
										<xsl:choose>
											<xsl:when test="$StatusID =0 or not($StatusID) or $StatusID = ''">
												<li class="active" title="Open Programs" val="0">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',0);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-dot-circle-o">
															</span>
														</label>
													</a>
												</li>
											</xsl:when>
											<xsl:otherwise>
												<li class="" title="Open Programs" val="0">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',0);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-dot-circle-o">
															</span>
														</label>
													</a>
												</li>
											</xsl:otherwise>
										</xsl:choose>
										<xsl:choose>
											<xsl:when test="$StatusID=3">
												<li class="active" title="Paused" val="3">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',3);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-pause-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:when>
											<xsl:otherwise>
												<li class="" title="Paused" val="3">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',3);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-pause-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:otherwise>
										</xsl:choose>
										<xsl:choose>
											<xsl:when test="$StatusID=4">
												<li class="active"  title="Completed" val="4">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',4);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-check-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:when>
											<xsl:otherwise>
												<li class=""  title="Completed" val="4">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',4);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-check-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:otherwise>
										</xsl:choose>
										<xsl:choose>
											<xsl:when test="$StatusID=5">
												<li class="active" title="Deleted" val="5">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',5);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-times-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:when>
											<xsl:otherwise>
												<li class="" title="Deleted" val="5">
													<a href="javascript:void(0);"
													   onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',5);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-times-circle">
															</span>
														</label>
													</a>
												</li>
											</xsl:otherwise>
										</xsl:choose>
										<xsl:choose>
											<xsl:when test="$StatusID=6">
												<li class="active"  title="Archived" val="6"
											onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',6);">
													<a href="javascript:void(0);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-arrow-circle-o-down">
															</span>
														</label>
													</a>
												</li>
											</xsl:when>
											<xsl:otherwise>
												<li class=""  title="Archived" val="6"
																							onclick="loadActivityDashboardGoalSummaryFilter({$MasterPortalItemID}, {$PortalItemID}, {$GoalItemID}, 'divActivityDashboardGoalSummary', '{$parentDivID}', {$UserID}, 'txtSearchText',6);">
													<a href="javascript:void(0);">
														<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
															<span class="fa fa-arrow-circle-o-down">
															</span>
														</label>
													</a>
												</li>
											</xsl:otherwise>
										</xsl:choose>

									</ul>
								</div>
							</span>
						</div>
					</div>
					<!-- same code-->
				</xsl:if>
				<div class="fixed_overflow" style="width: 100%;    float: left; ">

					<xsl:variable name="GetDistinctRecordByGoalID">
						<xsl:copy-of select="AjaxRequest/Items/Item/LSItemID[generate-id() = generate-id(key('LSItemIDKey',.))]"/>
					</xsl:variable>

					<xsl:choose>
						<xsl:when test="$GetDistinctRecordByGoalID != ''">
							<xsl:for-each select="msxsl:node-set($GetDistinctRecordByGoalID)/child::node()">
								<xsl:variable name="GroupBy">
									<xsl:value-of select="."/>
								</xsl:variable>
								<div class="groupingHeading">
									<xsl:value-of select="msxsl:node-set($GoalList)/Item[LSItemID=$GroupBy]/PortalName"/>
								</div>
								<xsl:variable name="GetGoalRecordGroupBy">
									<xsl:copy-of select="msxsl:node-set($GoalList)/Item[LSItemID=$GroupBy]"/>
								</xsl:variable>
								<xsl:for-each select="msxsl:node-set($GetGoalRecordGroupBy)/child::node()">
									<xsl:variable name="CompletionPercentage">
										<xsl:choose>
											<xsl:when test="TotalComp=0">
												<xsl:text>0</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:value-of select="round((TotalComp div TotalTask)*100)"/>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="CurrentPriorityValue">
										<xsl:value-of select="Priority"/>
									</xsl:variable>
									<xsl:variable name="CurrentItemID">
										<xsl:value-of select="ItemID"/>
									</xsl:variable>
									<xsl:variable name="CurrentOwnerID">
										<xsl:value-of select="OwnerID"/>
									</xsl:variable>
									<div id="tr_Goal_{CRMProjectID}" class="full_column ExpandRow " style="width:100%;float:left;" >
										<xsl:variable name="OnClickPriorityClass">
											<xsl:choose>
												<xsl:when test="$LoggedInUserPortalPerm &gt;= 4">
													<xsl:text>dropdown</xsl:text>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>dropdown</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>
										<xsl:variable name="SummaryWidthStyle">
											<xsl:choose>
												<xsl:when test="$LoggedInUserPortalPerm &gt;= 4">
													<xsl:text>actionBsd</xsl:text>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>actionbig</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>
										<div style="float:left;width:3%;line-height:46px;" class="">
											<div class="btn-group ">
												<button type="button" class="multiselect dropdown-toggle btn padinone" data-toggle="{$OnClickPriorityClass}" title="" aria-expanded="false" style="width: auto;">
													<span class="star-default glyphicon glyphicon-star star_{Priority}" style="margin-left:5px;"  id="span_Goal_Priority__{ItemID}"></span>

												</button>

												<ul class=" dropdown-menu Priority" id="ddl_GoalPriority_{ItemID}" previousValue="{Priority}">
													<xsl:for-each select="$List/Priority/Option">
														<xsl:variable name="OnClickPriority">
															<xsl:text>UpdateItemUserPriority_3_0('</xsl:text>
															<xsl:value-of select="$CurrentItemID"></xsl:value-of>
															<xsl:text>','</xsl:text>
															<xsl:value-of select="Value"></xsl:value-of>
															<xsl:text>','ddl_GoalPriority_</xsl:text>
															<xsl:value-of select="$CurrentItemID"/>
															<xsl:text>','</xsl:text>
															<xsl:value-of select="$UserID"/>
															<xsl:text>');</xsl:text>
														</xsl:variable>
														<xsl:choose>
															<xsl:when test="Value = $CurrentPriorityValue">
																<li class="active" val="{Value}">
																	<a href="javascript:void(0);" onclick="{$OnClickPriority}">
																		<label class="radio" style="padding-left: 0px;">
																			<span class="glyphicon glyphicon-star star_{Value}" ></span>
																		</label>
																	</a>
																</li>
															</xsl:when>
															<xsl:otherwise>
																<li class="" val="{Value}">
																	<a href="javascript:void(0);" onclick="{$OnClickPriority}">
																		<label class="radio" style="padding-left: 0px;">
																			<span class="glyphicon glyphicon-star star_{Value}" ></span>
																		</label>
																	</a>
																</li>
															</xsl:otherwise>
														</xsl:choose>
													</xsl:for-each>
												</ul>

											</div>
										</div>


										<xsl:variable name="EscapedItem">
											<xsl:call-template name="replaceCharsInString">
												<xsl:with-param name="stringIn" select="Item"></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="funcLoadGoal">
											<xsl:choose>
												<xsl:when test="$Theme/@active ='true' and $Theme/@transformBaseTemplatePath='false'">
													<xsl:text>window.location.href='</xsl:text>
													<xsl:value-of select="$Protocol"/>
													<xsl:value-of select="$HostName"/>
													<xsl:text>/Program/</xsl:text>
													<xsl:value-of select="ItemID"/>
													<xsl:text>'</xsl:text>
												</xsl:when>
												<xsl:otherwise>
													<xsl:text>loadGoal_3_0('</xsl:text>
													<xsl:value-of select="ItemID"/>
													<xsl:text>','</xsl:text>
													<xsl:value-of select="$parentDivID"/>
													<xsl:text>','</xsl:text>
													<xsl:value-of select="$EscapedItem"/>
													<xsl:text>','</xsl:text>
													<xsl:value-of select="ImageURL"/>
													<xsl:text>','</xsl:text>
													<xsl:value-of select="SuccessKey"/>
													<xsl:text>','-99','</xsl:text>
													<xsl:value-of select="$PortalID"/>
													<xsl:text>','</xsl:text>
													<xsl:value-of select="$LoggedInUserID"/>
													<xsl:text>','MyActivity');</xsl:text>
												</xsl:otherwise>
											</xsl:choose>
										</xsl:variable>

										<xsl:choose>
											<xsl:when test="$Theme/@active ='true' and $Theme/@transformBaseTemplatePath='false'">

												<xsl:variable name="ProgramURL">
													<xsl:value-of select="$Protocol"/>
													<xsl:value-of select="$HostName"/>
													<xsl:text>/Program/</xsl:text>
													<xsl:value-of select="ItemID"/>
												</xsl:variable>

												<a href="{$ProgramURL}" class="onMouseOver">
													<div class="midprogram left_column PadingLft {$SummaryWidthStyle}">
														<img src="{ImageURL}" style="width:40px;height:40px" class="pull-left"></img>


														<div class="MiDiv ExpandRow nwprogrm">
															<span  class="whitespace sumry" id="span_{ItemID}_ProjectName">
																<xsl:value-of select="Item"/>
															</span>

														</div>
														<div class="right_column RightDiv Progres">
															<xsl:variable name="BarColor">
																<xsl:choose>
																	<xsl:when test="round($CompletionPercentage)=100">
																		<xsl:text>progress-bar-success</xsl:text>
																	</xsl:when>
																	<xsl:otherwise>
																		progress-bar-info
																	</xsl:otherwise>
																</xsl:choose>
															</xsl:variable>
															<div class="progress Mrgin">
																<div class="progress-bar {$BarColor}" role="progressbar"  style="width:{$CompletionPercentage}%">
																	<span class="">
																		<xsl:value-of select="round($CompletionPercentage)"></xsl:value-of>%
																	</span>
																</div>
															</div>
														</div>

													</div>
												</a>
											</xsl:when>
											<xsl:otherwise>
												<div onclick="{$funcLoadGoal}"
													class="midprogram left_column PadingLft {$SummaryWidthStyle}">
													<img src="{ImageURL}" style="width:40px;height:40px" class="pull-left"></img>


													<div class="MiDiv ExpandRow nwprogrm">
														<span  class="whitespace sumry" id="span_{ItemID}_ProjectName">
															<xsl:value-of select="Item"/>
														</span>

													</div>
													<div class="right_column RightDiv Progres">
														<xsl:variable name="BarColor">
															<xsl:choose>
																<xsl:when test="round($CompletionPercentage)=100">
																	<xsl:text>progress-bar-success</xsl:text>
																</xsl:when>
																<xsl:otherwise>
																	progress-bar-info
																</xsl:otherwise>
															</xsl:choose>
														</xsl:variable>
														<div class="progress Mrgin">
															<div class="progress-bar {$BarColor}" role="progressbar"  style="width:{$CompletionPercentage}%">
																<span class="">
																	<xsl:value-of select="round($CompletionPercentage)"></xsl:value-of>%
																</span>
															</div>
														</div>
													</div>

												</div>

											</xsl:otherwise>
										</xsl:choose>

										<xsl:variable name="icnStatus">
											<xsl:choose>
												<xsl:when test="StatusID=1">
													<xsl:text> fa fa-dot-circle-o</xsl:text>
												</xsl:when>
												<xsl:when test="StatusID=2">
													<xsl:text>fa fa-adjust</xsl:text>
												</xsl:when>
												<xsl:when test="StatusID=3">
													<xsl:text>fa fa-pause-circle</xsl:text>
												</xsl:when>
												<xsl:when test="StatusID=4">
													<xsl:text> fa fa-check-circle</xsl:text>
												</xsl:when>
												<xsl:when test="StatusID=5">
													<xsl:text>fa fa-times-circle</xsl:text>
												</xsl:when>
												<xsl:when test="StatusID=6">
													<xsl:text>fa fa-arrow-circle-o-down</xsl:text>
												</xsl:when>
											</xsl:choose>
										</xsl:variable>
										<div class="btn-group" style="width:3%">
											<button type="button" class="multiselect dropdown-toggle btn padinone"
													data-toggle="dropdown" title="{Status}" style="width: auto;" aria-expanded="false">
												<span style="color: " class="onMouseOver {$icnStatus} clsStatusFontStyle" id="spanGoalStatus_{ItemID}">
												</span>
											</button>
											<ul class="dropdown-menu clsDdlGoal ddlGoalStatus_{ItemID}"  style="margin-left: -20px;margin-top: -8px;">
												<xsl:choose>
													<xsl:when test="StatusID=1">
														<li class="active" val="1" title="Not Started"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 1, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-dot-circle-o">
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class="" val="1"  title="Not Started"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 1, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-dot-circle-o">
																	</span>
																</label>
															</a>
														</li>

													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="StatusID=2">
														<li class="active" val="2"  title="In Progress"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 2, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-adjust" >
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class="" val="2" title="In Progress"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 2, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-adjust" >
																	</span>
																</label>
															</a>
														</li>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="StatusID=3">
														<li class="active" val="3" title="Paused"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 3, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);" >
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-pause-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class=""  val="3"  title="Paused"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 3, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);" >
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-pause-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="StatusID=4">
														<li class="active" val="4" title="Completed"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 4, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-check-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class="" val="4"  title="Completed"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 4, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-check-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="StatusID=5">
														<li class="active" val="5" title="Deleted"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 5, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-times-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class="" val="5" title="Deleted"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 5, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-times-circle">
																	</span>
																</label>
															</a>
														</li>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="StatusID=6">
														<li class="active" val="6" title="Archived"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 6, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-arrow-circle-o-down">
																	</span>
																</label>
															</a>
														</li>
													</xsl:when>
													<xsl:otherwise>
														<li class="" val="6" title="Archived"
															onclick="updateActivityDashboardGoalStatus({ItemID}, 6, 'spanGoalStatus_{ItemID}');">
															<a href="javascript:void(0);">
																<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																	<span class="fa fa-arrow-circle-o-down">
																	</span>
																</label>
															</a>
														</li>
													</xsl:otherwise>
												</xsl:choose>
											</ul>
										</div>


										<xsl:if test="$LoggedInUserPortalPerm &gt;= 4">
											<span style="width:7%">
												<select class="smallDropdown riteselect" style="width:6%;margin-top:8px;" id="ddlAction_{CRMProjectID}" onChange="clientPortal_SelectAction('{$PortalID}','divOpenProjects_{CRMProjectID}','{TemplateSourceID}',
                                                                                            '{ItemID}','{BrandID}','ddlAction_{normalize-space(CRMProjectID)}','{normalize-space(OwnerID)}',
                                                                                            '{normalize-space(CRMProjectID)}','3');">
													<option value="-99" >
														Admin
													</option>
													<option value="1">Send Response</option>
													<option value="2">Re-apply Template</option>
													<option value="3">Add Me</option>
													<option value="4">Delete</option>
												</select>
											</span>
										</xsl:if>
									</div>

									<div id="divOpenProjects_{CRMProjectID}_detail_container" style="z-index:10;position:absolute;display:none;border: 1px solid black;padding: 5px;
                                             background-color:#FFFFFF;visibility: visible;width:600px;"></div>
								</xsl:for-each>
							</xsl:for-each>
						</xsl:when>
						<xsl:otherwise>
							<xsl:for-each select="msxsl:node-set($GoalList)/Item">
								<xsl:variable name="CompletionPercentage">
									<xsl:choose>
										<xsl:when test="TotalComp=0">
											<xsl:text>0</xsl:text>
										</xsl:when>
										<xsl:otherwise>
											<xsl:value-of select="round((TotalComp div TotalTask)*100)"/>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:variable>
								<xsl:variable name="CurrentPriorityValue">
									<xsl:value-of select="Priority"/>
								</xsl:variable>
								<xsl:variable name="CurrentItemID">
									<xsl:value-of select="ItemID"/>
								</xsl:variable>
								<xsl:variable name="CurrentOwnerID">
									<xsl:value-of select="OwnerID"/>
								</xsl:variable>
								<div id="tr_Goal_{CRMProjectID}" class="full_column ExpandRow " style="width:100%;float:left;" >
									<xsl:variable name="OnClickPriorityClass">
										<xsl:choose>
											<xsl:when test="$LoggedInUserPortalPerm &gt;= 4">
												<xsl:text>dropdown</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>dropdown</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="SummaryWidthStyle">
										<xsl:choose>
											<xsl:when test="$LoggedInUserPortalPerm &gt;= 4">
												<xsl:text>actionBsd</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>actionbig</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<div style="float:left;width:3%;line-height:46px;" class="">
										<div class="btn-group ">
											<button type="button" class="multiselect dropdown-toggle btn padinone" data-toggle="{$OnClickPriorityClass}" title="" aria-expanded="false" style="width: auto;">
												<span class="star-default glyphicon glyphicon-star star_{Priority}" style="margin-left:5px;"  id="span_Goal_Priority__{ItemID}"></span>

											</button>

											<ul class=" dropdown-menu Priority" id="ddl_GoalPriority_{ItemID}" previousValue="{Priority}">
												<xsl:for-each select="$List/Priority/Option">
													<xsl:variable name="OnClickPriority">
														<xsl:text>UpdateItemUserPriority_3_0('</xsl:text>
														<xsl:value-of select="$CurrentItemID"></xsl:value-of>
														<xsl:text>','</xsl:text>
														<xsl:value-of select="Value"></xsl:value-of>
														<xsl:text>','ddl_GoalPriority_</xsl:text>
														<xsl:value-of select="$CurrentItemID"/>
														<xsl:text>','</xsl:text>
														<xsl:value-of select="$UserID"/>
														<xsl:text>');</xsl:text>
													</xsl:variable>
													<xsl:choose>
														<xsl:when test="Value = $CurrentPriorityValue">
															<li class="active" val="{Value}">
																<a href="javascript:void(0);" onclick="{$OnClickPriority}">
																	<label class="radio" style="padding-left: 0px;">
																		<span class="glyphicon glyphicon-star star_{Value}" ></span>
																	</label>
																</a>
															</li>
														</xsl:when>
														<xsl:otherwise>
															<li class="" val="{Value}">
																<a href="javascript:void(0);" onclick="{$OnClickPriority}">
																	<label class="radio" style="padding-left: 0px;">
																		<span class="glyphicon glyphicon-star star_{Value}" ></span>
																	</label>
																</a>
															</li>
														</xsl:otherwise>
													</xsl:choose>
												</xsl:for-each>
											</ul>

										</div>
									</div>

									<xsl:variable name="EscapedItem">
										<xsl:call-template name="replaceCharsInString">
											<xsl:with-param name="stringIn" select="Item"></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="funcLoadGoal">
										<xsl:choose>
											<xsl:when test="$Theme/@active ='true' and $Theme/@transformBaseTemplatePath='false'">
												<xsl:text>window.location.href='</xsl:text>
												<xsl:value-of select="$Protocol"/>
												<xsl:value-of select="$HostName"/>
												<xsl:text>/Program/</xsl:text>
												<xsl:value-of select="ItemID"/>
												<xsl:text>'</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>loadGoal_3_0('</xsl:text>
												<xsl:value-of select="ItemID"/>
												<xsl:text>','</xsl:text>
												<xsl:value-of select="$parentDivID"/>
												<xsl:text>','</xsl:text>
												<xsl:value-of select="$EscapedItem"/>
												<xsl:text>','</xsl:text>
												<xsl:value-of select="ImageURL"/>
												<xsl:text>','</xsl:text>
												<xsl:value-of select="SuccessKey"/>
												<xsl:text>','-99','</xsl:text>
												<xsl:value-of select="$PortalID"/>
												<xsl:text>','</xsl:text>
												<xsl:value-of select="$LoggedInUserID"/>
												<xsl:text>','MyActivity');</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>

									<xsl:choose>
										<xsl:when test="$Theme/@active ='true' and $Theme/@transformBaseTemplatePath='false'">

											<xsl:variable name="ProgramURL">
												<xsl:value-of select="$Protocol"/>
												<xsl:value-of select="$HostName"/>
												<xsl:text>/Program/</xsl:text>
												<xsl:value-of select="ItemID"/>
											</xsl:variable>
											
											<a href="{$ProgramURL}" class="onMouseOver">
												<div class="left_column PadingLft {$SummaryWidthStyle}" style="padding:2px;cursor:pointer !important;width:88%">
													<img src="{ImageURL}" style="width:40px;height:40px" class="pull-left"></img>


													<div class="MiDiv ExpandRow " style="cursor:pointer !important;line-height:40px!important;height:40px;width:68%;">
														<span  class="whitespace sumry" id="span_{ItemID}_ProjectName">
															<xsl:value-of select="Item"/>
														</span>

													</div>
													<div class="right_column RightDiv Progres">
														<xsl:variable name="BarColor">
															<xsl:choose>
																<xsl:when test="round($CompletionPercentage)=100">
																	<xsl:text>progress-bar-success</xsl:text>
																</xsl:when>
																<xsl:otherwise>
																	progress-bar-info
																</xsl:otherwise>
															</xsl:choose>
														</xsl:variable>
														<div class="progress Mrgin">
															<div class="progress-bar {$BarColor}" role="progressbar"  style="width:{$CompletionPercentage}%">
																<span class="">
																	<xsl:value-of select="round($CompletionPercentage)"></xsl:value-of>%
																</span>
															</div>
														</div>
													</div>

												</div>
											</a>
										</xsl:when>
										<xsl:otherwise>
											<div onclick="{$funcLoadGoal}"
												 class="left_column PadingLft {$SummaryWidthStyle}" style="padding:2px;cursor:pointer !important;width:88%">
												<img src="{ImageURL}" style="width:40px;height:40px" class="pull-left"></img>


												<div class="MiDiv ExpandRow " style="cursor:pointer !important;line-height:40px!important;height:40px;width:68%;">
													<span  class="whitespace sumry" id="span_{ItemID}_ProjectName">
														<xsl:value-of select="Item"/>
													</span>

												</div>
												<div class="right_column RightDiv Progres">
													<xsl:variable name="BarColor">
														<xsl:choose>
															<xsl:when test="round($CompletionPercentage)=100">
																<xsl:text>progress-bar-success</xsl:text>
															</xsl:when>
															<xsl:otherwise>
																progress-bar-info
															</xsl:otherwise>
														</xsl:choose>
													</xsl:variable>
													<div class="progress Mrgin">
														<div class="progress-bar {$BarColor}" role="progressbar"  style="width:{$CompletionPercentage}%">
															<span class="">
																<xsl:value-of select="round($CompletionPercentage)"></xsl:value-of>%
															</span>
														</div>
													</div>
												</div>

											</div>
										</xsl:otherwise>
									</xsl:choose>





									<xsl:variable name="icnStatus">
										<xsl:choose>
											<xsl:when test="StatusID=1">
												<xsl:text> fa fa-dot-circle-o</xsl:text>
											</xsl:when>
											<xsl:when test="StatusID=2">
												<xsl:text>fa fa-adjust</xsl:text>
											</xsl:when>
											<xsl:when test="StatusID=3">
												<xsl:text>fa fa-pause-circle</xsl:text>
											</xsl:when>
											<xsl:when test="StatusID=4">
												<xsl:text> fa fa-check-circle</xsl:text>
											</xsl:when>
										</xsl:choose>
									</xsl:variable>
									<div class="btn-group" style="width:3%">
										<button type="button" class="multiselect dropdown-toggle btn padinone"
												data-toggle="dropdown" title="{Status}" style="width: auto;" aria-expanded="false">
											<span style="color: " class="onMouseOver {$icnStatus} clsStatusFontStyle" id="spanGoalStatus_{ItemID}');">
											</span>
										</button>
										<ul class="dropdown-menu clsDdlGoal ddlGoalStatus_{ItemID}"  style="margin-left: -20px;margin-top: -8px;">
											<xsl:choose>
												<xsl:when test="StatusID=1">
													<li class="active" val="1" title="Not Started"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 1, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-dot-circle-o">
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class="" val="1"  title="Not Started"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 1, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-dot-circle-o">
																</span>
															</label>
														</a>
													</li>

												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="StatusID=2">
													<li class="active" val="2"  title="In Progress"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 2, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-adjust" >
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class="" val="2" title="In Progress"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 2, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-adjust" >
																</span>
															</label>
														</a>
													</li>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="StatusID=3">
													<li class="active" val="3" title="Paused"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 3, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);" >
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-pause-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class=""  val="3"  title="Paused"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 3, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);" >
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-pause-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="StatusID=4">
													<li class="active" val="4" title="Completed"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 4, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-check-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class="" val="4"  title="Completed"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 4, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-check-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="StatusID=5">
													<li class="active" val="5" title="Deleted"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 5, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-times-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class="" val="5" title="Deleted"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 5, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-times-circle">
																</span>
															</label>
														</a>
													</li>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="StatusID=6">
													<li class="active" val="6" title="Archived"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 6, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-arrow-circle-o-down">
																</span>
															</label>
														</a>
													</li>
												</xsl:when>
												<xsl:otherwise>
													<li class="" val="6" title="Archived"
														onclick="updateActivityDashboardGoalStatus({ItemID}, 6, 'spanGoalStatus_{ItemID}');">
														<a href="javascript:void(0);">
															<label class="radio clsStatusFontStyle" style="padding-left: 0px;">
																<span class="fa fa-arrow-circle-o-down">
																</span>
															</label>
														</a>
													</li>
												</xsl:otherwise>
											</xsl:choose>
										</ul>
									</div>




									<xsl:if test="$LoggedInUserPortalPerm &gt;= 4">
										<span style="width:7%">
											<select class="smallDropdown riteselect" style="width:6%;margin-top:8px;" id="ddlAction_{CRMProjectID}" onChange="clientPortal_SelectAction('{$PortalID}','divOpenProjects_{CRMProjectID}','{TemplateSourceID}',
                                                                                            '{ItemID}','{BrandID}','ddlAction_{normalize-space(CRMProjectID)}','{normalize-space(OwnerID)}',
                                                                                            '{normalize-space(CRMProjectID)}','3');">
												<option value="-99" >
													Admin
												</option>
												<option value="1">Send Response</option>
												<option value="2">Re-apply Template</option>
												<option value="3">Add Me</option>
												<option value="4">Delete</option>
											</select>
										</span>
									</xsl:if>
								</div>

								<div id="divOpenProjects_{CRMProjectID}_detail_container" style="z-index:10;position:absolute;display:none;border: 1px solid black;padding: 5px;
                                             background-color:#FFFFFF;visibility: visible;width:600px;"></div>
							</xsl:for-each>
						</xsl:otherwise>
					</xsl:choose>
				</div>

			</div>
		</div>
		<xsl:if test="$Action !='LoadActivityDashboardGoalSummaryForManagerProgram'">
			<div class="col-md-12 white-bg-new" style="padding-right:0px" >
				<div class="box inner light-gray">
					<div class="row-fluid padded0">
						<div class="section-title ">
							<p style="100%">
								<span style="width:60%">
									Tasks Overview
								</span>

							</p>
						</div>
						<div class="col-md-2 col-xs-12 center onMouseOver" onClick="{$OnClickViewAll}">
							<div class="stat-box medium-blue">
								<span class="count">
									<i class="glyphicon glyphicon-list-alt"></i>
									<span class="dec_font">
										<xsl:call-template name="DoubleWord">
											<xsl:with-param name="words" select="sum(msxsl:node-set($GoalList)/Item/TotalTask)"></xsl:with-param>
										</xsl:call-template>
									</span>
								</span>
								<span class="stat-text">Tasks</span>
							</div>
						</div>

						<div class="col-md-2 col-xs-12 center onMouseOver" onClick="{$OnClickViewAll}">
							<div class="stat-box dark-blue">
								<span class="count">
									<i class="glyphicon glyphicon-list-alt"></i>
									<i class="glyphicon glyphicon-ok-sign second_icon"></i>
									<span class="dec_font">
										<xsl:call-template name="DoubleWord">
											<xsl:with-param name="words" select="sum(msxsl:node-set($GoalList)/Item/TotalComp)"></xsl:with-param>
										</xsl:call-template>
									</span>
								</span>
								<span class="stat-text">Completed</span>
							</div>
						</div>

						<div class="col-md-2 col-xs-12 center onMouseOver" onClick="{$OnClickViewAll}">
							<div class="stat-box border-blue">

								<span class="count">
									<i class="glyphicon glyphicon-calendar"></i>
									<i class="glyphicon glyphicon-exclamation-sign second_icon"></i>
									<span class="dec_font">
										<xsl:call-template name="DoubleWord">
											<xsl:with-param name="words" select="sum(msxsl:node-set($GoalList)/Item/PastDue)"></xsl:with-param>
										</xsl:call-template>
									</span>
								</span>
								<span class="stat-text">Past Due</span>
							</div>
						</div>

						<div class="col-md-2 col-xs-12 center onMouseOver" onClick="{$OnClickViewAll}">
							<div class="stat-box text-blue">

								<span class="count">
									<i class="glyphicon glyphicon-calendar"></i>
									<span class="dec_font">
										<xsl:call-template name="DoubleWord">
											<xsl:with-param name="words" select="sum(msxsl:node-set($GoalList)/Item/ThisWeek)"></xsl:with-param>
										</xsl:call-template>
									</span>
								</span>
								<span class="stat-text">This Week</span>
							</div>
						</div>

						<div class="col-md-2 col-xs-12 center onMouseOver" onClick="{$OnClickViewAll}">
							<div class="stat-box dark-blue">
								<span class="count">
									<i class="glyphicon glyphicon-time"></i>
									<span class="dec_font">
										<xsl:call-template name="DoubleWord">
											<xsl:with-param name="words" select="sum(msxsl:node-set($GoalList)/Item/Future)"></xsl:with-param>
										</xsl:call-template>
									</span>
								</span>
								<span class="stat-text">Future</span>
							</div>
						</div>
					</div>
				</div>

			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template name="DoubleWord">
		<xsl:param name="words" select="'N/A'"></xsl:param>
		<!--<xsl:value-of select="$words"/>-->
		<xsl:choose>
			<xsl:when test="$words &lt;10">
				0<xsl:value-of select="$words"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$words"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
