﻿<?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:include href="../GenericTemplates/Notes_LineBreak.xslt" />
	<!--<xsl:include href="../ClientPortal/RecurringTemplate.xslt"/>-->
	<xsl:include href="RecurringView.xslt"/>
	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">

		<xsl:variable name="ItemInfoVar">
			<xsl:choose>
				<xsl:when test="not(ActionInfo) = false">
					<xsl:copy-of select="ActionInfo/child::node()"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:copy-of select="SurveyInfo/child::node()"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="ItemInfo" select="msxsl:node-set($ItemInfoVar)"></xsl:variable>

		<xsl:variable name="PortalPermissionID" select="$ItemInfo/CurrentPortalPermissionID"></xsl:variable>
		<xsl:variable name="MasterPortalPermissionID" select="$ItemInfo/CurrentMasterPortalPermissionID"></xsl:variable>

		<xsl:variable name="HostName" select="$ItemInfo/HostName"/>
		<xsl:variable name="List" select="$ItemInfo/List"/>
		<xsl:variable name="ItemID" select="$ItemInfo/Params/itemID"></xsl:variable>
		<xsl:variable name="GoalName" select="$ItemInfo/GoalName"></xsl:variable>
		<xsl:variable name="GoalID" select="$ItemInfo/Params/GoalID"></xsl:variable>
		<xsl:variable name="DueDate" select="$ItemInfo/DueDate"></xsl:variable>
		<xsl:variable name="ShareItXML" select="$ItemInfo/Users/."></xsl:variable>
		<xsl:variable name="PermissionID" select="normalize-space($ItemInfo/PermissionID)"/>
		<xsl:variable name="ResponsibleID" select="$ItemInfo/ResponsibleID"></xsl:variable>
		<xsl:variable name="ItemDivPrefix" select="$ItemInfo/Params/DivPrefix"></xsl:variable>
		<xsl:variable name="Mode" select="'GoalDetail'"></xsl:variable>
		<xsl:variable name="TopicID" select="$ItemInfo/TopicID"></xsl:variable>
		<xsl:variable name="TopicName" select="$ItemInfo/TopicName"></xsl:variable>
		<xsl:variable name="DateFormat" select="$ItemInfo/Params/DateFormat"></xsl:variable>
		<xsl:variable name="TopicList" select="$ItemInfo/SummaryItems/SummaryItem"></xsl:variable>
		<xsl:variable name="AttachItemID" select="$ItemInfo/AttachItemID"></xsl:variable>
		<xsl:variable name="BrandID" select="$ItemInfo/BrandID"></xsl:variable>
		<xsl:variable name="BrandCommunityItemID" select="$ItemInfo/BrandCommunityItemID"></xsl:variable>
		<xsl:variable name="GoalItemID" select="$ItemInfo/GoalID"></xsl:variable>
		<xsl:variable name="RecurringInTask" select="$ItemInfo/RecurringInTask"></xsl:variable>

		<xsl:variable name="Protocol">
			<xsl:choose>
				<xsl:when test="$ItemInfo/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="percentage">
			<xsl:choose>
				<xsl:when test="normalize-space($ItemInfo/CompletionPercentage) = 0">
					<xsl:number value="0"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="format-number(($ItemInfo/CompletionPercentage), '#')"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="Priority" select="$ItemInfo/Priority"></xsl:variable>


		<xsl:variable name="CurrentDueDateState">
			<xsl:value-of select="$ItemInfo/DueDateState"/>
		</xsl:variable>
		<xsl:variable name="DataToggle">
			<xsl:choose>
				<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
					<xsl:text>dropdown</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="CircleColor">
			<xsl:choose>
				<xsl:when test="$CurrentDueDateState='Current'">
					<xsl:text>circle</xsl:text>
				</xsl:when>
				<xsl:when test="$CurrentDueDateState='PastDue'">
					<xsl:text>circle_yellow</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>circle</xsl:text>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:variable>
		<xsl:variable name="OnClickDueDate">
			<xsl:choose>
				<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
					<xsl:text>dp('div_item_</xsl:text>
					<xsl:value-of select="$ItemID"></xsl:value-of>
					<xsl:text>_title_content_subTitle_sliderPanel', 'div_item_</xsl:text>
					<xsl:value-of select="$ItemID"></xsl:value-of>
					<xsl:text>_title_content_subTitle_sliderPanel')</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="textAreaClick">
			<xsl:choose>
				<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
					<xsl:text>document.getElementById('sliderDesc_</xsl:text>
					<xsl:value-of select="$ItemID"></xsl:value-of>
					<xsl:text>').style.display='inline';document.getElementById('displayDesc_</xsl:text>
					<xsl:value-of select="$ItemID"></xsl:value-of>
					<xsl:text>').style.display='none';document.getElementById('TaskDesc_</xsl:text>
					<xsl:value-of select="$ItemID"></xsl:value-of>
					<xsl:text>').focus();</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<!--Title Element-->
		<div class="Heading" style="position:fixed;z-index:999;background:#fafafa;">

			<div style=" width: 100%;  float: left;  background: #fff;">
				<h1 style="width:100%;float: left;background: #ffffff;margin:13px 0;">
					<xsl:variable name="head" select="$ItemInfo/ItemName"></xsl:variable>
					<span  class="glyphicon glyphicon-ok glypcolor pull-left"></span>

					<xsl:choose>
						<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
							<span id="displayHead_{$ItemID}"  class="headwid whitespace" style="margin-top:5px;margin-left:12px;" onclick="document.getElementById('sliderHead_{$ItemID}').style.display='inline';this.style.display='none';document.getElementById('TaskHead_{$ItemID}').focus();">
								<xsl:value-of select="$ItemInfo/ItemName"/>
							</span>
						</xsl:when>
						<xsl:otherwise>
							<span id="displayHead_{$ItemID}"  class="headwid whitespace" style="margin-top:5px;margin-left:12px;" >
								<xsl:value-of select="$ItemInfo/ItemName"/>
							</span>
						</xsl:otherwise>
					</xsl:choose>
					<span style="display:none" id="sliderHead_{$ItemID}" class="paddingSlider">
						<input id="TaskHead_{$ItemID}" class="" type="text" value="{$head}"  style="width: 259px;height: 40px;"
						onkeyup="UpdateActionName_3_0_EnterKey({$ItemID},'displayHead_{$ItemID}','TaskHead_{$ItemID}',event)"></input>
					</span>
				</h1>
			</div>
			<div style="background: #fafafa;border-bottom: #ddd solid 1px;padding-bottom: 25px;margin-top: 57px;height: 30px;">
				<h1  class="onmouseover ">
					<span  class="glyphicon  glyphicon-list-alt glypcolor pull-left" style="margin-left:1px;"></span>
					<span  class="headwid whitespace" style="vertical-align: middle;padding-top:3px;margin-left:3px;">
						<xsl:choose>
							<xsl:when test="$PortalPermissionID &gt;= 5 or $MasterPortalPermissionID &gt;= 5">
								<a href="{$Protocol}{$HostName}/Goal.aspx?ID={$GoalItemID}" target="_blank" style="color:black;margin-left:9px;">
									<xsl:value-of select="$GoalName"/>
								</a>
							</xsl:when>
							<xsl:otherwise>
								<span style="color:black;margin-left:9px;">
									<xsl:value-of select="$GoalName"/>
								</span>
							</xsl:otherwise>
						</xsl:choose>


					</span>
				</h1>
			</div>
		</div>

		<!--Topic Element-->
		<xsl:choose>
			<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
				<xsl:variable name="OldParentID">
					<xsl:choose>
						<xsl:when test="$TopicID">
							<xsl:value-of select="$TopicID"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$GoalID"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<div class="contnt"  style="margin-top:86px!important;">
					<span class="glyphicon glyphicon-list glypcolor onMouseOver" style=" top: 0; vertical-align: middle;width:25px;"
						  onclick="ShowHideTask('ddl_{$ItemID}_Topic','span_{$ItemID}_Topic');"></span>
					<a href="javascript:void(0);" class="" id="span_{$ItemID}_Topic"  style="top: 0; vertical-align: middle;text-decoration: none;margin-left:5px;"
					   onclick="ShowHideTask('ddl_{$ItemID}_Topic','span_{$ItemID}_Topic');">
						<xsl:choose>
							<xsl:when test="$TopicName">
								<xsl:value-of select="$TopicName"/>
							</xsl:when>
							<xsl:otherwise>Set Topic</xsl:otherwise>
						</xsl:choose>
					</a>

					<select id="ddl_{$ItemID}_Topic" name="summaryItems" style="display:none;margin-left:4px"
												oldparentid="{$OldParentID}"		class="smallDropdown sentenceFont" tabindex="5" onchange="UpdateTopicForTask_3_0({$ItemID},'ddl_{$ItemID}_Topic','span_{$ItemID}_Topic');">
						<option value="-1">
							-- Choose Topic --
						</option>
						<xsl:if test="count($TopicList) > 0">
							<xsl:for-each select="$TopicList">
								<xsl:choose>
									<xsl:when test="$TopicID = normalize-space(ItemID)">
										<option value="{normalize-space(ItemID)}" selected="selected">
											<xsl:value-of select="normalize-space(Item)"/>
										</option>
									</xsl:when>
									<xsl:otherwise>
										<option value="{normalize-space(ItemID)}">
											<xsl:value-of select="normalize-space(Item)"/>
										</option>
									</xsl:otherwise>
								</xsl:choose>

							</xsl:for-each>
						</xsl:if>
					</select>
				</div>
			</xsl:when>
			<xsl:otherwise>
				<div class="contnt"  style="margin-top:55px!important;">
					<span class="glyphicon glyphicon-list glypcolor onMouseOver" style="width:25px; top: 0; vertical-align: middle; margin-left:3px"
						  onclick="ShowHideTask('opt_ShareItUsers','span_ResponsibleUser');"></span>
					<a href="javascript:void(0);" onclick="return false;"  class="colorRes" id="span_{$ItemID}_Topic">
						<xsl:choose>
							<xsl:when test="$TopicName">
								<xsl:value-of select="$TopicName"/>
							</xsl:when>
						</xsl:choose>
					</a>
				</div>
			</xsl:otherwise>
		</xsl:choose>

		<!--Decription Element-->
		<xsl:if test="$ItemInfo/TypeID != 14">
			<div class="contntDec">

				<xsl:variable name="Desc" select="$ItemInfo/ActionDesc"></xsl:variable>
				<div id="{$ItemDivPrefix}_description">
					<table>
						<tr>
							<td>
								<span class="glyphicon glyphicon-comment glypcolor"
									  onclick="{$textAreaClick};
									  document.getElementById('displayDesc_{$ItemID}_Save').style.display='inline';" style="width:25px;margin-left:3px;"></span>
							</td>

							<xsl:choose>
								<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">

									<td class="paddingSlider" style="padding-left:10px;">
										<span id="displayDesc_{$ItemID}"
											   onclick="document.getElementById('sliderDesc_{$ItemID}').style.display='inline';
											   this.style.display='none';document.getElementById('TaskDesc_{$ItemID}').focus();
											  document.getElementById('displayDesc_{$ItemID}_Save').style.display='inline';" style="">
											<xsl:call-template name="break">
												<xsl:with-param name="text" select="$Desc"></xsl:with-param>
											</xsl:call-template>
										</span>
										<span style="display:none" id="sliderDesc_{$ItemID}" >
											<textarea id="TaskDesc_{$ItemID}" class="textAreaNotes" type="text"   onclick="this.focus();" 
													  style="margin-left:5px;width: 259px;height: 60px;"
													  onblur="document.getElementById('displayDesc_{$ItemID}').style.display='inline';
													  document.getElementById('sliderDesc_{$ItemID}').style.display='none';
													  document.getElementById('displayDesc_{$ItemID}_Save').style.display='none';
													  UpdateActionDesc_3_0({$ItemID},'displayDesc_{$ItemID}','TaskDesc_{$ItemID}')">
												<xsl:value-of select="$Desc"/>
											</textarea>
										</span>
									</td>
									<td style="vertical-align:bottom;padding-left:10px;">
										<span id="displayDesc_{$ItemID}_Save" style="display:none;"
											  class="glyphicon glyphicon-floppy-disk glypcolor glypcolorGray"></span>
									</td>
								</xsl:when>
								<xsl:otherwise>

									<td colspan="2">
										<span id="displayDesc_{$ItemID}">
											<xsl:value-of select="$ItemInfo/ActionDesc"/>
										</span>
									</td>


								</xsl:otherwise>
							</xsl:choose>
						</tr>
					</table>


				</div>

			</div>
		</xsl:if>

		<!--Responsible Element-->
		<div class="contnt">

			<xsl:choose>
				<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
					<span class="glyphicon glyphicon-user glypcolor onMouseOver" style=" top: 0; vertical-align: middle;width:25px;"
						  onclick="ShowHideTask('opt_ShareItUsers','span_ResponsibleUser');"></span>
					<span id="span_ResponsibleUser" style="padding-left:4px;color:black;vertical-align: middle;" class="onMouseOver"
						  onmouseover="this.style.textDecoration = 'underline';"
						  onmouseout="this.style.textDecoration = 'none';"
						  onclick="ShowHideTask('opt_ShareItUsers','span_ResponsibleUser');">
						<xsl:if test="normalize-space($ItemInfo/CurrentUserID) = normalize-space($ItemInfo/ResponsibleID)">Me</xsl:if>
						<xsl:if test="normalize-space($ItemInfo/CurrentUserID) != normalize-space($ItemInfo/ResponsibleID)">
							<xsl:choose>
								<xsl:when test="normalize-space($ItemInfo/ResponsibleID)='-99'">
									Set Responsible
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="normalize-space($ItemInfo/UserFullName)"/>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:if>
					</span>
				</xsl:when>
				<xsl:otherwise>
					<span class="glyphicon glyphicon-user glypcolor" style=" top: 0; vertical-align: middle;"></span>
					<span id="span_ResponsibleUser" style="padding-left:5px;color: black;vertical-align: middle;" class="">
						<xsl:if test="normalize-space($ItemInfo/CurrentUserID) = normalize-space($ItemInfo/ResponsibleID)">
							Me
						</xsl:if>
						<xsl:if test="normalize-space($ItemInfo/CurrentUserID) != normalize-space($ItemInfo/ResponsibleID)">
							<xsl:value-of select="normalize-space($ItemInfo/UserFullName)"/>
						</xsl:if>
					</span>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:variable name="CurrentUserLoginID">
				<xsl:value-of select="normalize-space($ItemInfo/CurrentUserID)"/>
			</xsl:variable>
			<select id="opt_ShareItUsers"  class="smallDropdown sentenceFont AddNewUser_{$GoalID}"
										   onchange="UpdateTaskResponsible_3_0('opt_ShareItUsers','{$ItemID}', '{$GoalID}', 'abc');"
										   style="width:130px;display:none;">
				<option value="-99">Select</option>
				<xsl:for-each select="$ShareItXML/User">

					<xsl:variable name="ResponsibleName">
						<xsl:choose>
							<xsl:when test="$CurrentUserLoginID = ID">
								<xsl:text>Me</xsl:text>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="FirstName"/>&#xa0;
								<xsl:value-of select="LastName"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:choose>
						<xsl:when test="ID = $ResponsibleID">
							<option value="{ID}" selected="selected" >
								<xsl:value-of select="$ResponsibleName"/>
							</option>
						</xsl:when>
						<xsl:otherwise>
							<option value="{ID}">
								<xsl:value-of select="$ResponsibleName"/>
							</option>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
				<option value="-1">More...</option>
			</select>
			<xsl:variable name="DisplayCrossStyle">
				<xsl:choose>
					<xsl:when test="normalize-space($ItemInfo/ResponsibleID) !='-99'">
						<xsl:text>display:inline;</xsl:text>
					</xsl:when>
					<xsl:otherwise>
						<xsl:text>display:none;</xsl:text>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:variable>

			<a title="Remove responsible" id="lnkResponsible" href="javascript:void(0);"
			   style="{$DisplayCrossStyle}margin-left:3%; top: 0; vertical-align: middle;float: right;padding-right: 15px;"
			   onclick="RemoveTaskResponsibleUser_3_0('opt_ShareItUsers', '{$ItemID}', '{$GoalID}', 'abc')">X</a>
		</div>

		<!--Date Element-->
		<div class="contnt">
			<span id="" style="color: black;">

				<xsl:variable name="varMode">
					<xsl:choose>
						<xsl:when test="$DateFormat='MMDDYY'">
							<xsl:text>GoalDetailTask30</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>GoalDetail30</xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:choose>
					<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
						<span  class="glyphicon glyphicon-calendar glypcolor onMouseOver width:25px;" style="vertical-align:middle"  onclick="{$OnClickDueDate};setCalenderForSlider();"></span>
						<span id="div_item_{$ItemID}" goalitemid="{$GoalID}">
							<div style="display:inline-block;" onclick="{$OnClickDueDate};setCalenderForSlider();"
								  id="div_item_{$ItemID}_title_content_subTitle_sliderPanel"
								  name="&lt;OperationalData&gt;&lt;Version&gt;2.0&lt;/Version&gt;
											  &lt;ItemID&gt;{$ItemID}&lt;/ItemID&gt;&lt;GoalID&gt;{$GoalID}&lt;/GoalID&gt;
											  &lt;Mode&gt;{$varMode}&lt;/Mode&gt;
											  &lt;ItemDivPrefix&gt;div_item_{$ItemID}&lt;/ItemDivPrefix&gt;
											  &lt;/OperationalData&gt;">

								<a id="div_item_{$ItemID}_title_container" href="javascript:void(0);" class="cal" onclick="return false;"
								   style="padding-left:6px">
									<span id="div_item_{$ItemID}_title_container_slider" class="paddingSlider" style="padding-left:0">
										<xsl:choose>
											<xsl:when test="normalize-space($ItemInfo/DueDate)">
												<xsl:value-of select="normalize-space($ItemInfo/DueDate)"/>
											</xsl:when>
											<xsl:otherwise>Set Due Date</xsl:otherwise>
										</xsl:choose>
									</span>
								</a>
							</div>
						</span>
						<xsl:variable name="DisplayCrossStyle">
							<xsl:choose>
								<xsl:when test="normalize-space($ItemInfo/DueDate) !=''">
									<xsl:text>display:inline;</xsl:text>
								</xsl:when>
								<xsl:otherwise>
									<xsl:text>display:none;</xsl:text>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:variable>
						<a title="Remove due date" class="cal" id="lnkDueDateSlider" href="javascript:void(0);"
						   style="{$DisplayCrossStyle}margin-left:3%;vertical-align:middle;float: right;padding-right: 15px;"
						   onclick="task_UpdateItemDate({$ItemID}, '01/01/0001', 'div_item_{$ItemID}_title_content_subTitle_sliderPanel', '{$GoalID}', '{$varMode}', 'div_item_{$ItemID}', '2.0');">X</a>

					</xsl:when>
					<xsl:otherwise>
						<span  class="glyphicon glyphicon-calendar glypcolor " style="vertical-align:middle;width:25px;"></span>
						<span id="{$ItemDivPrefix}_summarizedMenu_ItemSelectDate"
							  style="color: black;vertical-align:middle" class="paddingSlider">
							<xsl:value-of select="normalize-space($ItemInfo/DueDate)"/>
						</span>
					</xsl:otherwise>
				</xsl:choose>
			</span>
		</div>

		<!--Recurring Details-->
		<xsl:if test="$RecurringInTask='true'">
			<div style=" width: 100%;  float: left;  line-height: 40px;  border-bottom: #D6CECE solid 1px;  font-size: 13px; font-family: sans-serif; text-align: left;">

				<!--<xsl:choose>
				<xsl:when test="$ItemRecurringID !=''">
					<p>Exists</p>
				</xsl:when>
				<xsl:otherwise>
					<p>Not Exists</p>
				</xsl:otherwise>
			</xsl:choose>-->
				<xsl:variable name="ItemRecurringID">
					<xsl:choose>
						<xsl:when test="$ItemInfo/ItemRecurringID=''">
							<xsl:text>0</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$ItemInfo/ItemRecurringID"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>

				<xsl:choose>
					<xsl:when test="$PermissionID &gt;= 4">
						<div id="divMainViewRecurring_{$ItemID}">
							<xsl:call-template name="RecurringViewDetails">
								<xsl:with-param name="RecurringPeriodType" select="$ItemInfo/RecurringPeriodType"></xsl:with-param>
								<xsl:with-param name="RepeatEveryN" select="$ItemInfo/RepeatEveryN"></xsl:with-param>
								<xsl:with-param name="EndAfterN" select="$ItemInfo/EndAfterN"></xsl:with-param>
								<xsl:with-param name="Monday" select="$ItemInfo/Monday"></xsl:with-param>
								<xsl:with-param name="Tuesday" select="$ItemInfo/Tuesday"></xsl:with-param>
								<xsl:with-param name="Wednesday" select="$ItemInfo/Wednesday"></xsl:with-param>
								<xsl:with-param name="Thursday" select="$ItemInfo/Thursday"></xsl:with-param>
								<xsl:with-param name="Friday" select="$ItemInfo/Friday"></xsl:with-param>
								<xsl:with-param name="Saturday" select="$ItemInfo/Saturday"></xsl:with-param>
								<xsl:with-param name="Sunday" select="$ItemInfo/Sunday"></xsl:with-param>
								<xsl:with-param name="FirstOfMonthYN" select="$ItemInfo/FirstOfMonthYN"></xsl:with-param>
								<xsl:with-param name="MiddleOfMonthYN" select="$ItemInfo/MiddleOfMonthYN"></xsl:with-param>
								<xsl:with-param name="LastOfMonthYN" select="$ItemInfo/LastOfMonthYN"></xsl:with-param>
								<xsl:with-param name="ForceDaysBitmask" select="$ItemInfo/ForceDaysBitmask"></xsl:with-param>
								<xsl:with-param name="OnDaysBitmask" select="$ItemInfo/OnDaysBitmask"></xsl:with-param>
								<xsl:with-param name="ItemRecurringID" select="$ItemRecurringID"></xsl:with-param>
								<xsl:with-param name="ItemID" select="$ItemID"></xsl:with-param>
							</xsl:call-template>

						</div>

					</xsl:when>
					<xsl:otherwise>
						<xsl:if test="$ItemRecurringID &gt;0">
							<xsl:call-template name="RecurringViewDetails">
								<xsl:with-param name="RecurringPeriodType" select="$ItemInfo/RecurringPeriodType"></xsl:with-param>
								<xsl:with-param name="RepeatEveryN" select="$ItemInfo/RepeatEveryN"></xsl:with-param>
								<xsl:with-param name="EndAfterN" select="$ItemInfo/EndAfterN"></xsl:with-param>
								<xsl:with-param name="Monday" select="$ItemInfo/Monday"></xsl:with-param>
								<xsl:with-param name="Tuesday" select="$ItemInfo/Tuesday"></xsl:with-param>
								<xsl:with-param name="Wednesday" select="$ItemInfo/Wednesday"></xsl:with-param>
								<xsl:with-param name="Thursday" select="$ItemInfo/Thursday"></xsl:with-param>
								<xsl:with-param name="Friday" select="$ItemInfo/Friday"></xsl:with-param>
								<xsl:with-param name="Saturday" select="$ItemInfo/Saturday"></xsl:with-param>
								<xsl:with-param name="Sunday" select="$ItemInfo/Sunday"></xsl:with-param>
								<xsl:with-param name="FirstOfMonthYN" select="$ItemInfo/FirstOfMonthYN"></xsl:with-param>
								<xsl:with-param name="MiddleOfMonthYN" select="$ItemInfo/MiddleOfMonthYN"></xsl:with-param>
								<xsl:with-param name="LastOfMonthYN" select="$ItemInfo/LastOfMonthYN"></xsl:with-param>
								<xsl:with-param name="ForceDaysBitmask" select="$ItemInfo/ForceDaysBitmask"></xsl:with-param>
								<xsl:with-param name="OnDaysBitmask" select="$ItemInfo/OnDaysBitmask"></xsl:with-param>
								<xsl:with-param name="OnlyView" select="'true'"></xsl:with-param>
							</xsl:call-template>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</xsl:if>
		<!---->

		<!--Priority Element-->
		<div class="contnt">
			<div class="btn-group ">
				<button  type="button" class="multiselect dropdown-toggle btn padinone" data-toggle="{$DataToggle}" title="" aria-expanded="false" style="width: auto;padding:0px;">
					<span class="Priority star-default glyphicon glyphicon-star star_{$Priority}"  id="span_Brief_addPriority_{$ItemID}"></span>
					<span class="paddingSlider SpanTopPriority sliderCompletePercentage" id="span_addPriorityLabel_{$ItemID}">
						<xsl:value-of select="$ItemInfo/PriorityLabel"/>
					</span>
				</button>
				<ul class=" dropdown-menu Priority" id="ddl_Brief_addPriority_{$ItemID}" previousValue="{$Priority}" >
					<xsl:for-each select="$List/Priority/Option">

						<xsl:variable name="OnClickPriority">
							<xsl:choose>
								<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
									<xsl:text>UpdateItemPriority_3_0('</xsl:text>
									<xsl:value-of select="$ItemID"></xsl:value-of>
									<xsl:text>','</xsl:text>
									<xsl:value-of select="Value"></xsl:value-of>
									<xsl:text>','</xsl:text>
									<xsl:value-of select="PriorityLabel"/>
									<xsl:text>')</xsl:text>
								</xsl:when>
							</xsl:choose>
						</xsl:variable>

						<xsl:choose>
							<xsl:when test="Value=$Priority">
								<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>

		<!--Completion Percentage Element-->
		<div class="contnt">
			<div  class="btn-group">
				<button type="button" class="multiselect dropdown-toggle btn padinone" data-toggle="{$DataToggle}" title="" style="width: auto;" aria-expanded="false" >
					<span style="color: " class="star-default glyphicon {$CircleColor}_{round($percentage)}" id="span_AddCompletePercentage_{$ItemID}">
						<!--<xsl:value-of select="round($CurrentRecordRow/child::node()[name(.) = $CurrentColName])"/>-->
					</span>
					<span class="paddingSlider SpanTop sliderCompletePercentage" id="span_addcompletionPer_{$ItemID}" style="padding-left:7px;">
						<xsl:value-of select="$percentage"/>% Complete
					</span>
				</button>
				<ul class="dropdown-menu Priority" id="ddl_AddCompletePercentage_{$ItemID}" previousValue="{$percentage}">
					<xsl:for-each select="$List/CompletionPercentage/Option">
						<xsl:variable name="OnClickCP">
							<xsl:choose>
								<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
									<xsl:text>UpdateItemCompletionPercentage_3_0('</xsl:text>
									<xsl:value-of select="$ItemID"/>
									<xsl:text>','</xsl:text>
									<xsl:value-of select="Value"/>
									<xsl:text>','</xsl:text>
									<xsl:value-of select="$CircleColor"/>
									<xsl:text>');</xsl:text>
								</xsl:when>
							</xsl:choose>
						</xsl:variable>
						<xsl:choose>
							<xsl:when test="Value=$percentage">
								<li class="active" val="{round(Value)}">
									<a href="javascript:void(0);" onclick="{$OnClickCP}">
										<label class="radio" style="padding-left: 0px;">
											<span class="glyphicon {$CircleColor}_{round(Value)}" style="color: "></span>
										</label>
									</a>
								</li>
							</xsl:when>
							<xsl:otherwise>
								<li class="" val="{round(Value)}">
									<a href="javascript:void(0);" onclick="{$OnClickCP}">
										<label class="radio" style="padding-left: 0px;">
											<span class="glyphicon {$CircleColor}_{round(Value)}" style="color: "></span>
										</label>
									</a>
								</li>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:for-each>
				</ul>
			</div>

		</div>

		<!--Attachment Element-->
		<xsl:if test="$ItemInfo/TypeID != 14">
			<div class="contntDec" style="padding-left:21px">
				<table>
					<tr>
						<td>
							<xsl:choose>
								<xsl:when test="$PermissionID = 3 or $PermissionID &gt;= 4">
									<xsl:choose>
										<xsl:when test="$AttachItemID =0">
											<span id="spanAttachmentIcon" spanval="$AttachItemID"
												  class="glyphicon glyphicon-paperclip glypcolor onMouseOver" style="width:25px;float:left;"
												  onclick="viewContentLinkList_3_0({$ItemID},{$BrandID},{$BrandCommunityItemID},'div_AttachedItemTitle')"></span>

											<span id="spanAttachmentIcon" spanval="$AttachItemID" class="onMouseOver"
												  onclick="viewContentLinkList_3_0({$ItemID},{$BrandID},{$BrandCommunityItemID}
											  ,'div_AttachedItemTitle');this.style.display='none';" style="margin-left:7px;float:left;">Link Resource</span>
										</xsl:when>
										<xsl:otherwise>
											<span id="spanAttachmentIcon" spanval="$AttachItemID"
												  class="glyphicon glyphicon-paperclip glypcolor onMouseOver"
												  onclick="viewContentLinkList_3_0({$ItemID},{$BrandID},{$BrandCommunityItemID},'div_AttachedItemTitle')" style="width:25px;float:left;"></span>
										</xsl:otherwise>
									</xsl:choose>
								</xsl:when>
								<xsl:otherwise>
									<span id="spanAttachmentIcon" spanval="$AttachItemID" class="glyphicon glyphicon-paperclip glypcolor onMouseOver" style="margin-left:7px;float:left;"></span>
								</xsl:otherwise>
							</xsl:choose>
						</td>
						<td>
							<div id="div_AttachedItemTitle" val="{$AttachItemID}" style="padding-left:7px"></div>
							<!--<xsl:value-of select="$AttachItemID"/>-->
						</td>
					</tr>
				</table>
			</div>
		</xsl:if>

		<div class="contnt" id="div_item_{$ItemID}_operations" style="padding:0px !important;  display: block; margin-bottom: 100px!important;border-bottom:none;"></div>
		<xsl:choose>
			<xsl:when test="$PermissionID &gt;= 4 or $PortalPermissionID &gt;= 4 or $MasterPortalPermissionID &gt;= 4">
				<div  id="SliderItem" class="contnt" style="width:100%;border-top: #ddd solid 1px;">
					<span style="float:left;width:17%;">
						<a href="javascript:void(0)">
							<span>&#xa0;</span>
						</a>
					</span>
					<span style="float:left;width:22%;">
						<a href="#" onclick="return DeleteActionMode_ForVersion({$ItemID},{$GoalID}, 'div_item_{$ItemID}', '2.0');">
							<span class="glyphicon glyphicon-trash glypcolor" ></span> Delete
						</a>
					</span>

				</div>
			</xsl:when>

		</xsl:choose>


		<div id="divAutoGrowTempDivContainer" style="visibility:hidden;">
		</div>
	</xsl:template>

</xsl:stylesheet>
