﻿<?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="CorporateWizardButtons.xslt"/>
    <xsl:import href="../Brand/Agreement.xslt"/>
    
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/">
        <xsl:variable name="TemplateURL" select="normalize-space(BrandTypes/TemplateURL)"></xsl:variable>
        <xsl:variable name="HostName" select="normalize-space(BrandTypes/HostName)"></xsl:variable>
        <xsl:variable name="BrandID" select="normalize-space(BrandTypes/BrandID)"></xsl:variable>
        <xsl:variable name="IsCommunityAdmin" select="normalize-space(BrandTypes/IsCommunityAdmin)"></xsl:variable>
        <xsl:variable name="EditKey" select="normalize-space(BrandTypes/Key)"></xsl:variable>
        <xsl:variable name="BrandKey" select="normalize-space(BrandTypes/CreatedBrand/BrandKey)"></xsl:variable>
        <xsl:variable name="Origin" select="normalize-space(BrandTypes/Origin)"></xsl:variable>
        <xsl:variable name="PortalItemID" select="normalize-space(BrandTypes/CreatedBrand/PortalItemID)"></xsl:variable>


        <xsl:if test="$Origin != 'CorporatePortal'">
            <xsl:call-template name="CorporateWizardButtons">
                <xsl:with-param name="TemplatePathURL" select="$TemplateURL"></xsl:with-param>
                <xsl:with-param name ="Source" >
                    <xsl:text>CreateCorporate</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="UserRole" select="BrandTypes/UserRoles/."></xsl:with-param>
                <xsl:with-param name ="HostName" select="$HostName"></xsl:with-param>
                <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                <xsl:with-param name="IsCommunityAdmin" select="$IsCommunityAdmin"></xsl:with-param>
                <xsl:with-param name="Edit" select="$EditKey"></xsl:with-param>
                <xsl:with-param name="PromoteKey" select="$BrandKey"></xsl:with-param>
                <xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>                
            </xsl:call-template>

            <div style="color: #376092; margin-top: 20px;">
                <table class="tableMaster" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td>
                            <div id="divHeader">
                                <span class="labelSize14">
                                    Step 1 of 2 – Create Your Brand in LifeSpace
                                </span>
                            </div>
                            <div style="padding-top:10px">
                                <span class="labelSize13">
                                    “The first step is to secure your brand within LifeSpace.  In this important step, you will identify what type of organization you are and will secure your LifeSpace Brand identity.“
                                </span>
                            </div>
                        </td>
                        <td>
                            <div>
                                <img src="{normalize-space($TemplateURL)}Web/Images/AdPerson_Left.jpg" height="150px" title="Register_Girl" BORDER="0"></img>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </xsl:if>
        <xsl:if test ="$BrandID = 0">
            <div>
                <table class="tableMaster" cellpadding="3">
                    <tr>
                        <td style="width:25%">
                            <span class="labelSize10" >
                                Type:
                            </span>
                        </td>
                        <td>
                            <select class="largeDropdown" name="BrandType" id="ddlBrandType" style="color:gray;"
                                    onFocus="this.style.color='black';"
                                    onchange='setDropDownStyle("ddlBrandType");'>
                                <option selected="selected" value="0">Select your brand type..</option>
                                <xsl:for-each select ="BrandTypes/BrandTypeNode">
                                    <option value="{BrandTypeID/.}">
                                        <xsl:value-of select ="normalize-space(BrandType/.)"/>
                                    </option>
                                </xsl:for-each>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Name:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="BrandName" id="txtBrandName" style="width:100%; color:gray;" class="text" maxlength="50"
                                       value="Enter your brand name here.." onFocus='clearTextBox("txtBrandName","Enter your brand name here..");'
                                       onBlur='setTextBoxStyle("txtBrandName","Enter your brand name here.."); setBrandSuggestedName(this); 
                                       CreateBrand_CheckAvailable("txtCommunityURL"); setTextBoxStyle("txtCommunityURL","Brand Here");'/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="bottom">
                            <span class="labelSize10">
                                Community URL*:
                            </span>
                        </td>
                        <td>
                            <div style="width:100%; border:0px;">
                                <table width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td style="width:85%;">
                                            <table  cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td style="vertical-align: middle;" valign="middle">
                                                        <span class ="labelSize10">http://www.lifespace.com/</span>
                                                    </td>
                                                    <td style="width:100%">
                                                        <input type="text" name=" CommunityURL" id ="txtCommunityURL" style="width:100%;  color:gray;" class="text" maxlength="50"
                                                               value="Brand Here" onFocus='clearTextBox("txtCommunityURL","Brand Here");' onKeyPress='return disableEnterKey(event)'
                                                               onBlur='CreateBrand_CheckAvailable("txtCommunityURL"); setTextBoxStyle("txtCommunityURL","Brand Here");'/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>
                                            &#xa0;&#xa0;<span id='errMessage' class ="labelSize10" style="color:green; display:none;">OK</span>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Description:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <textarea rows="4" id="txtDescription" style="width:100%; color:gray;" class="textAreaBox"
                                       onFocus='clearTextBox("txtDescription","Enter your brand description here..");'
                                          onBlur='setTextBoxStyle("txtDescription","Enter your brand description here..");'>
                                    Enter your brand description here..
                                </textarea>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:30%">
                            <span class="labelSize10" >
                                Primary Address:
                            </span>
                        </td>
                        <td class="labelSize10">
                            <div style="width:85%;">
                                <input type="text" id="txtAddress1" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="Address1"
                                       onblur="setTextBoxStyle(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                       onfocus="clearTextBox(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                       value="Address 1"
                                       maxlength="50"></input>
                            </div>
                            <div style="width:85%;">
                                <input type="text" id="txtAddress2" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="Address2"
                                       onblur="setTextBoxStyle(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                       onfocus="clearTextBox(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                       value="Address 2"
                                       maxlength="50"></input>
                            </div>
                            <div style="width:85%;">
                                <input type="text" id="txtCity" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="City"
                                       onblur="setTextBoxStyle(&quot;txtCity&quot;,&quot;City&quot;);"
                                       onfocus="clearTextBox(&quot;txtCity&quot;,&quot;City&quot;);"
                                       value="City"
                                       maxlength="50"></input>
                            </div>
                            <div style="width:85%;">
                                <input type="text" id="txtState" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="State"
                                              onblur="setTextBoxStyle(&quot;txtState&quot;,&quot;State&quot;);"
                                              onfocus="clearTextBox(&quot;txtState&quot;,&quot;State&quot;);"
                                              value="State"
                                              maxlength="50"></input>
                            </div>
                            <div style="width:85%;">
                                <input type="text" id="txtPostalCode" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="PostalCode"
                                              onblur="setTextBoxStyle(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                              onfocus="clearTextBox(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                              value="Postal Code"
                                              maxlength="50"></input>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:30%">
                            <span class="labelSize10" >
                                Primary Phone:
                            </span>
                        </td>
                        <td>
                            <div class="labelSize10" style="width:85%;">
                                <input type="text" id="txtMainPhone" class="text" style="width:100%; color: gray; margin-bottom:5px;" name="MainPhone"
                                              onblur="setTextBoxStyle(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                              onfocus="clearTextBox(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                              value="Main Phone"
                                              maxlength="50"></input>
                            </div>
                        </td>
                    </tr>
                    <tr style="display:none;">
                        <td>
                            <span class="labelSize10">
                                Public:
                            </span>
                        </td>
                        <td>
                            <div>
                                <select id ="ddlBrandSecure" name="Public" class="smallDropdown"
                                        style="color:gray;" onFocus="this.style.color='black';"
                                        onchange='setDropDownStyle("ddlBrandSecure");'>
                                    <option value="1">
                                        <xsl:text>Yes</xsl:text>
                                    </option>
                                    <option value="0" selected="selected">
                                        <xsl:text>No</xsl:text>
                                    </option>
                                </select>
                            </div>
                        </td>
                    </tr>
                    <tr style="display:none;">
                        <td>
                            <span class="labelSize10">
                                Publish:
                            </span>
                        </td>
                        <td>
                            <xsl:choose>
                                <xsl:when test ="BrandTypes/UserRoles/Role[RoleName = 'Brand Admin']">
                                    <div>
                                        <select id ="ddlPublish" name="Public" class="smallDropdown"
                                                style="color:gray;" onFocus="this.style.color='black';"
                                                onchange='setDropDownStyle("ddlPublish");'>
                                            <option value="1">
                                                <xsl:text>Yes</xsl:text>
                                            </option>
                                            <option value="0" selected="selected">
                                                <xsl:text>No</xsl:text>
                                            </option>
                                        </select>
                                    </div>
                                </xsl:when>
                                <xsl:otherwise>
                                    <span class="smallDropdown">
                                        <xsl:text>No</xsl:text>
                                    </span>
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                    </tr>                 
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Website URL:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="Website" id="txtWebsite" style="width:100%;  color:gray;" class="text" maxlength="255"
                                       value="Enter your company website here.." onFocus='clearTextBox("txtWebsite","Enter your company website here..");'
                                       onBlur='setTextBoxStyle("txtWebsite","Enter your company website here..");'/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Company E-mail:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="CompanyEmail" id ="txtCompanyEmail" style="width:100%;  color:gray;" class="text" maxlength="255"
                                       value="name@yourcompany.com" onFocus='clearTextBox("txtCompanyEmail","name@yourcompany.com");'
                                       onBlur='setTextBoxStyle("txtCompanyEmail","name@yourcompany.com"); CheckEmail("txtCompanyEmail");'/>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td colspan="2">
                            <div calss="label" style="color:#003366; width:95%; padding-top:10px;">
                                * See our <a href="#">
                                    <u>Brand Reservation Policies</u>
                                </a>. For questions regarding reserving your brand, please contact <a href="mailto:AccountServices@LifeSpace.com" class="link">
                                    <u>AccountServices@LifeSpace.com</u>
                                </a>
                            </div>
                        </td>
                        <td></td>
                    </tr>
                </table>
            </div>
        </xsl:if>

        <xsl:if test ="$BrandID &gt; 0">
            <div>
                <table class="tableMaster" cellpadding="3">
                    <tr>
                        <td style="width:25%">
                            <span class="labelSize10" >
                                Type:
                            </span>
                        </td>
                        <td>
                            <select class="largeDropdown" name="BrandType" id="ddlBrandType"
                                    onFocus="this.style.color='black';"
                                    onchange='setDropDownStyle("ddlBrandType");'>
                                <option value="0">Select your brand type..</option>
                                <xsl:for-each select ="BrandTypes/BrandTypeNode">

                                    <xsl:if test="BrandTypeID = ../CreatedBrand/BrandTypeID">
                                        <option selected="selected" value="{BrandTypeID/.}">
                                            <xsl:value-of select ="normalize-space(BrandType/.)"/>
                                        </option>
                                    </xsl:if>

                                    <xsl:if test="BrandTypeID != ../CreatedBrand/BrandTypeID">
                                        <option value="{BrandTypeID/.}">
                                            <xsl:value-of select ="normalize-space(BrandType/.)"/>
                                        </option>
                                    </xsl:if>

                                </xsl:for-each>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Name:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="BrandName" id="txtBrandName" style="width:100%; " class="text" maxlength="50"
                                       value="{BrandTypes/CreatedBrand/CompanyName}" onFocus='clearTextBox("txtBrandName","Enter your brand name here..");' onBlur='setTextBoxStyle("txtBrandName","Enter your brand name here..");'/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td valign="bottom">
                            <span class="labelSize10">
                                Community URL*:
                            </span>
                        </td>
                        <td>
                            <div style="width:100%; border:0px;">
                                <table width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td style="width:85%;">
                                            <table  cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td style="vertical-align: middle;" valign="middle">
                                                        <span class ="labelSize10">
                                                            http://www.lifespace.com/<xsl:value-of select="BrandTypes/CreatedBrand/BrandKey"/>
                                                        </span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td>

                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Description:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <textarea rows="4" id="txtDescription" style="width:100%;"  class="textAreaBox"
                                       onFocus='clearTextBox("txtDescription","Enter your brand description here..");' onBlur='setTextBoxStyle("txtDescription","Enter your brand description here..");'>
                                    <xsl:value-of select='normalize-space(BrandTypes/CreatedBrand/BrandDescription)'></xsl:value-of>
                                </textarea>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:30%">
                            <span class="labelSize10" >
                                Primary Address:
                            </span>
                        </td>
                        <td class="labelSize10">
                            <div style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/Address1) != ''">
                                        <input type="text" id="txtAddress1" class="text" style="width:100%; margin-bottom:5px;" name="Address1"
                                           onblur="setTextBoxStyle(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                           onfocus="clearTextBox(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                           maxlength="50"
                                           value="{BrandTypes/CreatedBrand/Address1}"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtAddress1" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="Address1"
                                          onblur="setTextBoxStyle(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                          onfocus="clearTextBox(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                          value="Address 1"
                                          maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </div>
                            <div style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/Address2) != ''">
                                        <input type="text" id="txtAddress2" class="text" style="width:100%; margin-bottom:5px;" name="Address2"
                                               onblur="setTextBoxStyle(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                               onfocus="clearTextBox(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                               value="{BrandTypes/CreatedBrand/Address2}"
                                               maxlength="50"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtAddress2" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="Address2"
                                               onblur="setTextBoxStyle(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                               onfocus="clearTextBox(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                               value="Address 2"
                                               maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </div>
                            <div style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/City) != ''">
                                        <input type="text" id="txtCity" class="text" style="width:100%; margin-bottom:5px;" name="City"
                                               onblur="setTextBoxStyle(&quot;txtCity&quot;,&quot;City&quot;);"
                                               onfocus="clearTextBox(&quot;txtCity&quot;,&quot;City&quot;);"
                                               value="{BrandTypes/CreatedBrand/City}"
                                               maxlength="50"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtCity" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="City"
                                              onblur="setTextBoxStyle(&quot;txtCity&quot;,&quot;City&quot;);"
                                              onfocus="clearTextBox(&quot;txtCity&quot;,&quot;City&quot;);"
                                              value="City"
                                              maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </div>
                            <div style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/State) != ''">
                                        <input type="text" id="txtState" class="text" style="width:100%; margin-bottom:5px;" name="State"
                                            onblur="setTextBoxStyle(&quot;txtState&quot;,&quot;State&quot;);"
                                            onfocus="clearTextBox(&quot;txtState&quot;,&quot;State&quot;);"
                                            value="{BrandTypes/CreatedBrand/State}"
                                            maxlength="50"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtState" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="State"
                                            onblur="setTextBoxStyle(&quot;txtState&quot;,&quot;State&quot;);"
                                            onfocus="clearTextBox(&quot;txtState&quot;,&quot;State&quot;);"
                                            value="State"
                                            maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </div>
                            <div style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/PostalCode) != ''">
                                        <input type="text" id="txtPostalCode" class="text" style="width:100%; margin-bottom:5px;" name="PostalCode"
                                             onblur="setTextBoxStyle(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                             onfocus="clearTextBox(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                              value="{BrandTypes/CreatedBrand/PostalCode}"
                                             maxlength="50"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtPostalCode" class="text" style="width:100%; color: gray;  margin-bottom:5px;" name="PostalCode"
                                               onblur="setTextBoxStyle(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                               onfocus="clearTextBox(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                               value="Postal Code"
                                               maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width:30%">
                            <span class="labelSize10" >
                                Primary Phone:
                            </span>
                        </td>
                        <td>
                            <div class="labelSize10" style="width:85%;">
                                <xsl:choose>
                                    <xsl:when test="normalize-space(BrandTypes/CreatedBrand/PhoneMain) != ''">
                                        <input type="text" id="txtMainPhone" class="text" style="width:100%; margin-bottom:5px;" name="MainPhone"
                                            onblur="setTextBoxStyle(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                            onfocus="clearTextBox(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                            value="{BrandTypes/CreatedBrand/PhoneMain}"
                                            maxlength="50"></input>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <input type="text" id="txtMainPhone" class="text" style="width:100%; color: gray; margin-bottom:5px;" name="MainPhone"
                                            onblur="setTextBoxStyle(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                            onfocus="clearTextBox(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                            value="Main Phone"
                                            maxlength="50"></input>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </div>
                        </td>
                    </tr>
                    <tr style="display:none;">
                        <td>
                            <span class="labelSize10">
                                Public:
                            </span>
                        </td>
                        <td>
                            <div>
                                <select id ="ddlBrandSecure" name="Public" class="smallDropdown"
                                        onFocus="this.style.color='black';"
                                        onchange='setDropDownStyle("ddlBrandSecure");'>
                                    <xsl:if test="BrandTypes/CreatedBrand/PublicYN = 1">
                                        <option value="1">
                                            <xsl:text>Yes</xsl:text>
                                        </option>
                                        <option value="0" selected="selected">
                                            <xsl:text>No</xsl:text>
                                        </option>
                                    </xsl:if>

                                    <xsl:if test="BrandTypes/CreatedBrand/PublicYN = 0">
                                        <option value="1">
                                            <xsl:text>Yes</xsl:text>
                                        </option>
                                        <option value="0" selected="selected">
                                            <xsl:text>No</xsl:text>
                                        </option>
                                    </xsl:if>
                                </select>
                            </div>
                        </td>
                    </tr>
                    <tr style="display:none;">
                        <td>
                            <span class="labelSize10">
                                Publish:
                            </span>
                        </td>
                        <td>
                            <xsl:choose>
                                <xsl:when test ="BrandTypes/UserRoles/Role[RoleName = 'Brand Admin']">
                                    <select id ="ddlPublish" name="Public" class="smallDropdown"
                                        onFocus="this.style.color='black';"
                                        onchange='setDropDownStyle("ddlPublish");'>
                                        <xsl:if test="BrandTypes/CreatedBrand/PublishYN = 1">
                                            <option value="1">
                                                <xsl:text>Yes</xsl:text>
                                            </option>
                                            <option value="0"  selected="selected">
                                                <xsl:text>No</xsl:text>
                                            </option>
                                        </xsl:if>

                                        <xsl:if test="BrandTypes/CreatedBrand/PublishYN = 0">
                                            <option value="1">
                                                <xsl:text>Yes</xsl:text>
                                            </option>
                                            <option value="0" selected="selected">
                                                <xsl:text>No</xsl:text>
                                            </option>
                                        </xsl:if>
                                    </select>
                                </xsl:when>
                                <!--<xsl:otherwise>
                                    <xsl:if test="BrandTypes/CreatedBrand/PublishYN = 1">
                                        <span class="smallDropdown">
                                            <xsl:text>Yes</xsl:text>
                                        </span>
                                    </xsl:if>

                                    <xsl:if test="BrandTypes/CreatedBrand/PublishYN = 0">
                                        <span class="smallDropdown">
                                            <xsl:text>No</xsl:text>
                                        </span>
                                    </xsl:if>
                                </xsl:otherwise>-->
                            </xsl:choose>
                        </td>
                    </tr>                  
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Website URL:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="Website" id="txtWebsite" style="width:100%;" class="text" maxlength="50"
                                       value="{BrandTypes/CreatedBrand/CompanyWebsiteURL}" onFocus='clearTextBox("txtWebsite","Enter your company website here..");' onBlur='setTextBoxStyle("txtWebsite","Enter your company website here..");'/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span class="labelSize10">
                                Company E-mail:
                            </span>
                        </td>
                        <td>
                            <div style="width:85%;">
                                <input type="text" name="CompanyEmail" id ="txtCompanyEmail" style="width:100%; " class="text" maxlength="50"
                                       value="{BrandTypes/CreatedBrand/CompanyEmail}"  onFocus='clearTextBox("txtCompanyEmail","name@yourcompany.com");' onBlur='setTextBoxStyle("txtCompanyEmail","name@yourcompany.com"); CheckEmail("txtCompanyEmail");'/>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td colspan="2">
                            <div calss="label" style="color:#003366; width:95%; padding-top:10px;">
                                * See our <a href="#">
                                    <u>Brand Reservation Policies</u>
                                </a>. For questions regarding reserving your brand, please contact <a href="mailto:AccountServices@LifeSpace.com" class="link">
                                    <u>AccountServices@LifeSpace.com</u>
                                </a>
                            </div>
                        </td>
                        <td></td>
                    </tr>

                </table>
            </div>
        </xsl:if>


        <xsl:choose>
            <xsl:when test="$Origin = 'CorporatePortal'">
                <div align="right" style="padding-right:70px;display:block;" id="btnAddBrandContent">
                    <input type="button" class="button" value="Save"
                                onclick='Brand_UpdateCorporateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", {$BrandID},
                                    "txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","{$Origin}");'></input>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <xsl:if test="$BrandID = 0">
                    <div align="right" style="padding:10px;display:block;" id="btnAddBrandContent">
                        <a class ="link" onClick='Brand_CreateCorporate(
                                    "ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", 
                                    "Brand_HiddenAggrementXML","{$IsCommunityAdmin}","txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode",
                                    "txtMainPhone","ddlPublish");'>
                            <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="cursor: pointer; border:0px;"/>
                        </a>
                    </div>
                </xsl:if>

                <xsl:if test="$BrandID &gt; 0">
                    <div align="right" style="padding:10px;">
                        <a class ="link"
                           onClick='Brand_UpdateCorporateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", {$BrandID},"txtAddress1", "txtAddress2", 
                                    "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish");'>
                            <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="cursor: pointer; border:0px;">
                            </img>
                        </a>
                    </div>
                </xsl:if>
            </xsl:otherwise>
        </xsl:choose>




        <xsl:call-template name="MarketPlaceAgreement"></xsl:call-template>

    </xsl:template>
</xsl:stylesheet>
