﻿<?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="AutoSuggestVer11.xslt"/>
    <xsl:import href="../ShareITDataList.xslt"/>

    <xsl:output method="xml" indent="yes"/>

    <xsl:template name ="CoachesShareIT">

        <xsl:param name="SourceID" select="'N/A'"></xsl:param>
        <xsl:param name="Origin" select="'N/A'"></xsl:param>
        <xsl:param name="ShareITRecords" select="'N/A'"></xsl:param>
        <xsl:param name="PortalItemID" select="'N/A'"></xsl:param>
        <xsl:param name="PortalName" select="'N/A'"></xsl:param>
        <xsl:param name="LifespaceID" select="'N/A'"></xsl:param>
        <xsl:param name="BrandID" select="'N/A'"></xsl:param>


        <div id="div_shareIt_{$SourceID}_coaches" style="margin-top: 10px;">
            <div id="div_shareIt_{$SourceID}_coaches_Header" style="margin-left: 10px;">
                <div id="div_shareIt_{$SourceID}_coaches_Header_Title">
                    <span class="labelHeader">
                        Coaches
                    </span>
                </div>
                <div id="div_shareIt_{$SourceID}_coaches_Header_PortalName">
                    <span class="labelHeader9PT">
                        <xsl:value-of select="$PortalName"/>
                    </span>
                </div>
            </div>
            <xsl:if test="count($ShareITRecords/ShareIT) = 0">
                <div style="margin-left:10px;">
                    <table>
                        <tr>
                            <td>
                                <img src="DesktopModules/LifeSpaceTemplates/Web/Images/VirtualCoach_small.jpg" border="0"></img>
                            </td>
                            <td>
                                <div id="divCoachShareDisplay" style="display:block;">
                                    <div class="label">
                                        Work With a LifeSpace Coach.
                                    </div>
                                    <div>
                                        Packages start at just $99
                                    </div>
                                    <div style="margin-top:5px;">
                                        <xsl:choose>
                                            <xsl:when test ="$LifespaceID &gt; 0 and $BrandID &gt; 0">
                                                <a href="http://www.LifeSpace.com/FindCoach.aspx?LID={$LifespaceID}&amp;BrandID={$BrandID}" class="link"
                                          target="_blank" onClick="coachesShare_NotifyCoachLearnMore('{$SourceID}');">
                                                    <img src="DesktopModules/LifeSpaceTemplates/Web/Images/learn_more.png" border="0" />
                                                </a>
                                            </xsl:when>
                                            <xsl:when test ="$LifespaceID &lt; 0 and $BrandID &gt; 0">
                                                <a href="http://www.LifeSpace.com/FindCoach.aspx?BrandID={$BrandID}" class="link"
                                          target="_blank" onClick="coachesShare_NotifyCoachLearnMore('{$SourceID}');">
                                                    <img src="DesktopModules/LifeSpaceTemplates/Web/Images/learn_more.png" border="0" />
                                                </a>
                                            </xsl:when>
                                            <xsl:when test ="$LifespaceID &gt; 0 and $BrandID &lt; 0">
                                                <a href="http://www.LifeSpace.com/FindCoach.aspx?LID={$LifespaceID}" class="link"
                                          target="_blank" onClick="coachesShare_NotifyCoachLearnMore('{$SourceID}');">
                                                    <img src="DesktopModules/LifeSpaceTemplates/Web/Images/learn_more.png" border="0" />
                                                </a>
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <a href="http://www.LifeSpace.com/FindCoach.aspx" class="link"
                                          target="_blank" onClick="coachesShare_NotifyCoachLearnMore('{$SourceID}');">
                                                    <img src="DesktopModules/LifeSpaceTemplates/Web/Images/learn_more.png" border="0" />
                                                </a>
                                            </xsl:otherwise>
                                        </xsl:choose>

                                    </div>
                                </div>
                                <div id="divCoachShareHide" style="display:none;">
                                    <span class="Label">
                                        Thank you! A LifeSpace Coach will contact you shortly.
                                    </span>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </xsl:if>
            <div id="div_shareIt_{$SourceID}_coaches_ListShareITData" style="margin-left: 10px;">
                <xsl:call-template name="ShareItDataList">
                    <xsl:with-param name="ShareITRecords" select="$ShareITRecords/."></xsl:with-param>
                    <xsl:with-param name="SourceID" select="$SourceID"></xsl:with-param>
                    <xsl:with-param name="Origin">
                        <xsl:text>CoachesShareIt</xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name="HorizontalDisplay">
                        <xsl:number value="1"/>
                    </xsl:with-param>
                </xsl:call-template>
            </div>

            <xsl:call-template name="AutoSuggestVer11">
                <xsl:with-param name="SourceID" select="$SourceID"></xsl:with-param>
                <xsl:with-param name="TargetDivID">
                    <xsl:text>div_shareIt_</xsl:text>
                    <xsl:value-of select="$SourceID"/>
                    <xsl:text>_coaches</xsl:text>
                </xsl:with-param>
                <xsl:with-param name="Origin">
                    <xsl:text>CoachesShareIt</xsl:text>
                </xsl:with-param>
            </xsl:call-template>
        </div>
    </xsl:template>

</xsl:stylesheet>
