﻿<?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="CategoriesControl.xslt"/>
	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">
		<xsl:variable name="BrandID" select="AjaxRequest/Params/BrandID"></xsl:variable>
		<xsl:variable name="Origin" select="AjaxRequest/Params/Origin"></xsl:variable>
		<xsl:variable name="SourcePage" select="AjaxRequest/Params/SourcePage"></xsl:variable>
		<xsl:variable name="ItemID" select="AjaxRequest/Params/ItemID"></xsl:variable>
		<xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
		<xsl:variable name="HostName" select="AjaxRequest/HostName"></xsl:variable>
		<xsl:variable name="UserID" select="AjaxRequest/UserID"></xsl:variable>
		<xsl:variable name="GoalOpenControlXML" select="AjaxRequest/GoalOpenControlXML/."></xsl:variable>
		<xsl:variable name="GoalNotesFormatXML" select="AjaxRequest/GoalNotesFormatXML/."></xsl:variable>
		<xsl:variable name="NumberGoalPermissionXML" select="AjaxRequest/NumberGoalPermission/."></xsl:variable>
		<xsl:variable name="PortalDefaultImageURL" select="AjaxRequest/Lifespace/ImageURL"></xsl:variable>
		<xsl:variable name="TemplateType" select="AjaxRequest/Params/TemplateType"></xsl:variable>
		<xsl:variable name="IsSecureConnection" select="AjaxRequest/IsSecureConnection"/>
		<xsl:variable name="ClassificationList" select="AjaxRequest/Settings/DefaultSettings/Classification"></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>

		<div id="divAddTemplate">
			<input id="templateImagePath" type="hidden" value="{$PortalDefaultImageURL}"></input>

			<table class="tableMaster" cellpedding="2" cellspacing="5">
				<xsl:choose>
					<xsl:when test="$Origin='Update'">
						<xsl:variable name="Item" select="AjaxRequest/TemplateData/Item/ItemName"></xsl:variable>
						<xsl:variable name="Description" select="normalize-space(AjaxRequest/TemplateData/Item/Description)"></xsl:variable>
						<xsl:variable name="Waiver" select="AjaxRequest/TemplateData/Item/Waiver"></xsl:variable>
						<xsl:variable name="Type" select="AjaxRequest/TemplateData/Item/Type"></xsl:variable>
						<xsl:variable name="ImageUrl" select="normalize-space(AjaxRequest/TemplateData/Item/ImageURL)"></xsl:variable>
						<xsl:variable name="PublicYN" select="AjaxRequest/TemplateData/Item/PublicYN"></xsl:variable>
						<xsl:variable name="PublishedYN" select="AjaxRequest/TemplateData/Item/PublishedYN"></xsl:variable>
						<xsl:variable name="TempStatus" select="AjaxRequest/TemplateData/Item/Status"></xsl:variable>
						<xsl:variable name="SuccessKey" select="AjaxRequest/TemplateData/Item/SuccessKey"></xsl:variable>
						<xsl:variable name="Classification" select="AjaxRequest/TemplateData/Item/Classification"></xsl:variable>


						<tr style="display:none;">
							<td>
								<span>File Upload</span>
							</td>
							<td>
								<input type="file" id="txtFile" style="width:100%;"></input>
							</td>
						</tr>
						<tr>
							<td>
								<span>Name</span>
							</td>
							<td>
								<input type="textbox" id="txtName" style="width:100%;" value="{$Item}"></input>
							</td>
						</tr>
						<tr>
							<td>
								<span>Description</span>
							</td>
							<td>
								<textarea rows="3" id="txtDescription"  class="textAreaBox">
									<xsl:value-of select="$Description"/>
								</textarea>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span>WaiverID</span>
							</td>
							<td>
								<input type="textbox" id="txtWaiver" style="width:100%;" value="{$Waiver}"></input>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span>TypeID</span>
							</td>
							<td>
								<input type="textbox" id="txtType" style="width:100%;" value="{$Type}"></input>
							</td>
						</tr>
						<tr>
							<td>
								<span>Brand</span>
							</td>
							<td>
								<select id="ddlBrand" class="smallDropDown" style="width:125px;">
									<xsl:for-each select="AjaxRequest/Brands/Brand">
										<xsl:choose>
											<xsl:when test="BrandID = $BrandID">
												<option value="{BrandID}" selected="selected">
													<xsl:value-of select="BrandKey"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{BrandID}">
													<xsl:value-of select="BrandKey"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:for-each>
								</select>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span>Goal Type</span>
							</td>
							<td>
								<input id="rdb_{$ItemID}_PersonalGoal" type="radio" name="GoalType" checked="checked"
                                        onclick="document.getElementById('span_OpenTo_Text').style.display='none';
                                                 document.getElementById('opt_OpenTo').style.display='none';
                                                 document.getElementById('tr_NumbersEnteredBy').style.display='none';">
									<span class="publicationSummary marginRight10">Personal Goal</span>
								</input>
								<input id="rdb_{$ItemID}_GroupChallenge" type="radio" name="GoalType" style="display:none;"
                                       onclick="document.getElementById('span_OpenTo_Text').style.display='inline';
                                                document.getElementById('opt_OpenTo').style.display='inline';
                                                document.getElementById('tr_NumbersEnteredBy').style.display='inline';">
									<span class="publicationSummary" style="display:none;">Group Challenge</span>
								</input>
							</td>
						</tr>
						<tr>
							<td>
								<span>Measure Success</span>
							</td>
							<td>
								<select id="ddlSuccessKey" class="smallDropDown" style="width:125px;">
									<xsl:choose>
										<xsl:when test ="$SuccessKey = 'Number'">
											<option value="Action">Completing Actions</option>
											<option value="Number" selected="selected">By Numbers and Metrics</option>
										</xsl:when>
										<xsl:otherwise>
											<option value="Action" selected="selected">Completing Actions</option>
											<option value="Number">By Numbers and Metrics</option>
										</xsl:otherwise>
									</xsl:choose>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								<span>Classification</span>
							</td>
							<td>
								<select id="ddlClassification" class="smallDropDown" style="width:125px;">
									<xsl:for-each select="$ClassificationList/Values">
										<xsl:choose>
											<xsl:when test="Value=''">
												<option value="{Value}" selected="selected">
													<xsl:value-of select="Text"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{Value}">
													<xsl:value-of select="Text"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:for-each>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								<span>Control Key</span>
							</td>
							<td>
								<input type="text" value="" id="txtControllKey_AddNew"></input> 
							</td>
						</tr>
						<tr>
							<td>
								<span>PublicYN</span>
							</td>
							<td>
								<select id="ddlPublicYN" class="smallDropDown" style="width:125px;">

									<xsl:choose>
										<xsl:when test="$PublicYN='True'">
											<option value="1" selected="selected">Yes</option>
											<option value="0">No</option>
										</xsl:when>
										<xsl:otherwise>
											<option value="1">Yes</option>
											<option value="0" selected="selected">No</option>
										</xsl:otherwise>
									</xsl:choose>
								</select>
							</td>
						</tr>
						<tr>
							<td>PublishedYN</td>
							<td>
								<select id="ddlPublishedYN" class="smallDropDown" style="width:125px;">
									<xsl:choose>
										<xsl:when test="$PublishedYN='True'">
											<option value="1" selected="selected">Yes</option>
											<option value="0">No</option>
										</xsl:when>
										<xsl:otherwise>
											<option value="1">Yes</option>
											<option value="0" selected="selected">No</option>
										</xsl:otherwise>
									</xsl:choose>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								<span>Status</span>
							</td>
							<td>
								<select id="ddlStatus" class="smallDropDown" style="width:125px;">
									<xsl:for-each select="AjaxRequest/Template/TemplateStatus">
										<xsl:choose>
											<xsl:when test="StatusID=$TempStatus">
												<option value="{StatusID}" selected="selected">
													<xsl:value-of select="Status"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{StatusID}">
													<xsl:value-of select="Status"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:for-each>
								</select>
							</td>
						</tr>

						<tr id="tr_NumbersEnteredBy" style="display:none;">
							<td>
								<span>Numbers Entered By</span>
							</td>
							<td>
								<select id="ddl_NumbersEnteredBy" class="smallDropDown" style="width:125px;">
									<option value="-99">-Select-</option>
									<xsl:for-each select="$NumberGoalPermissionXML/Permission">
										<option value="{ID}">
											<xsl:value-of select="NumbersEnteredBy"/>
										</option>
									</xsl:for-each>
								</select>
							</td>
						</tr>

						<tr>
							<td>
								<span>Category Keys</span>
							</td>
							<td>
								<div id="divCategoryXml">
									<xsl:variable name="EditTemplateDisplay">
										<xsl:choose>
											<xsl:when test="count(AjaxRequest/CategoryControl/SelectedCategoryList/Item) &gt; 0">
												<xsl:text>display:block</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>display:none</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="UpdateTemplateCategoriesDisplay">
										<xsl:choose>
											<xsl:when test="count(AjaxRequest/CategoryControl/SelectedCategoryList/Item) &gt; 0">
												<xsl:text>display:none</xsl:text>
											</xsl:when>
											<xsl:otherwise>
												<xsl:text>display:block</xsl:text>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:call-template name="CategoryControl">
										<xsl:with-param name="UpdateTemplateCategoriesDisplay" select="$UpdateTemplateCategoriesDisplay"></xsl:with-param>
										<xsl:with-param name="EditTemplateDisplay" select="$EditTemplateDisplay"></xsl:with-param>
									</xsl:call-template>
								</div>
							</td>
						</tr>
						<tr>
							<td>

							</td>
							<td>
								<xsl:choose>
									<xsl:when test="$PortalDefaultImageURL != ''">
										<div id="div_TemplateLogo" style="height:100px;" class="onMouseOver"
                                     onClick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=Template&amp;cropRatio=2&amp;requiredHeight=100&amp;requiredWidth=100&amp;requiredFileName=Logo&amp;Key=UploadPathItems&amp;TemplateID={$ItemID}',
                                                                'Upload_Image','530','390','{$ItemID}','UploadTemplateImage','div_TemplateLogo',null,0);">
											<img id="img_TemplateImage_{$UserID}" src="{$PortalDefaultImageURL}" height="100" width="100" style="cursor:pointer;"
                                                 onmouseover="this.className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"></img>
											<span id="span_imageText" style="display:none;position:relative;top:-70px;margin-left:25px;" class="labelLifespaceItem"
                                                 onmouseover="document.getElementById('img_TemplateImage_{$UserID}').className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                    onmouseout="document.getElementById('img_TemplateImage_{$UserID}').setAttribute('class','');document.getElementById('span_imageText').style.display ='none';">
												Change <br/> Photo
											</span>
										</div>
									</xsl:when>
									<xsl:otherwise>
										<div id="div_TemplateLogo" style="height:100px;" class="onMouseOver"
                                      onClick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=Template&amp;cropRatio=2&amp;requiredHeight=100&amp;requiredWidth=100&amp;requiredFileName=Logo&amp;Key=UploadPathItems&amp;TemplateID={$ItemID}',
                                                                'Upload_Image','530','390','{$ItemID}','UploadTemplateImage','div_TemplateLogo',null,0);">
											<img id="img_TemplateImage_{$UserID}" src="{$ImageUrl}" height="100" width="100" style="cursor:pointer;"
                                          
                                                 onmouseover="this.className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_imageText').style.display ='none';"></img>

											<span id="span_imageText" style="display:none;position:relative;top:-70px;color:gray;margin-left:25px;" class="labelLifespaceItem"
                                                 onmouseover="document.getElementById('img_TemplateImage_{$UserID}').className='grayOut';document.getElementById('span_imageText').style.display ='block';"
                                                    onmouseout="document.getElementById('img_TemplateImage_{$UserID}').setAttribute('class','');document.getElementById('span_imageText').style.display ='none';">
												Change <br/> Photo
											</span>
										</div>
									</xsl:otherwise>
								</xsl:choose>

							</td>
						</tr>
						<tr>
							<td colspan="2">
								<div>
									<span style="margin-right:15px;">
										<input class="anchorButton"
                                               onclick="return ClientPortal_UpdateTemplateData('{$ItemID}', 'txtFile', 'txtName', 'txtDescription', 
                                                                                                'txtWaiver', 'txtImageURL', 'txtType', 'ddlBrand', 
                                                                                                'ddlPublicYN', 'ddlPublishedYN', 'ddlStatus', 'divCategoryXml',
                                                                                                'ddlSuccessKey');"
                                               type="button" id="btnSave" value="Update"></input>
									</span>
									<span>
										<input class="anchorButton"
                                               onclick="clientPortal_LoadTemplateDetail('{$ItemID}','divClientPortalOperations_Container','{$BrandID}');" type="button" id="btnCancel" value="Cancel"></input>
									</span>
								</div>
							</td>
						</tr>
					</xsl:when>
					<xsl:otherwise>
						<tr>
							<td width="20%">
								<span class="packageTitle">Name</span>
							</td>
							<td width="80%">
								<input type="textbox" id="txtName" style="width:100%;"></input>
							</td>
						</tr>
						<tr>
							<td>
								<span class="packageTitle">Description</span>
							</td>
							<td>
								<textarea id="txtDescription"  class="textAreaBox" type="text"
                                          onFocus="removeWhiteSpace('txtDescription');">
								</textarea>
							</td>
						</tr>

						<tr style="display:none;">
							<td>
								<span class="packageTitle">PublicYN</span>
							</td>
							<td>
								<select id="ddlPublicYN" class="smallDropDown" style="width:125px;">
									<option value="-99" selected="selected">Select</option>
									<xsl:choose>
										<xsl:when test="$TemplateType = 'Internal'">
											<option value="1">Yes</option>
											<option value="0" selected="selected">No</option>
										</xsl:when>
										<xsl:when test="$TemplateType = 'Public'">
											<option value="1" selected="selected">Yes</option>
											<option value="0">No</option>
										</xsl:when>
									</xsl:choose>
								</select>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span class="packageTitle">Goal Type</span>
							</td>
							<td>
								<input id="rdb_{$ItemID}_PersonalGoal" type="radio" name="GoalType" checked="checked"
                                       onclick="document.getElementById('tr_OpenTo').style.display='none';
                                                document.getElementById('tr_NotesFormat').style.display='none';                                    
                                                document.getElementById('tr_JoinDeadline').style.display='none';
                                                ">
									<span class="publicationSummary marginRight10">Personal Goal</span>
								</input>
								<input id="rdb_{$ItemID}_GroupChallenge" type="radio" name="GoalType" style="display:none;"
                                       onclick="document.getElementById('tr_OpenTo').style.display='table-row';
                                                document.getElementById('tr_NotesFormat').style.display='table-row';                                   
                                                document.getElementById('tr_JoinDeadline').style.display='table-row';
                                               ">
									<span class="publicationSummary" style="display:none;">Group Challenge</span>
								</input>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span class="packageTitle">Measure Success</span>
							</td>
							<td>
								<select id="ddlSuccessKey" class="smallDropDown" style="width:125px;">
									<option value="Action" selected="selected">Completing Actions</option>
									<option value="Number">By Numbers and Metrics</option>
								</select>
							</td>
						</tr>
						<tr style="display:none">
							<td>
								<span class="packageTitle">Classification</span>
							</td>
							<td>
								<select id="ddlClassification" class="smallDropDown" style="width:125px;">
									<xsl:for-each select="$ClassificationList/Values">
										<xsl:choose>
											<xsl:when test="Value=''">
												<option value="{Value}" selected="selected">
													<xsl:value-of select="Text"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{Value}">
													<xsl:value-of select="Text"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:for-each>
								</select>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span class="packageTitle">Status</span>
							</td>
							<td>
								<select id="ddlStatus" class="smallDropDown" style="width:125px;">
									<option value="-99" selected="selected">Select</option>
									<xsl:for-each select="AjaxRequest/Template/TemplateStatus">
										<xsl:choose>
											<xsl:when test="Status = 'Internal'">
												<option value="{StatusID}" selected="selected">
													<xsl:value-of select="Status"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{StatusID}">
													<xsl:value-of select="Status"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:for-each>
								</select>
							</td>
						</tr>
						<tr style="display:none;">
							<td>
								<span class="packageTitle">Link to:</span>
							</td>
							<td>
								<select id="ddlLifespace" class="smallDropDown" style="width:125px;">
									<xsl:for-each select="AjaxRequest/Lifespace/LifespaceName">
										<xsl:choose>
											<xsl:when  test="Item = 'Fitness'">
												<option value="{ItemID}" selected="selected">
													<xsl:value-of select="Item"/>
												</option>
											</xsl:when>
											<xsl:otherwise>
												<option value="{ItemID}">
													<xsl:value-of select="Item"/>
												</option>
											</xsl:otherwise>
										</xsl:choose>

									</xsl:for-each>
									<xsl:if test="$BrandID != 0">
										<option selected="selected" value="{AjaxRequest/Lifespace/Brand/ItemID}">
											<xsl:value-of select="AjaxRequest/Lifespace/Brand/CompanyName"/>
										</option>
									</xsl:if>
								</select>
							</td>
						</tr>
						<tr id="tr_numbersEnteredBy" style="display:none;">
							<td>
								<span class="packageTitle">Numbers Entered By:</span>
							</td>
							<td>
								<select id="ddl_NumbersEnteredBy" class="smallDropDown" style="width:125px;">
									<option value="-99">-Select-</option>
									<xsl:for-each select="$NumberGoalPermissionXML/Permission">
										<option value="{ID}">
											<xsl:value-of select="NumbersEnteredBy"/>
										</option>
									</xsl:for-each>
								</select>
							</td>
						</tr>
						<tr style="display:none;">
							<td>

							</td>
							<td>
								<xsl:choose>
									<xsl:when test="$PortalDefaultImageURL != ''">
										<div id="div_TemplateLogo" style="height:100px;" class="onMouseOver"
                                     onClick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=TempItemsTemplate&amp;cropRatio=2&amp;requiredHeight=100&amp;requiredWidth=100&amp;requiredFileName=Logo&amp;Key=UploadPathTempLocation&amp;UserID={$UserID}',
                                                                'Upload_Image','530','390','0','UploadTemplateLogo','div_TemplateLogo',null,0);">
											<img id="img_AddTemplateImage_{$UserID}" src="{$PortalDefaultImageURL}" height="100" width="100" style="cursor:pointer;"
                                                 onmouseover="this.className='grayOut';document.getElementById('span_AddTemplateImageText').style.display ='block';"
                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_AddTemplateImageText').style.display ='none';"></img>
											<span id="span_AddTemplateImageText" style="display:none;position:relative;top:-70px;margin-left:25px;" class="labelLifespaceItem"
                                                 onmouseover="document.getElementById('img_AddTemplateImage_{$UserID}').className='grayOut';document.getElementById('span_AddTemplateImageText').style.display ='block';"
                                                    onmouseout="document.getElementById('img_AddTemplateImage_{$UserID}').setAttribute('class','');document.getElementById('span_AddTemplateImageText').style.display ='none';">
												Change <br/> Photo
											</span>
										</div>
									</xsl:when>
									<xsl:otherwise>
										<div id="div_TemplateLogo" style="height:100px;" class="onMouseOver"
                                      onClick="ImageUploader_PopupCenter('{$Protocol}{$HostName}/upload/uploadimage.aspx?guid=TempItemsTemplate&amp;cropRatio=2&amp;requiredHeight=100&amp;requiredWidth=100&amp;requiredFileName=Logo&amp;Key=UploadPathTempLocation&amp;UserID={$UserID}',
                                                                'Upload_Image','530','390','0','UploadTemplateLogo','div_TemplateLogo',null,0);">
											<img id="img_AddTemplateImage_{$UserID}" src="{$TemplateURL}/Web/Images/Ver_2_0/DefaultUserPic.jpg" height="100" width="100" style="cursor:pointer;"
                                          
                                                 onmouseover="this.className='grayOut';document.getElementById('span_AddTemplateImageText').style.display ='block';"
                                                 onmouseout="this.setAttribute('class','');document.getElementById('span_AddTemplateImageText').style.display ='none';"></img>

											<span id="span_AddTemplateImageText" style="display:none;position:relative;top:-70px;color:gray;margin-left:25px;" class="labelLifespaceItem"
                                                 onmouseover="document.getElementById('img_AddTemplateImage_{$UserID}').className='grayOut';document.getElementById('span_AddTemplateImageText').style.display ='block';"
                                                    onmouseout="document.getElementById('img_AddTemplateImage_{$UserID}').setAttribute('class','');document.getElementById('span_AddTemplateImageText').style.display ='none';">
												Change <br/> Photo
											</span>
										</div>
									</xsl:otherwise>
								</xsl:choose>

							</td>
						</tr>
						<tr>
							<td>
								<xsl:choose>
									<xsl:when test="$SourcePage = 'Portal'">
										<div class="onMouseOver divBrowseGradient spanBrowseGradientTextGray"
                                             onclick="SaveTemplateFromPortal('txtName','txtDescription',
                                                                            'txtImageURL', 'ddlStatus',
                                                                            'ddlPublicYN', '{$BrandID}', 'ddlLifespace',
                                                                            'ddlSuccessKey','templateImagePath','ddlClassification','txtControllKey_AddNew');
                                                       closePopupWhiteLayerContainer();"
                                             onmouseout="document.getElementById('img_Submit').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';"
                                             onmouseover="document.getElementById('img_Submit').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                             style="width:80px;line-height:30px;">
											<img id="img_Submit" class="marginRight5" align="absmiddle" style="padding-left:8px;"
                                                 src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png"/>
											<span id="span_Save">SAVE</span>
										</div>
									</xsl:when>
									<xsl:when test="$SourcePage = 'Lifespace'">
										<div class="onMouseOver divBrowseGradient spanBrowseGradientTextGray"
                                             onclick="SaveTemplateFromLifespace('txtName','txtDescription',
                                                                            'txtImageURL', 'ddlStatus',
                                                                            'ddlPublicYN', '{$BrandID}', 'ddlLifespace',
                                                                            'ddlSuccessKey','templateImagePath', '{$SourcePage}');"
                                             onmouseout="document.getElementById('img_Submit').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';"
                                             onmouseover="document.getElementById('img_Submit').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                             style="width:80px;line-height:30px;">
											<img id="img_Submit" class="marginRight5" align="absmiddle" style="padding-left:8px;"
                                                 src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png"/>
											<span id="span_Save">SAVE</span>
										</div>
									</xsl:when>
								</xsl:choose>

							</td>
							<td>
								<div class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray"
                                    onclick="closePopupWhiteLayerContainer();"
                                    onmouseout="document.getElementById('img_Cancel').src='{$TemplateURL}Web/Images/Ver_2_0/BT_x.png';"
                                    onmouseover="document.getElementById('img_Cancel').src='{$TemplateURL}Web/Images/Ver_2_0/BT_x_hover.png';"
                                    style="width:80px;line-height:30px;">
									<img id="img_Cancel" class="marginRight5" align="absmiddle" style="padding-left:8px;"
                                         src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png"/>
									<span id="span_Cancel">CANCEL</span>
								</div>

							</td>

						</tr>
					</xsl:otherwise>
				</xsl:choose>
			</table>
		</div>
	</xsl:template>
</xsl:stylesheet>
