﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="BrandWizardButtons.xslt"/>
    <xsl:import href="Agreement.xslt"/>
    <xsl:include href="../Modules/Tournament/HostBrandWizardButtons.xslt"/>
    <xsl:include href="../Version_2_0/PopUpHeader.xslt"/>

    <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="ParentBrandID" select="normalize-space(BrandTypes/ParentBrandID)"></xsl:variable>
        <xsl:variable name="PortalItemID" select="normalize-space(BrandTypes/PortalItemID)"></xsl:variable>
        <xsl:variable name="IsAuthenticated" select="normalize-space(BrandTypes/IsAuthenticated)"></xsl:variable>
        <xsl:variable name="BrandAdmin" select="normalize-space(BrandTypes/UserRoles/Role[RoleName = 'Brand Admin'])"></xsl:variable>

        <xsl:variable name="Padding">
            <xsl:if test="$Origin = 'Host' or $Origin = 'ClubPortal' or $Origin = 'ClubBrand'">
                padding15
            </xsl:if>
        </xsl:variable>

        <xsl:choose>
            <xsl:when test="$IsAuthenticated = 'False'">
                <div class="margin20">
                    You must be logged in to view this item
                </div>
                <div class="marginLeft20 marginBottom20">
                    <div class="onMouseOver textCenter divBrowseGradient spanBrowseGradientTextGray"
						 style="width:90px;line-height:30px;"
						 onclick="DisplaySignUpPopUp('signup','{$Origin}','{$BrandID}');">
                        <span class="capitalFont">Sign Up</span>
                    </div>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <xsl:if test="$Origin = 'Host' or $Origin = 'ClubPortal'">
                    <xsl:call-template name="PopUpHeader">
                        <xsl:with-param name="ItemID" select="$ParentBrandID"></xsl:with-param>
                        <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                        <xsl:with-param name="HeaderText">
                            <xsl:text>Create Tournament Host</xsl:text>
                        </xsl:with-param>
                    </xsl:call-template>
                </xsl:if>

                <div id="divCreateBrand" class="{$Padding}">
                    <xsl:if test="$Origin != 'CorporatePortal'">
                        <xsl:choose>
                            <xsl:when test="$Origin = 'Host' or $Origin = 'ClubPortal' or $Origin = 'ClubBrand'">
                                <xsl:call-template name="HostBrandWizardButtons">
                                    <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                                    <xsl:with-param name="HostName" select="$HostName"></xsl:with-param>
                                    <xsl:with-param name="Source" >
                                        <xsl:text>CreateBrand</xsl:text>
                                    </xsl:with-param>
                                    <xsl:with-param name="ParentBrandID" select="$ParentBrandID"></xsl:with-param>
                                    <xsl:with-param name="BrandID" select="$BrandID"></xsl:with-param>
                                    <xsl:with-param name="PromoteKey" select="$BrandKey"></xsl:with-param>
                                    <xsl:with-param name="Origin" select="$Origin"></xsl:with-param>
                                    <xsl:with-param name="PortalItemID" select="$PortalItemID"></xsl:with-param>
                                </xsl:call-template>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:call-template name="BrandWizardButtons">
                                    <xsl:with-param name="TemplatePathURL" select="$TemplateURL"></xsl:with-param>
                                    <xsl:with-param name ="Source" >
                                        <xsl:text>CreateBrand</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:call-template>
                            </xsl:otherwise>
                        </xsl:choose>

                        <div style="color: #376092;" class="marginTop20">
                            <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 class="paddingTop10">
                                            <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 class="verticallyMiddle" valign="middle">
                                                                    <span class ="labelSize10">https://www.coachsimple.net/</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 class='textCenter'>
                                                        <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..");'>
                                                <xsl:text>Enter your brand description here..</xsl:text>
                                            </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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%; color: gray;" 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>
                                    <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" selected="selected">
                                                    <xsl:text>Yes</xsl:text>
                                                </option>
                                                <option value="0">
                                                    <xsl:text>No</xsl:text>
                                                </option>
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <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" selected="selected">
                                                            <xsl:text>Yes</xsl:text>
                                                        </option>
                                                        <option value="0">
                                                            <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 style="display:none;">
                                    <td>
                                        <span class="labelSize10">
                                            Logo URL:
                                        </span>
                                    </td>
                                    <td>
                                        <div  style="width:85%;">
                                            <input type="text" name="Logo" id="txtLogo" style="width:100%;color:gray; " class="text" maxlength="255"
												   value="Enter your brand logo here.." onFocus='clearTextBox("txtLogo","Enter your brand logo here..");'
												   onBlur='setTextBoxStyle("txtLogo","Enter your brand logo here..");'/>
                                        </div>
                                    </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 paddingTop10" style="color:#003366; width:95%;">
                                            * 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%;">
                                            <xsl:choose>
                                                <xsl:when test="$BrandAdmin">
                                                    <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..");'/>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <input type="text" name="BrandName" id="txtBrandName" style="width:100%; " class="text" maxlength="50" readonly="readonly"
												           value="{BrandTypes/CreatedBrand/CompanyName}" onFocus='clearTextBox("txtBrandName","Enter your brand name here..");'
                                                           onBlur='setTextBoxStyle("txtBrandName","Enter your brand name here..");'/>
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </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 class="verticallyMiddle" valign="middle">
                                                                    <span class ="labelSize10">
																		https://www.coachsimple.net/<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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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 marginBottom5" style="width:100%;" 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 marginBottom5" style="width:100%; color: gray;" 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>
                                    <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" selected="selected">
                                                        <xsl:text>Yes</xsl:text>
                                                    </option>
                                                    <option value="0">
                                                        <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>
                                    <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" selected="selected">
                                                            <xsl:text>Yes</xsl:text>
                                                        </option>
                                                        <option value="0">
                                                            <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 style="display:none;">
                                    <td>
                                        <span class="labelSize10">
                                            Logo URL:
                                        </span>
                                    </td>
                                    <td>
                                        <div>
                                            <input type="text" name="Logo" id="txtLogo" style="width:386px; position:absolute; " class="text"
												   value="{BrandTypes/CreatedBrand/BrandLogoSmallURL}" onFocus='clearTextBox("txtLogo","Enter your brand logo here..");' onBlur='setTextBoxStyle("txtLogo","Enter your brand logo here..");'/>
                                        </div>
                                    </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 paddingTop10" style="color:#003366; width:95%;">
                                            * 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;" id="btnAddBrandContent">
                                <input type="button" class="button" value="Save"
											onclick='Brand_UpdateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
										"txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "txtLogo", {$BrandID},
										"txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","{$Origin}");'></input>
                            </div>
                        </xsl:when>
                        <xsl:when test="$Origin = 'Host' or $Origin = 'ClubPortal' or $Origin = 'ClubBrand'">
                            <xsl:if test="$BrandID = 0">
                                <div align="right" class="paddingTop10 paddingRight20" id="btnAddBrandContent">
                                    <a class="link onMouseOver" onClick='Brand_CreateHost(
                                    "ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "txtLogo", 
                                    "Brand_HiddenAggrementXML","{$IsCommunityAdmin}","txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","{$ParentBrandID}","{$Origin}");'>
                                        <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="border:0px;"/>
                                    </a>
                                </div>
                            </xsl:if>
                            <xsl:if test="$BrandID &gt; 0">
                                <div align="right" class="padding10">
                                    <a class="link"
									   onClick='Brand_UpdateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
										"txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "txtLogo", {$BrandID},"txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","{$Origin}");'>
                                        <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="border:0px;">
                                        </img>
                                    </a>
                                </div>
                            </xsl:if>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:if test="$BrandID = 0">
                                <div align="right" class="padding10" id="btnAddBrandContent">
                                    <a class="link" onClick='Brand_CreateBrand(
										"ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
										"txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "txtLogo", 
										"Brand_HiddenAggrementXML","{$IsCommunityAdmin}","txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode"
                                       , "txtMainPhone","ddlPublish", -99, -99, "Wizard",-99, 1);'>
                                        <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="border:0px;"/>
                                    </a>
                                </div>
                            </xsl:if>

                            <xsl:if test="$BrandID &gt; 0">
                                <div align="right" class="padding10">
                                    <a class="link"
									   onClick='Brand_UpdateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
										"txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "txtLogo", {$BrandID},"txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","");'>
                                        <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="border:0px;">
                                        </img>
                                    </a>
                                </div>
                            </xsl:if>
                        </xsl:otherwise>
                    </xsl:choose>
                    <xsl:call-template name="MarketPlaceAgreement"></xsl:call-template>
                </div>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>
</xsl:stylesheet>
