﻿<?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="../Version_2_0/PopUpHeader.xslt"/>

	<xsl:output method="xml" indent="yes"/>

	<xsl:template match="/">
		<xsl:variable name="TemplateURL" select="AjaxRequest/TemplateURL"></xsl:variable>
		<xsl:variable name="BrandID" select="AjaxRequest/Params/BrandID"></xsl:variable>
		<xsl:variable name="PortalItemID" select="AjaxRequest/Params/PortalItemID"></xsl:variable>
		<xsl:variable name="BrandTabPublicYN" select="AjaxRequest/BrandTabXML/BrandTab/PublicYN"></xsl:variable>
		<xsl:variable name="BrandTabDisplayName" select="AjaxRequest/BrandTabXML/BrandTab/BrandTabDisplayName"></xsl:variable>
		<xsl:variable name="BrandTabType" select="AjaxRequest/BrandTabXML/BrandTab/BrandTabType"></xsl:variable>
		<xsl:variable name="BrandTabTypes" select="AjaxRequest/BrandTabs/."></xsl:variable>
		<xsl:variable name="SectionHTML" select="AjaxRequest/BrandTabXML/BrandTab/SectionHTML"></xsl:variable>
		<xsl:variable name="BrandTabID" select="AjaxRequest/Params/BrandTabID"></xsl:variable>
		<xsl:variable name="MetaTagTitle" select="AjaxRequest/BrandTabXML/BrandTab/MetaTagTitle"></xsl:variable>
		<xsl:variable name="MetaTagDescription" select="AjaxRequest/BrandTabXML/BrandTab/MetaTagDescription"></xsl:variable>
		<xsl:variable name="MetaTagKeywords" select="AjaxRequest/BrandTabXML/BrandTab/MetaTagKeywords"></xsl:variable>
		<xsl:variable name="SecureYN" select="AjaxRequest/BrandTabXML/BrandTab/SecureYN"></xsl:variable>


		<xsl:call-template name="PopUpHeader">
			<xsl:with-param name="ItemID" select="$BrandID"></xsl:with-param>
			<xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
			<xsl:with-param name="HeaderText">
				<xsl:text>Page Settings</xsl:text>
			</xsl:with-param>
		</xsl:call-template>

		<table class="tableMaster" cellpadding="5" cellspacing="5">
			<tr>
				<td width="15%" class="packageTitle">
					Page Name
				</td>
				<td width="85%">
					<input id="txtPageName" type="text" style="width:200px;" value="{$BrandTabDisplayName}"></input>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Page Type
				</td>
				<td>
					<select id="opt_PageType" class="smallDropdown"
							onchange="DisplayCodeBox('tr_CodeBox','opt_PageType');">
						<xsl:for-each select="$BrandTabTypes/BrandTab">
							<xsl:choose>
								<xsl:when test="BrandTabType = $BrandTabType">
									<option value="{BrandTabTypeID}" selected="selected">
										<xsl:value-of select="BrandTabType"/>
									</option>
								</xsl:when>
								<xsl:otherwise>
									<option value="{BrandTabTypeID}">
										<xsl:value-of select="BrandTabType"/>
									</option>
								</xsl:otherwise>
							</xsl:choose>

						</xsl:for-each>
					</select>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Create Tab
				</td>
				<td>
					<select id="opt_PagePublicYN" class="smallDropdown">
						<option value="-99">--Select--</option>
						<xsl:choose>
							<xsl:when test="$BrandTabPublicYN = 1">
								<option value="1" selected="selected">Yes</option>
								<option value="0">No</option>
							</xsl:when>
							<xsl:when test="$BrandTabPublicYN = 0">
								<option value="1">Yes</option>
								<option value="0" selected="selected">No</option>
							</xsl:when>
						</xsl:choose>
					</select>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Secure Tab
				</td>
				<td>
					<select id="opt_PageSecureYN" class="smallDropdown">						
						<xsl:choose>
							<xsl:when test="$SecureYN = 1 or $SecureYN ='True'">
								<option value="-99">--Select--</option>
								<option value="1" selected="selected">Yes</option>
								<option value="0">No</option>
							</xsl:when>
							<xsl:when test="$SecureYN = 0 or $SecureYN ='False'">
								<option value="-99">--Select--</option>
								<option value="1">Yes</option>
								<option value="0" selected="selected">No</option>
							</xsl:when>
							<xsl:otherwise>
								<option value="-99" selected="selected">--Select--</option>
								<option value="1">Yes</option>
								<option value="0">No</option>
							</xsl:otherwise>
						</xsl:choose>
					</select>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Title
				</td>
				<td>
					<input id="txtTitle" type="text" style="width:400px;" value="{$MetaTagTitle}"></input>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Description
				</td>
				<td>
					<textarea id="txtDescription" style="width:600px;height:80px;">
						<xsl:value-of select="$MetaTagDescription"/>
					</textarea>
				</td>
			</tr>
			<tr>
				<td class="packageTitle">
					Keywords
				</td>
				<td>
					<input id="txtKeywords" type="text" style="width:600px;" value="{$MetaTagKeywords}"></input>
				</td>
			</tr>
			<xsl:choose>
				<xsl:when test="$BrandTabType = 'Profile' or $BrandTabType = 'IFrame'">
					<tr id="tr_CodeBox">
						<td class="packageTitle">
							Code
						</td>
						<td>
							<textarea id="txtSectionHTML" style="width:600px;height:200px;">
								<xsl:value-of select="$SectionHTML"/>
							</textarea>
						</td>
					</tr>
				</xsl:when>
			</xsl:choose>
			<tr id="tr_CodeBox" style="display:none;">
				<td class="packageTitle">
					Code
				</td>
				<td>
					<textarea id="txtSectionHTML" style="width:600px;height:200px;">
						<xsl:value-of select="$SectionHTML"/>
					</textarea>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<div class="onMouseOver divBrowseGradient spanBrowseGradientTextGray marginBottom10 marginTop10" style="width:80px;line-height:30px;"
								 onmouseover="document.getElementById('img_Add2_UpdateTab').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
								 onmouseout="document.getElementById('img_Add2_UpdateTab').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';"
								 onClick="UpdateBrandTabData('txtPageName','opt_PageType','opt_PagePublicYN', 'opt_PageSecureYN', 'txtSectionHTML','{$BrandID}','{$BrandTabID}','{$PortalItemID}',
															'txtTitle','txtDescription','txtKeywords');">
						<img id="img_Add2_UpdateTab" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle" style="padding-left:8px;" class="marginRight5"></img>
						<span id="span_Cancel">
							SAVE
						</span>
					</div>
				</td>
			</tr>
		</table>
	</xsl:template>
</xsl:stylesheet>
