﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <xsl:variable name="BrandID" select="normalize-space(AjaxRequest/Params/BrandID)"/>
        <xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"/>
        <xsl:variable name="TemplateRL" select="normalize-space(AjaxRequest/TemplateURL)"/>
        <xsl:variable name="Action" select="normalize-space(AjaxRequest/Action)"/>
        <xsl:variable name="DisplayBrandType" select="normalize-space(AjaxRequest/DisplayBrandType)"/>
        <center>
            <div style="text-align:right;margin-top:-15px; margin-right:5px;">
                <span class="link" onClick='Brand_CloseBrandTab("divOperations", "btnAddTab");'>[ X ]</span>
            </div>
            <table class="tableMaster" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td style="padding-left: 5px;" rowspan="14"></td>
                    <td>
                        <div id ="divResult"></div>
                    </td>
                </tr>
                <div style="width:190px;">
                    <span id="tabNameErrorMessage" class="labelError" style="display:none;">Tab Name already exist.</span>
                </div>

                <tr>
                    <td width="25%">
                        <span class="labelFormFields lineHeight">Tab Name</span>
                    </td>
                    <td width="75%">
                        <input id="txtTabName" type="text"
                           class="wideText" tabindex="1" maxlength="50"
                               onBlur ='return CheckBrandTabName("{$BrandID}", "txtTabName", "tabID");'/>
                        <span id ="span_tab_ErrorMessage" class="labelError" style="display:none;">*</span>
                    </td>

                </tr>
                <tr>
                    <td>
                        <span class="labelFormFields lineHeight">Tab Description</span>
                    </td>
                    <td>
                        <textarea id="txtTabDescription" rows="4" class="wideText" tabindex="2">
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span class="labelFormFields lineHeight">PublicYN</span>
                    </td>
                    <td>
                        <select id="ddlPublicYN" name="PublicYN" class="dropdown" tabindex="3">
                            <option value="1" selected="selected">Yes</option>
                            <option value="0" >No</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span class="labelFormFields lineHeight">Tab Type</span>
                    </td>
                    <td>
                        <xsl:choose>
                            <xsl:when test ="$DisplayBrandType = 'True'">
                                <select id="ddlTabType" name="TabType" class="dropdown" tabindex="4"
                                  onchange="BrandTab_DisplayIFrame('ddlTabType','trIFrame');">
                                    <option value="-99" selected="selected">Choose</option>
                                    <xsl:for-each select ="AjaxRequest/BrandTabs/BrandTab">
                                        <option value="{BrandTabTypeID}" ><xsl:value-of select ="BrandTabType"/></option>
                                    </xsl:for-each>
                                </select>
                            </xsl:when>
                            <xsl:otherwise>
                                <select id="ddlTabType" name="TabType" class="dropdown" tabindex="4"
                               onchange="BrandTab_DisplayIFrame('ddlTabType','trIFrame');">
                                    <option value="1" selected="selected">Profile</option>
                                    <!--<option value="2">Community</option>-->
                                    <option value="3" >IFrame</option>
                                </select>
                            </xsl:otherwise>
                        </xsl:choose>
                       
                    </td>
                </tr>
                <tr id="trIFrame" style="display:none;">
                    <td>
                        <span class="labelFormFields lineHeight">Iframe</span>
                    </td>
                    <td>
                        <textarea id="txtIFrameData" style="width:95%" rows="7" class="wideText" tabindex="5">
                            &lt;iframe width=&quot;100%&quot; scrolling=&quot;yes&quot; height=&quot;541&quot; frameborder=&quot;0&quot;
                            name=&quot;content&quot; title=&quot;article title&quot; id=&quot;iframeArticle&quot; src=&quot;http://www.google.com&quot;&gt;&lt;/iframe&gt;
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td style="padding-top: 10px; padding-bottom: 10px;">
                        <div id="divAddBrandTabControls" style="display:none">
                        <input type="button" value="Save" class="button"  tabindex="5"
                               onClick='return Brand_SaveBrandTab("txtTabName", "txtTabDescription", 
                                     "ddlPublicYN", "{$BrandID}", "divResult","span_tab_ErrorMessage", "ddlTabType", "txtIFrameData","{$Action}");'/>
                        <input type="button" value="Cancel" class="button"  tabindex="6" style="margin-left:10px;"
                               onClick='Brand_CloseBrandTab("divOperations", "btnAddTab");'/>
                        </div>
                    </td>
                    <td></td>
                </tr>
            </table>
        </center>
    </xsl:template>
</xsl:stylesheet>
