﻿<?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:output method="xml" indent="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="IsCommunityAdmin" select="normalize-space(AjaxRequest/IsCommunityAdmin)"></xsl:variable>
        <xsl:variable name="PromoteKey" select="normalize-space(AjaxRequest/BrandDetails/Detail/PromoteKey)"></xsl:variable>
        <xsl:variable name="BrandLogoURL" select="normalize-space(AjaxRequest/BrandDetails/Detail/BrandLogoSmallURL)"></xsl:variable>
        <xsl:variable name="BrandPortraitURL" select="normalize-space(AjaxRequest/BrandDetails/Detail/BrandPortraitURL)"></xsl:variable>
        <xsl:variable name="BrandProfileImageURL" select="normalize-space(AjaxRequest/BrandDetails/Detail/BrandProfileImageURL)"></xsl:variable>
        <xsl:variable name="BrandVideoURL" select="normalize-space(AjaxRequest/BrandDetails/Detail/BrandVideoURL)"></xsl:variable>
        <xsl:variable name="VideoKeyValue" select="normalize-space(AjaxRequest/VideoKeyValue)"></xsl:variable>
        <xsl:variable name="Origin" select="normalize-space(AjaxRequest/Origin)"></xsl:variable>
        <xsl:variable name="ThumbnailURL" select="normalize-space(AjaxRequest/ThumbnailURL)"></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>MyImage</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 3 of 3 – Customize Your Image
                                </span>
                            </div>
                            <div style="padding-top:10px">
                                <span class="labelSize13">
                                    "To complete this process and wrap up your custom profile, we request that you upload a few graphics that we can use to market your services."
                                </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>
            <table class="tableMaster">
                <tr>
                    <td>
                        <div style="text-align:center;">
                            <span class="labelHeader" >My Logo:</span>
                        </div>
                    </td>
                    <td>
                        <div style="text-align:center;">
                            <span class="labelHeader" >My Portrait:</span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <xsl:choose>
                            <xsl:when test="$BrandLogoURL = '' or not($BrandLogoURL)">
                                <div align="center" id="div_CoachLogo" style="margin-top:10px;">
                                    <img src="{$TemplateURL}Web/Images/DefaultImage.JPG" height="50" style="text-align:center;cursor:pointer;"
                                          onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=100&amp;requiredWidth=0&amp;requiredFileName=Logo&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandLogo','div_CoachLogo');"></img>
                                </div>
                            </xsl:when>
                            <xsl:otherwise>
                                <div align="center" id="div_CoachLogo" style="margin-top:10px;">
                                    <img src="{$BrandLogoURL}" style="text-align:center;cursor:pointer;"
                                          onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=100&amp;requiredWidth=0&amp;requiredFileName=Logo&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandLogo','div_CoachLogo');"></img>
                                </div>
                            </xsl:otherwise>
                        </xsl:choose>


                        <div style="margin-top:10px;" id="div_LogoText" align="center">
                            <span class="labelSize11" style="color:black;" >
                                Click <span class="labelSize13"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=100&amp;requiredWidth=0&amp;requiredFileName=Logo&amp;Key=UploadPathBrand',
                                                 'Upload_Image','530','390','{$BrandID}','UploadBrandLogo','div_CoachLogo')"
                                        style="cursor:pointer;">Here..</span>to upload your Logo
                            </span>
                        </div>

                    </td>
                    <td align="center">
                        <xsl:choose>
                            <xsl:when test="$BrandPortraitURL = ''">
                                <div align="center" id="div_CoachPortrait" style="margin-top:10px;">
                                    <img src="{$TemplateURL}Web/Images/DefaultImage.JPG" height="50" style="text-align:center;cursor:pointer;"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=2&amp;requiredHeight=50&amp;requiredWidth=50&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait');"></img>
                                </div>
                            </xsl:when>
                            <xsl:otherwise>
                                <div align="center" id="div_CoachPortrait" style="margin-top:10px;">
                                    <img src="{$BrandPortraitURL}"  style="text-align:center;cursor:pointer;"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=2&amp;requiredHeight=50&amp;requiredWidth=50&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait');"></img>
                                </div>
                            </xsl:otherwise>
                        </xsl:choose>


                        <div id="div_PortraitText" style="margin-top:10px;" align="center">
                            <span class="labelSize11" style="color:black;" >
                                Click <span class="labelSize13"
                                            onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=2&amp;requiredHeight=50&amp;requiredWidth=50&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                     'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait');"
                                             style="cursor:pointer;">Here..</span>to upload your Portrait
                            </span>
                        </div>

                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="text-align:center;margin-top:25px;">
                            <span class="labelHeader" >My Profile:</span>
                        </div>
                    </td>
                    <td>
                        <div style="text-align:center;margin-top:25px;">
                            <span class="labelHeader" >My Video:</span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <xsl:choose>
                            <xsl:when test="$BrandProfileImageURL = ''">
                                <div align="center" id="div_CoachProfileImage" style="margin-top:10px;">
                                    <img src="{$TemplateURL}Web/Images/DefaultImage.JPG" height="50" style="text-align:center;cursor:pointer;"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=0&amp;requiredWidth=200&amp;requiredFileName=CoachingProfile&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandProfileImage','div_CoachProfileImage')"></img>
                                </div>
                            </xsl:when>
                            <xsl:otherwise>
                                <div align="center" id="div_CoachProfileImage" style="margin-top:10px;">
                                    <img src="{$BrandProfileImageURL}" style="text-align:center;cursor:pointer;"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=0&amp;requiredWidth=200&amp;requiredFileName=CoachingProfile&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandProfileImage','div_CoachProfileImage')"></img>
                                </div>
                            </xsl:otherwise>
                        </xsl:choose>


                        <div style="margin-top:10px;" id="div_ProfileText" align="center">
                            <span class="labelSize11" style="color:black;" >
                                Click <span class="labelSize13"
                                            onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=1&amp;requiredHeight=0&amp;requiredWidth=200&amp;requiredFileName=CoachingProfile&amp;Key=UploadPathBrand',
                                                    'Upload_Image','530','390','{$BrandID}','UploadBrandProfileImage','div_CoachProfileImage')"
                                             style="cursor:pointer;">Here..</span>to upload your Profile Image
                            </span>
                        </div>
                    </td>

                    <td align="center">
                        <div id="div_Video">
                            <xsl:choose>
                                <xsl:when test="$BrandVideoURL = ''">
                                    <div align="center" style="margin-top:10px;" id="div_VideoImage">
                                        <img src="{$TemplateURL}Web/Images/Video_icon2.png" border="1" height="50" style="text-align:center;"></img>
                                    </div>
                                </xsl:when>
                                <xsl:otherwise>
                                    <div align="center" id="div_CoachvideoURL" style="margin-top:10px;">
                                        <xsl:choose>
                                            <xsl:when test="contains($BrandVideoURL,'youtube') or contains($BrandVideoURL,'youtu.be')">
                                                <div id="divVideoContainer">
                                                    <div id="div_VideoImage">
                                                        <img src="http://img.youtube.com/vi/{$VideoKeyValue}/1.jpg" class="link"
                                                          title="Play Video" onClick="workout_LoadYouTubeVideo('{$VideoKeyValue}','divVideoContainer','Workout');"></img>
                                                    </div>
                                                    <div style="margin-top:-30px;margin-right:90px;" id="div_PlayButton">
                                                        <img class="link" title ="Play Video"
                                                             onClick="workout_LoadYouTubeVideo('{$VideoKeyValue}','divVideoContainer','Workout');"
                                                             src="{$TemplateURL}/Web/Images/Play_Icon.png" width="30" height="30"></img>
                                                    </div>
                                                </div>
                                            </xsl:when>
                                            <xsl:when test ="contains($BrandVideoURL, 'vimeo')">
                                                <div id="divWorkOutYouTubeVideoContainer" style="margin-bottom:15px; margin-right:5px;">
                                                    <div id="divVideoContainer">
                                                        <div id="div_VideoImage">
                                                            <img src="{$ThumbnailURL}" class="link" width="120" height="90"
                                                               title="Play Video"
                                                               onClick="LoadVimeoVideo('{$VideoKeyValue}','divVideoContainer','');"></img>
                                                        </div>
                                                        <div style="margin-top:-30px;margin-right:90px;" id="div_PlayButton">
                                                            <img class="link" title ="Play Video"
                                                                 onClick="LoadVimeoVideo('{$VideoKeyValue}','divVideoContainer','');"
                                                                 src="{$TemplateURL}/Web/Images/Play_Icon.png" width="30" height="30"></img>
                                                        </div>
                                                    </div>
                                                </div>
                                            </xsl:when>
                                            <xsl:when test="contains($BrandVideoURL, 'dailymotion')">
                                                <div id="divWorkOutYouTubeVideoContainer" style="margin-bottom:15px; margin-right:5px;">
                                                    <div id="divVideoContainer">
                                                        <div id="div_VideoImage">
                                                            <img src="http://www.dailymotion.com/thumbnail/video/{$VideoKeyValue}" class="link" width="120" height="90"
                                                               title="Play Video" onClick="LoadDailyMotionVideo('{$VideoKeyValue}','divVideoContainer','');"></img>
                                                        </div>
                                                        <div style="margin-top:-30px;margin-right:90px;" id="div_PlayButton">
                                                            <img class="link" title ="Play Video"
                                                                 onClick="LoadDailyMotionVideo('{$VideoKeyValue}','divVideoContainer','');"
                                                                 src="{$TemplateURL}/Web/Images/Play_Icon.png" width="30" height="30"></img>
                                                        </div>
                                                    </div>
                                                </div>
                                            </xsl:when>
                                            <xsl:when test="contains($BrandVideoURL, 'dmcloud.net')">
                                                <div id="divWorkOutYouTubeVideoContainer" style="margin-bottom:15px; margin-right:5px;">
                                                    <div id="divVideoContainer">
                                                        <div id="div_VideoImage">
                                                            <img src="http://static.dmcloud.net/{$ThumbnailURL}/jpeg_thumbnail_medium-1308342384.jpeg" class="link" width="120" height="90"
                                                               title="Play Video" onClick="LoadDailyMotionVideo('{$BrandVideoURL}','divVideoContainer','');"></img>
                                                        </div>
                                                        <div style="margin-top:-30px;margin-right:90px;" id="div_PlayButton">
                                                            <img class="link" title ="Play Video"
                                                                 onClick="LoadDailyMotionVideo('{$BrandVideoURL}','divVideoContainer','');"
                                                                 src="{$TemplateURL}/Web/Images/Play_Icon.png" width="30" height="30"></img>
                                                        </div>
                                                    </div>
                                                </div>
                                            </xsl:when>                                           
                                            <!--<xsl:when test ="contains($BrandVideoURL, '.swf')">
                                                @Video.Flash(path: "{$VideoURL}",
                                                width: "250",
                                                height: "200",
                                                play: true,
                                                loop: true,
                                                menu:  false,
                                                bgColor: "blue",
                                                quality: "autohigh",
                                                scale: "exactfit",
                                                windowMode: "transparent")
                                            </xsl:when>
                                            <xsl:when test ="contains($BrandVideoURL, '.wmv')">
                                                @Video.MediaPlayer(
                                                path: "{$VideoURL}",
                                                width: "250",
                                                height: "200",
                                                autoStart: true,
                                                playCount: 1,
                                                uiMode:  "min",
                                                stretchToFit: true,
                                                enableContextMenu: true,
                                                mute: false,
                                                volume: 75)
                                            </xsl:when>
                                            <xsl:when test ="contains($BrandVideoURL, '.xap')">
                                                @Video.Silverlight(
                                                path: "{$VideoURL}",
                                                width: "250",
                                                height: "200",
                                                bgColor: "red",
                                                autoUpgrade: true)
                                            </xsl:when>-->
                                            <xsl:otherwise>
                                                <!--<xsl:value-of select ="$BrandVideoURL"/>-->
                                                <div id="divWorkoutVideoContainer" style="display:block;">
                                                </div>
                                                <div id="divVideoContainer">
                                                    <div id="div_VideoImage">

                                                        <img src="{$TemplateURL}/Web/Images/AudioPlayer.png" width="50" height="50" style="cursor:pointer;"
                                                             onClick="LoadAudioFiles('divVideoContainer','{$BrandVideoURL}');"></img>
                                                    </div>
                                                    <div style="margin-top:-30px;margin-right:90px;display:none;" id="div_PlayButton">
                                                        <img class="link" title ="Play Video"
                                                             src="{$TemplateURL}/Web/Images/Play_Icon.png" width="30" height="30"></img>
                                                    </div>
                                                </div>
                                            </xsl:otherwise>
                                        </xsl:choose>
                                    </div>
                                </xsl:otherwise>
                            </xsl:choose>
                        </div>
                        <div style="margin-top:10px;" id="div_VideoText" align="center">
                            <span class="labelSize11" style="color:black;">Audio/Video URL:</span>
                            <input id="txt_VideoURL" type="text" style="width:150px;"></input>

                            <input id="btn_SaveVideo" style="margin-right:20px;"  type="button" class="button" value="Save"
                                   onclick="coachWizard_saveVideoURL('{$BrandID}','txt_VideoURL','div_CoachvideoURL');"></input>
                        </div>
                    </td>
                </tr>
            </table>
        </div>


    </xsl:template>
</xsl:stylesheet>
