﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="WizardButtons.xslt"/>
	<xsl:include href="GenericTemplates/Notes_LineBreak.xslt"/>
	<xsl:include href="Version_2_0/AddVision.xslt"/>

	<xsl:template match="/">
		<input id="templateXML" type="hidden" value="&lt;Templates&gt;&lt;/Templates&gt;" ></input>
		<xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>
		<xsl:variable name="TemplateURL" select="normalize-space(AjaxRequest/TemplateURL)"></xsl:variable>

		<xsl:call-template name="WizardButtons">
			<xsl:with-param name="TemplatePathURL" select="normalize-space(AjaxRequest/TemplateURL)"></xsl:with-param>
			<xsl:with-param name="Source" select="normalize-space(AjaxRequest/Params/Orgin)"></xsl:with-param>
			<xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
		</xsl:call-template>

		<table style="margin-top:10px;">

			<tr>
				<td colspan="2">
					<div id="divHeader">
						<span class="userWizardHeaderText">
							Step 2 of 4 - Your Action Plan for the Year.
						</span>
					</div>
					<div class="marginBottom20">
						<span class="userWizardMemoText">
							“Excellent!  So now, let’s start to think about what you will need to get accomplished this year in order to stay on track. You can select from the Recommended Goal Templates as well as enter your own custom goals.”
						</span>
					</div>
				</td>
			</tr>

			<xsl:for-each select="AjaxRequest/LifeSpaces/LifeSpace[ItemPermissionID &gt; 0 or TypeID = 2 or count(Goals/Goal) &gt; 0]">
                <xsl:variable name="LifespaceItemID" select="ItemID"></xsl:variable>
				<xsl:variable name="Type">
					<xsl:choose>
						<xsl:when test="Statement!='' or Description!=''">
							<xsl:text>EDIT</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text>ADD</xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="divPadding">
					<xsl:choose>
						<xsl:when test="Statement!=''">
							<xsl:text>padding-left:5px;</xsl:text>
						</xsl:when>
						<xsl:otherwise>
							<xsl:text></xsl:text>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<tr>
					<td>
						<div align="center">
							<a class="link" href="http://{$HostName}/LifeSpace.aspx?ID={ItemID}" target="_blank">
								<xsl:choose>
									<xsl:when test="TypeID = 2 and Item != 'LifeSpace LLC'">
										<img src="http://{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/Ver_2_0/goalDefault_{normalize-space(Item)}.jpg"
                                            style="border:0px;display:none;" onload='setWidthAndHeightImage(this,"80");'></img>
									</xsl:when>
									<xsl:otherwise>
										<xsl:choose>
											<xsl:when test="TypeID = 3 and ImageURL != ''">
												<img src="{ImageURL}" alt="" style="border:0px;display:none;" onload='setWidthAndHeightImage(this,"80");'></img>
											</xsl:when>
											<xsl:otherwise>
												<img alt='' src="http://{$HostName}/DesktopModules/LifeSpaceTemplates/Web/Images/LifeSpace LLC.jpg"
                                                     style="border:0px;" onload='setWidthAndHeightImage(this,"80");'></img>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:otherwise>
								</xsl:choose>
							</a>
						</div>
						<div align="center" class="marginTop5">
							<a class="userWizardLabel" href="http://{$HostName}/LifeSpace.aspx?ID={ItemID}" target="_blank">
								<span class="userWizardLabel">
									<xsl:value-of select="Item"/>
								</span>
							</a>
						</div>
					</td>
					<td>
						<xsl:if test="TypeID = 2">
							<div id="divEditDiscription_{ItemID}" style="display:block;margin-bottom:15px;">
								<div id="spanLifeSpaceStatement_{ItemID}" style="width:620px;font-weight: bold;" class="overFlowHidden userWizardMemoText">
									<xsl:call-template name="break">
										<xsl:with-param name="text" select="Statement"></xsl:with-param>
									</xsl:call-template>
								</div>
								<div id="spanLifeSpaceDiscription_{ItemID}" style="width:600px;{$divPadding}" class="overFlowHidden userWizardMemoText">
									<xsl:call-template name="break">
										<xsl:with-param name="text" select="Description"></xsl:with-param>
									</xsl:call-template>
								</div>
								<span class="link" onclick="displayVisionPopUp('{ItemID}','{$Type}','plan');" style="color:gray;">
									(<xsl:value-of select="$Type"></xsl:value-of> VISION STATEMENT)
								</span>
							</div>
							<div id="divUpdateDiscription_{ItemID}" style="display:none;">

							</div>
						</xsl:if>
						<xsl:variable name="GoalCount" select="count(Goals/Goal)"></xsl:variable>

						<div class="labelGoalTopicsItalicText onMouseOver"  onclick="coaches_flipDiv('div_Goals_{ItemID}');">
							My Goals (<xsl:value-of select="$GoalCount"/>)
						</div>
						<div id="div_Goals_{ItemID}" style="margin-left:5px; ">
							<xsl:for-each select="Goals/Goal">
								<div style="color: rgb(55, 96, 146);">
									<a class="linkHeader" href="http://{$HostName}/Goal.aspx?ID={ItemID}" target="_blank">
										<xsl:value-of select="Item"/>
									</a>
								</div>
							</xsl:for-each>
						</div>
						<xsl:choose>
							<xsl:when test="ItemPermissionID &gt; 0 or TypeID = 2">
								<div style="padding-top:10px; margin-left:5px;">
									<div id ="div_AddNewGoal_{ItemID}" ></div>
									<input style="width:400px" id ="input_AddNewGoal_{ItemID}" type="text" name="txtAddGoal" class="textAreaNotes" value=" Add new goal here…" onclick="createNewGoal({ItemID},  'div_AddNewGoal_{ItemID}', 'PlanPage','');"></input>
								</div>
							</xsl:when>
						</xsl:choose>

						<div style="padding-top:10px;">
							<xsl:variable name="TemplateCount" select="count(Template)"></xsl:variable>

							<div id="divTemplate_{ItemID}_Heading" class="labelGoalTopicsItalicText onMouseOver" onclick="coaches_flipDiv('divTemplateList_{ItemID}');">
								Recommended GoalPlans (<xsl:value-of select="$TemplateCount"/>)
							</div>
							<div id="divTemplateList_{ItemID}" style="margin-left:5px;display:none;">
								<xsl:for-each select="Template">
									<div class="label">
										<input id="chk_LifeSpace_Template_{$LifespaceItemID}_{ItemID}" type="checkbox" name="cbTemplate" ItemID="-1"
											   onclick="plan_SaveTemplateActivateGoal('chk_LifeSpace_Template_{$LifespaceItemID}_{ItemID}',{ItemID},{../ItemID}, '', 'aTemplate{ItemID}_LifeSpace{../ItemID}');"></input>
										<a class="linkHeader" id="aTemplate{ItemID}_LifeSpace{../ItemID}" href="http://{$HostName}/{PromoteKey}" target="_blank">
											<xsl:value-of select="Name"/>
										</a>
										<div id="div_AddTemplate_{ItemID}_{../ItemID}">
										</div>
									</div>
								</xsl:for-each>
							</div>
						</div>
					</td>
				</tr>

				<tr>
					<td colspan="2">
						<div class="seperatorLine"></div>
					</td>
				</tr>
			</xsl:for-each>
		</table>

		<table class="tableMaster" cellpadding="0" cellspacing="0">
			<tr>
				<td width="85%" align="left">
					<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray textCenter"
                        style="width:130px;height:30px;display:table-cell;"
                        onmouseover="document.getElementById('img_SuperPage').src='{normalize-space(AjaxRequest/TemplateURL)}/Images/Ver_2_0/BT_arrow_hover.png';"
                        onmouseout="document.getElementById('img_SuperPage').src='{normalize-space(AjaxRequest/TemplateURL)}/Images/Ver_2_0/BT_arrow.png';">
						<a href="http://{$HostName}/Home.aspx" class="decorationNone">
							<img id="img_SuperPage" style="padding-left:8px;border:0px;" src="{normalize-space(AjaxRequest/TemplateURL)}Web/Images/Ver_2_0/BT_arrow.png" align="absmiddle"
                                 class="marginRight5"></img>
							<span id="span_Next" class="spanBrowseGradientTextGray">Go To SuperPage</span>
						</a>
					</div>
				</td>
				<td width="15%" align="right">
					<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray textCenter"
                        style="width:100px;height:30px;display:table-cell;"
                        onmouseover="document.getElementById('img_Next').src='{normalize-space(AjaxRequest/TemplateURL)}Web/Images/Ver_2_0/BT_arrow_hover.png';"
                        onmouseout="document.getElementById('img_Next').src='{normalize-space(AjaxRequest/TemplateURL)}Web/Images/Ver_2_0/BT_arrow.png';">
						<a href="http://{$HostName}/CommunityWizard.aspx" class="decorationNone">
							<img id="img_Next" style="padding-left:8px;border:0px;" src="{normalize-space(AjaxRequest/TemplateURL)}Web/Images/Ver_2_0/BT_arrow.png"
                                 align="absmiddle" class="marginRight5"></img>
							<span id="span_Next" class="spanBrowseGradientTextGray">CONTINUE</span>
						</a>
					</div>
				</td>
			</tr>
		</table>

	</xsl:template>
</xsl:stylesheet>
