﻿<?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="CoachWizardButtons.xslt"/>
    <xsl:import href="AddCoachServices.xslt"/>
    <xsl:output method="xml" indent="yes" omit-xml-declaration ="yes"/>

    <xsl:template match="/">
        <xsl:variable name="TemplateURL" select="normalize-space(AjaxRequest/TemplateURL)"></xsl:variable>
        <xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"></xsl:variable>
        <xsl:variable name="BrandID" select="normalize-space(AjaxRequest/BrandID)"></xsl:variable>
        <xsl:variable name="Origin" select="normalize-space(AjaxRequest/Origin)"></xsl:variable>
        <xsl:variable name="IsCommunityAdmin" select="normalize-space(AjaxRequest/IsCommunityAdmin)"></xsl:variable>
        <xsl:variable name="PromoteKey" select="normalize-space(AjaxRequest/BrandDetails/Detail/PromoteKey)"></xsl:variable>
        <xsl:variable name="DisplayDiv">
            <xsl:choose>
                <xsl:when test="AjaxRequest/ServicesHTML != ''">
                    <xsl:text>display:none</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>display:block</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:variable name="DisplayButton">
            <xsl:choose>
                <xsl:when test="AjaxRequest/ServicesHTML != ''">
                    <xsl:text>display:block</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>display:none</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:variable name="BorderDisplay">
            <xsl:choose>
                <xsl:when test="AjaxRequest/ServicesHTML = ''">
                    <xsl:text>border-top:1px solid #385D8A;width:90%;margin-top:10px;</xsl:text>
                </xsl:when>
            </xsl:choose>
        </xsl:variable>

        <xsl:if test="$Origin != 'CoachingPortal'">
            <xsl:call-template name="CoachWizardButtons">
                <xsl:with-param name="TemplatePathURL" select="$TemplateURL"></xsl:with-param>
                <xsl:with-param name ="Source" >
                    <xsl:text>MyServices</xsl:text>
                </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="PromoteKey" select="$PromoteKey"></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 2 of 3 – My Services
                                </span>
                            </div>
                            <div style="padding-top:10px">
                                <span class="labelSize13">
                                    "Now that you have provided the proper information to build out your coaching profile,
                                    please define the packages you will offer for sale through LifeSpace."
                                </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>

        <div style="color: #376092; margin-top: 20px;">
            <table class="tableMaster" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td width="15%" style="align:center" valign="middle">
                        <img src="{normalize-space($TemplateURL)}Web/Images/99Special.png" BORDER="0"
                             style="text-align:center;display:none;"
                                        onload='setWidthAndHeightImage(this,"100");'></img>
                    </td>
                    <td width="85%">
                        <div style="margin-left:15px;">
                            <span class="packageTitle">
                                To be included in the group of recommended coaches on LifeSpace,
                                we require you to offer a $99 Special for LifeSpace Users.
                                Please configure this package now, remembering to be as generous as possible.
                                This can be considered as a loss-leader to gain new customers.
                            </span>
                        </div>
                    </td>
                </tr>
            </table>
        </div>


        <div id="div_{$BrandID}_Display_Services" style="margin-top:20px;margin-bottom:20px;">
            <xsl:if test ="AjaxRequest/ServicesHTML != ''">
                <xsl:value-of select ="AjaxRequest/ServicesHTML" disable-output-escaping ="yes"/>
            </xsl:if>
        </div>


        <div style="color: #376092; margin-top: 20px;{$DisplayDiv};" id="divAddCoachServices">
            <xsl:if test ="AjaxRequest/ServicesHTML = ''">
                <xsl:call-template name ="AddCoachServices">
                    <xsl:with-param name ="BrandID" select ="$BrandID"></xsl:with-param>
                    <xsl:with-param name ="PackageServices" select ="AjaxRequest/PackageServices/."></xsl:with-param>
                    <xsl:with-param name ="GoalFocus" select ="AjaxRequest/GoalFocus/."></xsl:with-param>
                    <xsl:with-param name ="CheckInCalls" select ="AjaxRequest/CheckInCalls/."></xsl:with-param>
                    <xsl:with-param name ="Mode" >
                        <xsl:text>NewService</xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name ="IsCommunityAdmin" select ="$IsCommunityAdmin"></xsl:with-param>
                    <xsl:with-param name="TemplateURL" select="$TemplateURL"></xsl:with-param>
                </xsl:call-template>
            </xsl:if>
        </div>

        <div style="{$BorderDisplay}" id ="divAddAddition">
            <input type="button" class="button" value="Add Additional Package" style="margin-top:15px;{$DisplayButton};"
                               id="btnAddAdditionalPackage"
                   onClick='coachServices_DisplayAddCoachServices("{$BrandID}","divAddCoachServices","AddAdditionService");'></input>
        </div>

        <xsl:choose>
            <xsl:when test="$Origin != 'CoachingPortal'">
                <div align="right" style="padding:10px;">
                    <a class ="link" href="http://{$HostName}/CoachProfile.aspx?ID={$BrandID}">
                        <img src="{normalize-space($TemplateURL)}Web/Images/BtnContinue.png" title="Continue Button" style="cursor: pointer; border:0px;">
                        </img>
                    </a>
                </div>
            </xsl:when>
            <xsl:otherwise>
              
            </xsl:otherwise>
        </xsl:choose>


    </xsl:template>

</xsl:stylesheet>
