﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="BrandWizardButtons.xslt"/>

    <xsl:template match="/">
        <xsl:variable name="TemplateURL" select="normalize-space(BrandProfile/TemplateURL)"></xsl:variable>
        <xsl:variable name="HostName" select="normalize-space(BrandProfile/HostName)"></xsl:variable>
        <xsl:variable name="BrandID" select="normalize-space(BrandProfile/BrandID)"></xsl:variable>
        <xsl:variable name="PromoteKey" select="normalize-space(BrandProfile/PromoteKey)"></xsl:variable>
        <xsl:variable name="IsCommunityAdmin" select="normalize-space(BrandProfile/IsCommunityAdmin)"></xsl:variable>
        <xsl:variable name ="EditKey" select="normalize-space(BrandProfile/Key)"></xsl:variable>        
        <xsl:variable name="BrandLogo" select="normalize-space(BrandProfile/BrandLogoSmallURL)"></xsl:variable>
        <xsl:variable name="CompanyWebsiteURL" select="normalize-space(BrandProfile/companyWebsiteURL)"></xsl:variable>
        <xsl:variable name="BrandDescription" select="normalize-space(BrandProfile/BrandDescription)"></xsl:variable>

        <xsl:call-template name="BrandWizardButtons">
            <xsl:with-param name="TemplatePathURL" select="$TemplateURL"></xsl:with-param>
            <xsl:with-param name ="Source" >
                <xsl:text>BrandProfile</xsl:text>
            </xsl:with-param>
            <xsl:with-param name="UserRole" select="BrandProfile/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: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 4 of 4 – Customize Your Profile
                            </span>
                        </div>
                        <div style="padding-top:10px">
                            <span class="labelSize13">
                                “To get your profile started, complete the following additional data and upload a logo.  You will have the ability to alter data and images later as well “
                            </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>

        <table cellspacing="15px">
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Brand Logo:
                    </span>
                </td>
                <td>
                    <xsl:choose>
                        <xsl:when test ="$BrandLogo != ''">
                            <!--<span id="spanBrandLogo" style="display:block;">
                                <img style="cursor: pointer; border: 0px none; display:none;" src="{$BrandLogo}"
                                    onload='setWidthAndHeightImage(this,"100");'></img>
                                <a class="link" onClick='flipLoginDivs("spanTxtBrandLogo", "spanBrandLogo")'>Edit</a>
                            </span>-->
                            <span id="spanTxtBrandLogo" style="display:block;">
                                <input type="text" name="Logo" id="txtLogo" style="width:340px; position:absolute;" class="text"
                                       value="{$BrandLogo}" 
                                 onBlur="BrandProfile_saveFeld({$BrandID}, 'BrandLogoSmallURL', 'txtLogo', 'Enter your brand logo here..');"/>
                            </span>
                        </xsl:when>
                        <xsl:otherwise>
                            <input type="text" name="Logo" id="txtLogo" style="width:340px;color:gray; position:absolute;" class="text"
                                   value="Enter your brand logo here.."
                                   onFocus="clearTextBox(&quot;txtLogo&quot;,&quot;Enter your brand logo here..&quot;);"
                                   onBlur="setTextBoxStyle(&quot;txtLogo&quot;,&quot;Enter your brand logo here..&quot;);
                                   BrandProfile_saveFeld({$BrandID}, 'BrandLogoSmallURL', 'txtLogo', 'Enter your brand logo here..');"/>
                        </xsl:otherwise>
                    </xsl:choose>

                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Name:
                    </span>
                </td>
                <td style="">
                    <span class="labelSize10" style="color:black;">
                        <xsl:value-of select="normalize-space(BrandProfile/CompanyName)"/>
                    </span>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Company E-mail:
                    </span>
                </td>
                <td style="">
                    <span class="labelSize10" style="color:black;">
                        <xsl:value-of select="normalize-space(BrandProfile/companyEmail)"/>
                    </span>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Community URL:
                    </span>
                </td>
                <td style="">
                    <span class="labelSize10">
                        Http://www.LifeSpace.com/<xsl:value-of select="normalize-space(BrandProfile/BrandKey)"/>
                    </span>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Website:
                    </span>
                </td>
                <td>
                    <xsl:choose>
                        <xsl:when test ="$CompanyWebsiteURL != ''">
                            <!--<span id="spanBrandWebsite" style="display:block;">
                                <span class="labelSize10" style="color:black;">
                                    <xsl:value-of select="normalize-space($CompanyWebsiteURL)"/>
                                </span>&#xa0;&#xa0;
                                <a class="link" onClick='flipLoginDivs("spanTxtBrandWebsite", "spanBrandWebsite")'>Edit</a>
                            </span>-->
                            <span id="spanTxtBrandWebsite" style="display:block;">
                                <input type="text" name="Logo" id="txtWebsite" style="width:340px;" class="text"
                                       value="{$CompanyWebsiteURL}"
                                onBlur="BrandProfile_saveFeld({$BrandID}, 'CompanyWebsiteURL', 'txtWebsite', 'Enter your company website here..');"/>
                            </span>
                        </xsl:when>
                        <xsl:otherwise>
                            <input type="text" name="Website" id="txtWebsite" style="width:340px;  color:gray;" class="text" maxlength="50"
                                   value="Enter your company website here.."
                                   onFocus="clearTextBox(&quot;txtWebsite&quot;,&quot;Enter your company website here..&quot;);"
                                   onBlur="setTextBoxStyle(&quot;txtWebsite&quot;,&quot;Enter your company website here..&quot;);
                                   BrandProfile_saveFeld({$BrandID}, 'CompanyWebsiteURL', 'txtWebsite', 'Enter your company website here..');"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10">
                        Description:
                    </span>
                </td>
                <td>
                    <xsl:choose>
                        <xsl:when test ="$BrandDescription != ''">
                            <!--<span id="spanBrandDescription" style="display:block;">
                                <span class="labelSize10" style="color:black;">
                                    <xsl:value-of select="normalize-space($BrandDescription)"/>
                                </span>&#xa0;&#xa0;
                                <a class="link" onClick='flipLoginDivs("spanTxtBrandDescription", "spanBrandDescription")'>Edit</a>
                            </span>-->
                            <span id="spanTxtBrandDescription" style="display:block;">
                                <textarea rows="4" id="txtDescription" style="width:340px;" class="textAreaBox"
                                 onBlur="BrandProfile_saveFeld({$BrandID}, 'BrandDescription', 'txtDescription', 'Enter your brand description here..');">
                                    <xsl:value-of select="normalize-space($BrandDescription)"/>
                                </textarea>
                            </span>
                        </xsl:when>
                        <xsl:otherwise>
                            <textarea rows="4" id="txtDescription" style="width:340px; color:gray;" class="textAreaBox"
                                      onFocus="clearTextBox(&quot;txtDescription&quot;,&quot;Enter your brand description here..&quot;);"
                                      onBlur="setTextBoxStyle(&quot;txtDescription&quot;,&quot;Enter your brand description here..&quot;);
                                      BrandProfile_saveFeld({$BrandID}, 'BrandDescription', 'txtDescription', 'Enter your brand description here..');">
                                Enter your brand description here..
                            </textarea>
                        </xsl:otherwise>
                    </xsl:choose>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Primary Address:
                    </span>
                </td>
                <td class="labelSize10">
                    <div>
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <!--BrandProfile_saveFeld(BrandID, fieldName , value, ctrltextif )-->
                        <xsl:if test="normalize-space(BrandProfile/Address1) = '' ">
                            <input type="text" id="txtAddress1" class="text" style="color: gray;  margin-bottom:5px;" name="Address1"
                                   onblur="setTextBoxStyle(&quot;txtAddress1&quot;,&quot;Address 1&quot;); BrandProfile_saveFeld({$BrandID}, 'Address1', 'txtAddress1', 'Address 1');"
                                   onfocus="clearTextBox(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                   value="Address 1"
                                   maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/Address1) != '' ">
                            <input type="text" id="txtAddress1" class="text" style=" margin-bottom:5px;" name="Address1"
                                   onblur="setTextBoxStyle(&quot;txtAddress1&quot;,&quot;Address 1&quot;); BrandProfile_saveFeld({$BrandID}, 'Address1', 'txtAddress1', 'Address 1');"
                                   onfocus="clearTextBox(&quot;txtAddress1&quot;,&quot;Address 1&quot;);"
                                   value="{BrandProfile/Address1}"
                                   maxlength="50"></input>
                        </xsl:if>
                        <!---->
                    </div>
                    <div>
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <xsl:if test="normalize-space(BrandProfile/Address2) = '' ">
                            <input type="text" id="txtAddress2" class="text" style="color: gray;  margin-bottom:5px;" name="Address2"
                                   onblur="setTextBoxStyle(&quot;txtAddress2&quot;,&quot;Address 2&quot;); BrandProfile_saveFeld({$BrandID}, 'Address2', 'txtAddress2', 'Address 2');"
                                   onfocus="clearTextBox(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                   value="Address 2"
                                   maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/Address2) != '' ">
                            <input type="text" id="txtAddress2" class="text" style=" margin-bottom:5px;" name="Address2"
                                   onblur="setTextBoxStyle(&quot;txtAddress2&quot;,&quot;Address 2&quot;); BrandProfile_saveFeld({$BrandID}, 'Address2', 'txtAddress2', 'Address 2');"
                                   onfocus="clearTextBox(&quot;txtAddress2&quot;,&quot;Address 2&quot;);"
                                   value="{BrandProfile/Address2}"
                                   maxlength="50"></input>
                        </xsl:if>
                    </div>
                    <div>
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <xsl:if test="normalize-space(BrandProfile/City) = '' ">
                            <input type="text" id="txtCity" class="text" style="color: gray;  margin-bottom:5px;" name="City"
                                   onblur="setTextBoxStyle(&quot;txtCity&quot;,&quot;City&quot;); BrandProfile_saveFeld({$BrandID}, 'City', 'txtCity', 'City');"
                                   onfocus="clearTextBox(&quot;txtCity&quot;,&quot;City&quot;);"
                                   value="City"
                                   maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/City) != '' ">
                            <input type="text" id="txtCity" class="text" style=" margin-bottom:5px;" name="City"
                                   onblur="setTextBoxStyle(&quot;txtCity&quot;,&quot;City&quot;); BrandProfile_saveFeld({$BrandID}, 'City', 'txtCity', 'City');"
                                   onfocus="clearTextBox(&quot;txtCity&quot;,&quot;City&quot;);"
                                   value="{BrandProfile/City}"
                                   maxlength="50"></input>
                        </xsl:if>
                    </div>
                    <div>
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <xsl:if test="normalize-space(BrandProfile/State) = '' ">
                            <input type="text" id="txtState" class="text" style="color: gray;  margin-bottom:5px;" name="State"
                                          onblur="setTextBoxStyle(&quot;txtState&quot;,&quot;State&quot;); BrandProfile_saveFeld({$BrandID}, 'State', 'txtState', 'State');"
                                          onfocus="clearTextBox(&quot;txtState&quot;,&quot;State&quot;);"
                                          value="State"
                                          maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/State) != '' ">
                            <input type="text" id="txtState" class="text" style=" margin-bottom:5px;" name="State"
                                          onblur="setTextBoxStyle(&quot;txtState&quot;,&quot;State&quot;); BrandProfile_saveFeld({$BrandID}, 'State', 'txtState', 'State');"
                                          onfocus="clearTextBox(&quot;txtState&quot;,&quot;State&quot;);"
                                          value="{BrandProfile/State}"
                                          maxlength="50"></input>
                        </xsl:if>

                    </div>
                    <div>
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <xsl:if test="normalize-space(BrandProfile/PostalCode) = '' ">
                            <input type="text" id="txtPostalCode" class="text" style="color: gray;  margin-bottom:5px;" name="PostalCode"
                                          onblur="setTextBoxStyle(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;); BrandProfile_saveFeld({$BrandID}, 'PostalCode', 'txtPostalCode', 'Postal Code');"
                                          onfocus="clearTextBox(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                          value="Postal Code"
                                          maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/PostalCode) != '' ">
                            <input type="text" id="txtPostalCode" class="text" style=" margin-bottom:5px;" name="PostalCode"
                                          onblur="setTextBoxStyle(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;); BrandProfile_saveFeld({$BrandID}, 'PostalCode', 'txtPostalCode', 'Postal Code');"
                                          onfocus="clearTextBox(&quot;txtPostalCode&quot;,&quot;Postal Code&quot;);"
                                          value="{BrandProfile/PostalCode}"
                                          maxlength="50"></input>
                        </xsl:if>
                    </div>
                </td>
            </tr>
            <tr>
                <td style="width:30%">
                    <span class="labelSize10" >
                        Primary Phone:
                    </span>
                </td>
                <td>
                    <div class="labelSize10">
                        <!--<input type="checkbox" name="PrimaryAddress"></input>-->
                        <xsl:if test="normalize-space(BrandProfile/PhoneMain) = '' ">
                            <input type="text" id="txtMainPhone" class="text" style="color: gray; margin-bottom:5px;" name="MainPhone"
                                          onblur="setTextBoxStyle(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;); BrandProfile_saveFeld({$BrandID}, 'PhoneMain', 'txtMainPhone', 'Main Phone');"
                                          onfocus="clearTextBox(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                          value="Main Phone"
                                          maxlength="50"></input>
                        </xsl:if>
                        <xsl:if test="normalize-space(BrandProfile/PhoneMain) != '' ">
                            <input type="text" id="txtMainPhone" class="text" style="margin-bottom:5px;" name="MainPhone"
                                          onblur="setTextBoxStyle(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;); BrandProfile_saveFeld({$BrandID}, 'PhoneMain', 'txtMainPhone', 'Main Phone');"
                                          onfocus="clearTextBox(&quot;txtMainPhone&quot;,&quot;Main Phone&quot;);"
                                          value="{BrandProfile/PhoneMain}"
                                          maxlength="50"></input>
                        </xsl:if>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span class="labelSize13">
                        Open each profile tab  to customize further
                    </span>
                </td>
            </tr>
        </table>

        <div align="right" style="padding-top: 20px;">
            <xsl:choose>
                <xsl:when test="$EditKey = 0">
                    <a class="link" href="http://{$HostName}/{normalize-space($PromoteKey)}">
                        <img style="cursor: pointer; border: 0px none;" title="ContinueButton" src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png"></img>
                    </a>
                </xsl:when>
                <xsl:otherwise>
                    <a class="link" href="http://{$HostName}/{normalize-space($PromoteKey)}">
                        <img style="cursor: pointer; border: 0px none;" title="SaveButton" src="{normalize-space($TemplateURL)}Web/Images/BtnSave.png"></img>
                    </a>
                </xsl:otherwise>
            </xsl:choose>
               
           
        </div>

    </xsl:template>
</xsl:stylesheet>
