﻿<?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:variable name="BrandAdmin" select="normalize-space(BrandTypes/UserRoles/Role[RoleName = 'Brand Admin'])"></xsl:variable>
		<xsl:variable name="ParentBrandID" select="normalize-space(BrandTypes/AjaxRequest/Params/ParentBrandID)"></xsl:variable>
		<xsl:variable name="ActiveYN" select="normalize-space(BrandTypes/CreatedBrand/ActiveYN)"></xsl:variable>

		<xsl:variable name="PermissionID" select="normalize-space(BrandTypes/PermissionID)"></xsl:variable>

		<xsl:variable name="Action" select="normalize-space(BrandTypes/AjaxRequest/Action)"></xsl:variable>

		<xsl:variable name="DefaultChildPortalTypeID">
			<xsl:choose>
				<xsl:when test="BrandTypes/AjaxRequest/Settings/DefaultChildPortalTypeID">
					<xsl:value-of select="BrandTypes/AjaxRequest/Settings/DefaultChildPortalTypeID"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:number value="-99"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="BrandTypeID" select="BrandTypes/Brand/Detail/BrandTypeID"></xsl:variable>


		<xsl:call-template name="CreationWizardHeader">
			<xsl:with-param name="TemplateURL" select="$TemplateURL"></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="EditKey" select="$EditKey"></xsl:with-param>
			<xsl:with-param name="BrandKey" 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:with-param name="BrandAdmin" select="$BrandAdmin"></xsl:with-param>
		</xsl:call-template>


		<xsl:choose>
			<xsl:when test="$BrandID = 0">
				<xsl:call-template name="RegisterNewBrand">
					<xsl:with-param name="TemplateURL" select="$TemplateURL"></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="EditKey" select="$EditKey"></xsl:with-param>
					<xsl:with-param name="BrandKey" 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:with-param name="BrandAdmin" select="$BrandAdmin"></xsl:with-param>
					<xsl:with-param name="BrandTypeID" select="$BrandTypeID"></xsl:with-param>
					<xsl:with-param name="Action" select="$Action"></xsl:with-param>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="UpdateExistingBrand">
					<xsl:with-param name="TemplateURL" select="$TemplateURL"></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="EditKey" select="$EditKey"></xsl:with-param>
					<xsl:with-param name="BrandKey" 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:with-param name="BrandAdmin" select="$BrandAdmin"></xsl:with-param>
					<xsl:with-param name="ActiveYN" select="$ActiveYN"></xsl:with-param>
					<xsl:with-param name="PermissionID" select="$PermissionID"></xsl:with-param>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>

		<xsl:call-template name="CreateWizardFooterButtons">
			<xsl:with-param name="TemplateURL" select="$TemplateURL"></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="EditKey" select="$EditKey"></xsl:with-param>
			<xsl:with-param name="BrandKey" 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:with-param name="BrandAdmin" select="$BrandAdmin"></xsl:with-param>
			<xsl:with-param name="ParentBrandID" select="$ParentBrandID"></xsl:with-param>
			<xsl:with-param name="DefaultChildPortalTypeID" select="$DefaultChildPortalTypeID"></xsl:with-param>
		</xsl:call-template>

		<xsl:call-template name="MarketPlaceAgreement"></xsl:call-template>

	</xsl:template>

	<xsl:template name="CreationWizardHeader">
		<xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
		<xsl:param name="HostName" select="'N/A'"></xsl:param>
		<xsl:param name="BrandID" select="'N/A'"></xsl:param>
		<xsl:param name="IsCommunityAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="EditKey" select="'N/A'"></xsl:param>
		<xsl:param name="BrandKey" select="'N/A'"></xsl:param>
		<xsl:param name="Origin" select="'N/A'"></xsl:param>
		<xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
		<xsl:param name="BrandAdmin" select="'N/A'"></xsl:param>

		<xsl:if test="$Origin != 'CorporatePortal' and $Origin != 'Host' and $Origin != 'LocalOffice' and $Origin != 'AddNewOffice' and $Origin != 'AddNewPortalFromDashboard'">
			<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:template>

	<xsl:template name="RegisterNewBrand">
		<xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
		<xsl:param name="HostName" select="'N/A'"></xsl:param>
		<xsl:param name="BrandID" select="'N/A'"></xsl:param>
		<xsl:param name="IsCommunityAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="EditKey" select="'N/A'"></xsl:param>
		<xsl:param name="BrandKey" select="'N/A'"></xsl:param>
		<xsl:param name="Origin" select="'N/A'"></xsl:param>
		<xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
		<xsl:param name="BrandAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="BrandTypeID" select="'N/A'"></xsl:param>
		<xsl:param name="Action" select="'N/A'"></xsl:param>
		<xsl:variable name="DropDownTextColor">
			<xsl:choose>
				<xsl:when test="$BrandTypeID and $BrandTypeID &gt; 0">
					<xsl:text>black</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>gray</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="RowDefaultDisplay">
			<xsl:choose>
				<xsl:when test="$Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard'">
					<xsl:text>display:none;</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="BrandCheckAvailableCall">
			<xsl:choose>
				<xsl:when test="$Origin != 'AddNewOffice' and $Origin='AddNewPortalFromDashboard'">
					<xsl:text>CreateBrand_CheckAvailable("txtCommunityURL");</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="BrandNameInputClass">
			<xsl:choose>
				<xsl:when test="$Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard'">
					<xsl:text>proPageBoxInput</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>text</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<div>
			<table class="tableMaster" cellpadding="3">
				<tr style="{$RowDefaultDisplay}">
					<td style="width:25%">
						<span class="packageTitle" >
							Type:
						</span>
					</td>
					<td>
						<select class="largeDropdown" name="BrandType" id="ddlBrandType" style="color:{$DropDownTextColor};"
                                onFocus="this.style.color='black';"
                                onchange='setDropDownStyle("ddlBrandType");'>
							<option selected="selected" value="0">Select your brand type..</option>
							<xsl:for-each select="BrandTypes/BrandTypeNode">
								<xsl:choose>
									<xsl:when test="$BrandTypeID = BrandTypeID">
										<option value="{BrandTypeID/.}" selected="selected">
											<xsl:value-of select="normalize-space(BrandType/.)"/>
										</option>
									</xsl:when>
									<xsl:otherwise>
										<option value="{BrandTypeID/.}">
											<xsl:value-of select ="normalize-space(BrandType/.)"/>
										</option>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:for-each>
						</select>
					</td>
				</tr>
				<xsl:choose>
					<xsl:when test="$Action='AddNewPortalFromDashboard3_0'">
						<tr>
							<td colspan="2">
								<div style="width:85%;">
									<input type="text" name="BrandName" id="txtBrandName" style="width:100%; color:gray;" class="{$BrandNameInputClass}" maxlength="50"
									   Placeholder="Add a New Portal... "    onBlur=' setBrandSuggestedName(this); 
                                        {$BrandCheckAvailableCall} setTextBoxStyle("txtCommunityURL","Brand Here");'/>
								</div>
							</td>
						</tr>

					</xsl:when>
					<xsl:otherwise>
						<tr>
							<td class="verticallyMiddle">
								<span class="packageTitle">
									Name:
								</span>
							</td>
							<td>
								<div style="width:85%;">
									<input type="text" name="BrandName" id="txtBrandName" style="width:100%; color:gray;" class="{$BrandNameInputClass}" 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); 
                                        {$BrandCheckAvailableCall} setTextBoxStyle("txtCommunityURL","Brand Here");'/>
								</div>
							</td>
						</tr>
					</xsl:otherwise>
				</xsl:choose>
				<tr>
					<td class="verticallyMiddle">
						<span class="packageTitle">
							Active:
						</span>
					</td>
					<td class="verticallyMiddle">
						<select id="opt_Active" class="smallDropdown" style="width:50px;">
							<option value="1" selected="selected">
								<xsl:text>Yes</xsl:text>
							</option>
							<option value="0">
								<xsl:text>No</xsl:text>
							</option>
						</select>
					</td>
				</tr>
				<tr style='{$RowDefaultDisplay}'>
					<td valign="bottom">
						<span class="packageTitle">
							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">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='{$BrandCheckAvailableCall} 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 style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							Description:
						</span>
					</td>
					<td>
						<div style="width:85%;">
							<textarea 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 style="{$RowDefaultDisplay}">
					<td style="width:30%">
						<span class="packageTitle" >
							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 style="{$RowDefaultDisplay}">
					<td style="width:30%">
						<span class="packageTitle" >
							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="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							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="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							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 style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							Website URL:
						</span>
					</td>
					<td>
						<div style="width:85%;">
							<input type="text" name="Website" id="txtWebsite" style="width:100%;  color:gray;{$RowDefaultDisplay}" class="text" maxlength="255"
                                   onFocus='clearTextBox("txtWebsite","Enter your company website here..");'
                                   onBlur='setTextBoxStyle("txtWebsite","Enter your company website here..");' />
						</div>
					</td>
				</tr>
				<tr style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							Company E-mail:
						</span>
					</td>
					<td>
						<div style="width:85%;">
							<input type="text" name="CompanyEmail" id ="txtCompanyEmail" style="width:100%;  color:gray;{$RowDefaultDisplay}" class="text" maxlength="255"
                                   onFocus='clearTextBox("txtCompanyEmail","name@yourcompany.com");'
                                   onBlur='setTextBoxStyle("txtCompanyEmail","name@yourcompany.com"); CheckEmail("txtCompanyEmail");'/>
						</div>
					</td>
				</tr>

				<tr style="{$RowDefaultDisplay}">
					<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:template>

	<xsl:template name="UpdateExistingBrand">
		<xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
		<xsl:param name="HostName" select="'N/A'"></xsl:param>
		<xsl:param name="BrandID" select="'N/A'"></xsl:param>
		<xsl:param name="IsCommunityAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="EditKey" select="'N/A'"></xsl:param>
		<xsl:param name="BrandKey" select="'N/A'"></xsl:param>
		<xsl:param name="Origin" select="'N/A'"></xsl:param>
		<xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
		<xsl:param name="BrandAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="ActiveYN" select="'N/A'"></xsl:param>
		<xsl:param name="PermissionID" select="'N/A'"></xsl:param>

		<xsl:variable name="RowDefaultDisplay">
			<xsl:choose>
				<xsl:when test="$Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard'">
					<xsl:text>display:none;</xsl:text>
				</xsl:when>
			</xsl:choose>
		</xsl:variable>

		<xsl:variable name="BrandNameInputClass">
			<xsl:choose>
				<xsl:when test="$Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard'">
					<xsl:text>proPageBoxInput</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>text</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<div>
			<table class="tableMaster" cellpadding="3">
				<tr style="{$RowDefaultDisplay}">
					<td style="width:25%">
						<span class="packageTitle" >
							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="packageTitle">
							Name:
						</span>
					</td>
					<td>
						<div style="width:85%;">



							<xsl:choose>
								<xsl:when test="$PermissionID=4">
									<input  type="text" name="BrandName" id="txtBrandName" style="width:100%; " class="{$BrandNameInputClass}" 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="{$BrandNameInputClass}" 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 class="verticallyMiddle">
						<span class="packageTitle">
							Active:
						</span>
					</td>
					<td class="verticallyMiddle">
						<select id="opt_Active" class="smallDropdown" style="width:50px;">
							<xsl:choose>
								<xsl:when test="$ActiveYN = 1">
									<option value="1" selected="selected">
										<xsl:text>Yes</xsl:text>
									</option>
									<option value="0">
										<xsl:text>No</xsl:text>
									</option>
								</xsl:when>
								<xsl:when test="$ActiveYN = 0">
									<option value="1" >
										<xsl:text>Yes</xsl:text>
									</option>
									<option value="0" selected="selected">
										<xsl:text>No</xsl:text>
									</option>
								</xsl:when>
								<xsl:otherwise>
									<option value="1" selected="selected">
										<xsl:text>Yes</xsl:text>
									</option>
									<option value="0">
										<xsl:text>No</xsl:text>
									</option>
								</xsl:otherwise>
							</xsl:choose>
						</select>
					</td>
				</tr>
				<tr style="{$RowDefaultDisplay}">
					<td valign="bottom">
						<span class="packageTitle">
							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 ="actionCountText" id="txtCommunityURL">
														https://www.coachsimple.net/<xsl:value-of select="BrandTypes/CreatedBrand/BrandKey"/>
													</span>
												</td>
											</tr>
										</table>
									</td>
									<td>

									</td>
								</tr>
							</table>
						</div>
					</td>
					<td class='textCenter'>
						<span id='errMessage' class="labelSize10" style="color:green; display:none;">OK</span>
					</td>
				</tr>
				<tr style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							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 style="{$RowDefaultDisplay}">
					<td style="width:30%">
						<span class="packageTitle" >
							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 style="{$RowDefaultDisplay}">
					<td style="width:30%">
						<span class="packageTitle" >
							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="packageTitle">
							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="packageTitle">
							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:choose>
					</td>
				</tr>
				<tr style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							Website URL:
						</span>
					</td>
					<td>
						<div style="width:85%;">
							<input type="text" name="Website" id="txtWebsite" style="width:100%;display:none;" 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 style="{$RowDefaultDisplay}">
					<td>
						<span class="packageTitle">
							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 style="{$RowDefaultDisplay}">
					<td colspan="2">
						<div class="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:template>

	<xsl:template name="CreateWizardFooterButtons">
		<xsl:param name="TemplateURL" select="'N/A'"></xsl:param>
		<xsl:param name="HostName" select="'N/A'"></xsl:param>
		<xsl:param name="BrandID" select="'N/A'"></xsl:param>
		<xsl:param name="IsCommunityAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="EditKey" select="'N/A'"></xsl:param>
		<xsl:param name="BrandKey" select="'N/A'"></xsl:param>
		<xsl:param name="Origin" select="'N/A'"></xsl:param>
		<xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
		<xsl:param name="BrandAdmin" select="'N/A'"></xsl:param>
		<xsl:param name="ParentBrandID" select="'N/A'"></xsl:param>
		<xsl:param name="DefaultChildPortalTypeID" select="'N/A'"></xsl:param>

		<table class="tableMaster">
			<tr>
				<td>

				</td>
				<td></td>
				<xsl:choose>
					<xsl:when test="$Origin = 'CorporatePortal' or $Origin = 'Host' or (($Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard') and $BrandID &gt; 0)">
						<td class="textCenter onMouseOver divBrowseGradient spanBrowseGradientTextGray verticallyMiddle" style="width:70px;height:30px;"
                            onclick='Brand_UpdateCorporateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", {$BrandID},
                                    "txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish","{$Origin}","opt_Active");'
                            onmouseover="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                            onmouseout="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';">
							<img id="img_Save" class="marginRight5" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"></img>
							<span id="span_Save" class="capitalFont">SAVE</span>
						</td>
					</xsl:when>
					<xsl:otherwise>
						<xsl:choose>
							<xsl:when test="$Origin = 'AddNewOffice' or $Origin='AddNewPortalFromDashboard'">
								<td class="textCenter onMouseOver divBrowseGradient spanBrowseGradientTextGray verticallyMiddle" style="width:70px;height:30px;"
                                    onClick='Brand_CreateBrand(
                                    "ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", "-99",
                                    "Brand_HiddenAggrementXML","-99","txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode",
                                    "txtMainPhone","ddlPublish", "{$ParentBrandID}",4, "{$Origin}","{$DefaultChildPortalTypeID}","opt_Active");'
                                    onmouseover="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                    onmouseout="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';">
									<img id="img_Save" class="marginRight5" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"></img>
									<span id="span_Save" class="capitalFont">SAVE</span>
								</td>
							</xsl:when>
							<xsl:when test="$BrandID = 0">
								<td class="textCenter onMouseOver divBrowseGradient spanBrowseGradientTextGray verticallyMiddle" style="width:70px;height:30px;"
                                    onClick='Brand_CreateCorporate(
                                    "ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", 
                                    "Brand_HiddenAggrementXML","{$IsCommunityAdmin}","txtAddress1", "txtAddress2", "txtCity", "txtState", "txtPostalCode",
                                    "txtMainPhone","ddlPublish", "{$ParentBrandID}",-99);'
                                    onmouseover="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                    onmouseout="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';">
									<img id="img_Save" class="marginRight5" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"></img>
									<span id="span_Save" class="capitalFont">CONTINUE</span>
								</td>
							</xsl:when>
							<xsl:when test="$BrandID &gt; 0">
								<td class="textCenter onMouseOver divBrowseGradient spanBrowseGradientTextGray verticallyMiddle" style="width:70px;height:30px;"
                                    onClick='Brand_UpdateCorporateBrand("ddlBrandType", "txtBrandName", "txtWebsite", "txtCompanyEmail", 
                                    "txtCommunityURL", "errMessage", "txtDescription", "ddlBrandSecure", {$BrandID},"txtAddress1", "txtAddress2", 
                                    "txtCity", "txtState", "txtPostalCode", "txtMainPhone","ddlPublish", "1");'
                                    onmouseover="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                                    onmouseout="document.getElementById('img_Save').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';">
									<img id="img_Save" class="marginRight5" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png" align="absmiddle"></img>
									<span id="span_Save" class="capitalFont">CONTINUE</span>
								</td>
							</xsl:when>
						</xsl:choose>
					</xsl:otherwise>
				</xsl:choose>
			</tr>
		</table>
	</xsl:template>

</xsl:stylesheet>
