﻿<?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:output method="xml" indent="yes"/>

    <xsl:variable name="BrandProfileID" select="Brand/HeaderFooterHTML/BrandProfileID"></xsl:variable>
    <xsl:variable name="BrandID" select="Brand/HeaderFooterHTML/BrandID"></xsl:variable>
    <xsl:variable name="BrandTabID" select="Brand/HeaderFooterHTML/BrandTabID"></xsl:variable>
    <xsl:variable name="BrandProfileSectionID" select="Brand/HeaderFooterHTML/BrandProfileSectionID"></xsl:variable>
    <xsl:variable name="SortOrder" select="Brand/HeaderFooterHTML/SortOrder"></xsl:variable>
    <xsl:variable name="Section" select="Brand/HeaderFooterHTML/Section"></xsl:variable>
    <xsl:variable name="SectionName" select="Brand/HeaderFooterHTML/SectionName"></xsl:variable>
    <xsl:variable name="SectionHTML" select="Brand/HeaderFooterHTML/SectionHTML"></xsl:variable>
    <xsl:variable name="SectionSummary" select="Brand/HeaderFooterHTML/SectionSummary"></xsl:variable>
    <xsl:variable name="TimeStamp" select="Brand/HeaderFooterHTML/TimeStamp"></xsl:variable>
    <xsl:variable name="BrandPermissionID" select="Brand/HeaderFooterHTML/BrandPermissionID"></xsl:variable>

    <xsl:template match="/">
        <div id="divHeaderFooterHTML">
            <div>
                <xsl:value-of select="Brand/HeaderFooterHTML/SectionHTML" disable-output-escaping="yes"/>
            </div>
            <div style="margin-top:5px;">
                <input type="button" value="Edit" class="button" id="btnEditBrandHeaderFooter" style="display:none;"
                       onclick="Brand_SectionEdit('divHeaderHTMLContainer','divBrandHeaderFooterProfileOperations');"/>
            </div>
        </div>
        
        <div id="divBrandHeaderFooterProfileOperations" class="divEdit">
            <table class="tableMaster">
                <tr>
                    <td colspan="2" style="text-align:right">
                        <span onclick="CloseWindow('divBrandHeaderFooterProfileOperations'); closeBrandEditMode();" class="labelHeader link" style="color: Black">
                            [X]
                        </span>
                    </td>
                </tr>
                <tr>
                    <td style="width:15%">
                        <span class="labelSize10">
                            Title:
                        </span>
                    </td>
                    <td style="width:85%">
                        <input type="text" id="txtTitle" style="width:100%;" class="text" maxlength="50" value="{$SectionName}"></input>
                    </td>
                </tr>
                <tr>
                    <td style="width:15%">
                        <span class="labelSize10" >
                            Section HTML:
                        </span>
                    </td>
                    <td style="width:85%">
                        <textarea rows="10" id="txtSectionHTML_{$TimeStamp}" style="width:100%; height:350px;" class="textAreaBox mceEditor">
                            <xsl:value-of select="$SectionHTML"/>
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td style="width:15%">
                        <span class="labelSize10" >
                            Summary:
                        </span>
                    </td>
                    <td style="width:85%">
                        <textarea rows="4" id="txtSummary" style="width:100%;" class="textAreaBox">
                            <xsl:value-of select="$SectionSummary"/>
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td style="padding-top: 10px; padding-bottom: 10px;">
                        <input type="button" value="Save" class="button"
                               onclick="BrandStore_UpdateBrandHeaderFooter({$BrandID}, {$BrandTabID}, {$BrandProfileSectionID}, {$SortOrder},'{$SectionName} ', 'txtTitle', 'txtSectionHTML_{$TimeStamp}', 'txtSummary', 'divHeaderHTMLContainer');"/>
                    </td>
                </tr>
            </table>
        </div>
    </xsl:template>
</xsl:stylesheet>
