﻿<?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:output method="xml" indent="yes" omit-xml-declaration ="yes"/>

    <xsl:template match="/">
        <xsl:call-template name ="AddCoachServices">
            <xsl:with-param name ="BrandID" select ="AjaxRequest/Params/BrandID"></xsl:with-param>
            <xsl:with-param name ="TemplateURL" select ="AjaxRequest/TemplateURL"></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" select ="AjaxRequest/Params/Mode"></xsl:with-param>
            <xsl:with-param name="IsCommunityAdmin" select="normalize-space(AjaxRequest/IsCommunityAdmin)"></xsl:with-param>
        </xsl:call-template>
    </xsl:template>

    <xsl:template name ="AddCoachServices">
        <xsl:param name ="BrandID" select ="'N/A'"></xsl:param>
        <xsl:param name ="PackageServices" select ="'N/A'"></xsl:param>
        <xsl:param name ="GoalFocus" select ="'N/A'"></xsl:param>
        <xsl:param name ="CheckInCalls" select ="'N/A'"></xsl:param>
        <xsl:param name ="Mode" select ="'N/A'"></xsl:param>
        <xsl:param name ="IsCommunityAdmin" select ="'N/A'"></xsl:param>
        <xsl:param name="TemplateURL" select="'N/A'"></xsl:param>

        <table class="tableMaster" cellpadding="0" cellspacing="5" border="0">
            <tr>
                <td>
                    <span class="packageTitle">
                        Package Name:
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <div style="width:75%;">
                        <input type="text" id="txtPackName" class="text" style="width:100%" maxlength="100"/>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <span class="packageTitle">
                        Package Description:
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <div style="width:75%;">
                        <textarea rows="4" id="txtPackDescription" class="textAreaBox"></textarea>
                    </div>
                </td>
            </tr>
            <xsl:choose>
                <xsl:when test ="$Mode = 'AddAdditionService'">
                    <tr>
                        <td>
                            <span class="packageTitle">
                                Package Amount:
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div style="width:75%;">
                                <input type="text" id="txtPackAmount" class="text" style="width:100%" maxlength="6"/>
                            </div>
                        </td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>
                            <span class="packageTitle">
                                Package Amount: $99.00
                                <input type="hidden" id="txtPackAmount" value="99" />
                            </span>
                        </td>
                    </tr>
                </xsl:otherwise>
            </xsl:choose>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbService" checked="checked"
                           onClick='coachServices_checkUncheckCheckBox("ddlServices", "chbService");'/>
                    <span class="publicationSummary">
                        This Package Covers &#xa0;
                        <select class="smallDropdown" id="ddlServices"
                                onChange='coachServices_checkUncheckDropDown("ddlServices", "chbService");'>
                            <option value="-1" selected="selected">Choose...</option>
                            <xsl:for-each select ="$PackageServices/PackageServicesID">
                                <option value="{ID/.}">
                                    <xsl:value-of select ="normalize-space(Name/.)"/>
                                </option>
                            </xsl:for-each>
                        </select>
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbCallMins" checked="checked"
                           onClick='coachServices_setTextBoxValue("txtCallMins","chbCallMins");'/>
                    <span class="publicationSummary">
                        Includes an Coaching Call up to&#xa0;
                        <input type="text" class="text" style="width:5%" value ="0" maxlength="3" id="txtCallMins"
                               onBlur='coachServices_setCheckBoxValue("txtCallMins","chbCallMins");'/>&#xa0;Minutes
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbAccTrack" checked="checked"/>
                    <span class="publicationSummary">Includes Accountability Tracking Using LifeSpace Goals and Templates</span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbCheckCalls"
                           onClick='coachServices_checkUncheckCheckBox("ddlCalls", "chbCheckCalls");'/>
                    <span class="publicationSummary">
                        Additional&#xa0;
                        <select class="smallDropdown" id="ddlCalls"
                                onChange='coachServices_checkUncheckDropDown("ddlCalls", "chbCheckCalls");'>
                            <option value="-1" selected="selected">Choose...</option>
                            <xsl:for-each select ="$CheckInCalls/CheckInCallsID">
                                <option value="{ID/.}">
                                    <xsl:value-of select ="normalize-space(Name/.)"/>
                                </option>
                            </xsl:for-each>
                        </select>&#xa0;Coaching Calls
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbEMail"/>
                    <span class="publicationSummary">E-Mail Support Via LifeSpace Discussions</span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" id="chbFocus"
                           onClick='coachServices_checkUncheckCheckBox("ddlFocus", "chbFocus");'/>
                    <span class="publicationSummary">
                        We Will Focus on&#xa0;
                        <select class="smallDropdown" id="ddlFocus"
                              onChange='coachServices_checkUncheckDropDown("ddlFocus", "chbFocus");'>
                            <option value="-1" selected="selected">Choose...</option>
                            <xsl:for-each select ="$GoalFocus/GoalFocusID">
                                <option value="{ID/.}">
                                    <xsl:value-of select ="normalize-space(Name/.)"/>
                                </option>
                            </xsl:for-each>
                        </select>&#xa0;
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="checkbox" class="labelSize10" style="margin-top:20px;" id="chbAssistance"/>
                    <span class="publicationSummary">
                        I need assistance. Have a LifeSpace account representative contact me
                    </span>
                </td>
            </tr>
            <xsl:choose>
                <xsl:when test ="$IsCommunityAdmin = 'True'">
                    <tr>
                        <td>
                            <span class="packageTitle">
                                Buy Button Override:
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div style="width:75%;">
                                <textarea rows="4" id="txtPayPalHTML" class="textAreaBox">
                                    <xsl:value-of select ="AjaxRequest/CoachServices/CoachServiceNode/PayPalHTML" disable-output-escaping ="yes"/>
                                </textarea>
                            </div>
                        </td>
                    </tr>
                </xsl:when>
                <xsl:otherwise>
                    <tr>
                        <td>
                            <textarea id="txtPayPalHTML" style="display:none;">
                                <xsl:value-of select ="AjaxRequest/CoachServices/CoachServiceNode/PayPalHTML" disable-output-escaping ="yes"/>
                            </textarea>
                        </td>
                    </tr>
                </xsl:otherwise>
            </xsl:choose>
            <tr>
                <td>
                    <div onclick='coachWizard_SaveServices("{$BrandID}","txtPackName","txtPackDescription","txtPackAmount"
                               ,"chbService","ddlServices","chbCallMins",
                               "chbAccTrack","chbCheckCalls","ddlCalls","chbEMail",
                               "chbFocus","ddlFocus","chbAssistance","txtCallMins","div_{$BrandID}_Display_Services","txtPayPalHTML");'
                         onmouseout="document.getElementById('img_AddAGoal').src='{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png';"
                         onmouseover="document.getElementById('img_AddAGoal').src='{$TemplateURL}Web/Images/Ver_2_0/icon_add_over.png';"
                         style="width:120px;line-height:30px;"
                         class="verticallyMiddle onMouseOver divBrowseGradient spanBrowseGradientTextGray">
                        <img align="absmiddle" class="marginRight5" style="padding-left:8px;" src="{$TemplateURL}Web/Images/Ver_2_0/icon_Add.png"
                             id="img_AddAGoal"/>
                        <span id="span_Cancel" class="capitalFont">Save Package</span>
                    </div>

                </td>
            </tr>
        </table>
    </xsl:template>

</xsl:stylesheet>
