﻿<?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"/>
    <xsl:include href="../GenericTemplates/Notes_LineBreak.xslt" />
    <xsl:template match="/">
        <xsl:variable name="BrandID" select="CoachDetails/Coach/BrandID"></xsl:variable>
        <xsl:variable name="Description" select="CoachDetails/Coach/BrandDescription"></xsl:variable>
        <xsl:variable name="CoachingStyle" select="CoachDetails/Coach/CoachingStyle"></xsl:variable>
        <xsl:variable name="SpecialityFocus" select="CoachDetails/Coach/SpecialityFocus"></xsl:variable>
        <xsl:variable name="ExperienceCertifications" select="CoachDetails/Coach/ExperienceCertifications"></xsl:variable>
        <xsl:variable name="IdealClient" select="CoachDetails/Coach/IdealClient"></xsl:variable>
        <xsl:variable name="CoachPackage" select="CoachDetails/CoachServiceHTML"></xsl:variable>
        <xsl:variable name="BrandProfileImgURL" select="CoachDetails/Coach/BrandProfileImgURL"></xsl:variable>
        <xsl:variable name="BrandVideoURL" select="normalize-space(CoachDetails/Coach/BrandVideoURL)"></xsl:variable>
        <xsl:variable name="VideoKeyValue" select="normalize-space(CoachDetails/VideoKeyValue)"></xsl:variable>
        <xsl:variable name="TemplateURL" select="CoachDetails/TemplateURL"></xsl:variable>
        <xsl:variable name="BrandKey" select="CoachDetails/Coach/CompanyName"></xsl:variable>

       
        <div id="div_Coach" style="background-color:White;">  
            <table width="100%" cellpadding="1" cellsapcing="0" >                
                <tr>
                    <xsl:if test="$BrandProfileImgURL != ''">
                        <td style="border-right:1px solid rgb(56,93,138);padding-right:5px;" width="15%">
                            <xsl:choose>
                                <xsl:when test="$BrandProfileImgURL != ''">
                                    <div style="margin-bottom:20px;margin-top:10px;" align="center">
                                        <img src="{$BrandProfileImgURL}"  width="180" align="center" style="vertical-align:middle;"></img>
                                    </div>
                                </xsl:when>
                                
                                <xsl:otherwise>
                                    <div style="margin-bottom:20px;margin-top:10px;" align="center">
                                        <img src="{$BrandProfileImgURL}" width="180" align="center" style="vertical-align:middle;"></img>
                                    </div>
                                   
                                </xsl:otherwise>
                            </xsl:choose>
                        </td>
                    </xsl:if>


                    <td width="85%">
                        <div>
                            <xsl:choose>
                                <xsl:when test="$BrandVideoURL != ''">
                                    <div style="margin-top:10px;" align="center">
                                        <xsl:choose>
                                            <xsl:when test="contains($BrandVideoURL,'youtube') or contains($BrandVideoURL,'youtu.be')">
                                                <div id="divVideoContainer">
                                                    <object width="391"
                                                                height="220">
                                                        <param name="movie" value="http://www.youtube.com/v/{$VideoKeyValue}?autoplay=1&amp;version=3&amp;autohide=1&amp;showinfo=0"></param>
                                                        <param name="allowFullScreen" value="true"></param>
                                                        <param name="allowScriptAccess" value="always"></param>
                                                        <embed src="http://www.youtube.com/v/{$VideoKeyValue}?autoplay=1&amp;version=3&amp;autohide=1&amp;showinfo=0"
                                                                type="application/x-shockwave-flash"
                                                                allowfullscreen="true"
                                                                allowscriptaccess="always"
                                                                width="391"  
                                                                height="220"
                                                                >
                                                        </embed>
                                                    </object>
                                                </div>
                                            </xsl:when>
                                            <xsl:when test ="contains($BrandVideoURL,'vimeo')">
                                                <div id="divVideoContainer">
                                                    <iframe src="http://player.vimeo.com/video/{$VideoKeyValue}?autoplay=1&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1"
                                                                      width="391"
                                                                       height="220"                                                                       
                                                                       frameborder="0">
                                                    </iframe>
                                                </div>
                                            </xsl:when>
                                            <xsl:when test="contains($BrandVideoURL,'dailymotion')">
                                                <object width="391" height="220">
                                                    <param name="movie" value="http://www.dailymotion.com/swf/video/{$VideoKeyValue}&amp;autoplay=1"></param>
                                                    <param name="allowFullScreen" value="true"></param>
                                                    <param name="allowScriptAccess" value="always"></param>
                                                    <embed src="http://www.dailymotion.com/swf/video/{$VideoKeyValue}&amp;autoplay=1"
                                                           type="application/x-shockwave-flash"
                                                           width="391"
                                                           height="220"
                                                           allowfullscreen="true"></embed>
                                                </object>
                                            </xsl:when>
                                            <xsl:when test="contains($BrandVideoURL,'dmcloud.net')">
                                                <iframe frameborder="0" width="391" height="220"
                                                                src="{$BrandVideoURL}&amp;autoplay=1"></iframe>
                                            </xsl:when>
                                            <xsl:otherwise>
                                                <div id="divWorkoutVideoContainer" style="display:block;">
                                                </div>
                                                <script type='text/javascript'>
                                                    LoadAudioFiles('divVideoContainer','<xsl:value-of select ="$BrandVideoURL"/>');
                                                </script>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                    </div>
                                </xsl:when>
                            </xsl:choose>
                        </div>
                        <table cellpadding="0" cellspacing ="0" width="100%" style="padding-top:25px;">
                            <xsl:if test ="$CoachPackage != ''">
                                <tr>
                                    <td>
                                        <span class="BrandHeaderTitles">
                                            Services and Packages:
                                        </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-bottom:20px;">
                                        <span>
                                            <xsl:value-of select="$CoachPackage" disable-output-escaping ="yes"/>
                                        </span>
                                    </td>
                                </tr>
                            </xsl:if>
                            <tr>
                                <td>
                                    <div style="margin-bottom:20px;">
                                        <span class="BrandHeaderTitles18">
                                            About <xsl:value-of select="$BrandKey"/>
                                        </span>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="100%">
                                    <span class="BrandHeaderTitles">
                                        Description:
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-bottom:20px;">
                                    <span class="publicationSummary" >
                                        <xsl:call-template name="break">
                                            <xsl:with-param name="text" select="$Description"></xsl:with-param>
                                        </xsl:call-template>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="BrandHeaderTitles">
                                        Coaching Style:
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-bottom:20px;">
                                    <span class="publicationSummary" >
                                        <xsl:call-template name="break">
                                            <xsl:with-param name="text" select="$CoachingStyle"></xsl:with-param>
                                        </xsl:call-template>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="BrandHeaderTitles">
                                        Speciality/Focus:
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-bottom:20px;">
                                    <span class="publicationSummary" >
                                        <xsl:call-template name="break">
                                            <xsl:with-param name="text" select="$SpecialityFocus"></xsl:with-param>
                                        </xsl:call-template>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="BrandHeaderTitles">
                                        Experience/Certifications:
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-bottom:20px;" >
                                    <span class="publicationSummary" >
                                        <xsl:call-template name="break">
                                            <xsl:with-param name="text" select="$ExperienceCertifications"></xsl:with-param>
                                        </xsl:call-template>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <span class="BrandHeaderTitles">
                                        Ideal Client:
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td style="padding-bottom:20px;">
                                    <span class="publicationSummary">
                                        <xsl:call-template name="break">
                                            <xsl:with-param name="text" select="$IdealClient"></xsl:with-param>
                                        </xsl:call-template>
                                    </span>
                                </td>
                            </tr>
                           
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </xsl:template>
</xsl:stylesheet>
