﻿<?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:variable name="BrandBannerImageURL" select="normalize-space(AjaxRequest/BrandDetails/Detail/BrandBannerImageURL)"></xsl:variable>
        <xsl:variable name="PortalTypeID" select="AjaxRequest/BrandDetails/PortalTypeID"></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;">
                            <xsl:choose>
                                <xsl:when test="$PortalTypeID = 2 or $PortalTypeID = 8">
                                    <span class="packageTitle" >Wide Logo:</span>
                                </xsl:when>
                                <xsl:otherwise>
                                    <span class="packageTitle" >My Logo:</span>
                                </xsl:otherwise>
                            </xsl:choose>

                        </div>
                    </td>
                    <td>
                        <div style="text-align:center;">
                            <xsl:choose>
                                <xsl:when test="$PortalTypeID = 2 or $PortalTypeID = 8">
                                    <span class="packageTitle" >Square Logo Icon:</span>
                                </xsl:when>
                                <xsl:otherwise>
                                    <span class="packageTitle" >My Portrait:</span>
                                </xsl:otherwise>
                            </xsl:choose>
                        </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',null,0);"></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',null,0);"></img>
                                    <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Logo"
                                        onclick="deletePortalImages('{$BrandID}','Logo');"></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',null,0)"
                          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"  style="text-align:center;cursor:pointer;"
                                         onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=2&amp;requiredHeight=135&amp;requiredWidth=135&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait',null,0);"></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=135&amp;requiredWidth=135&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait',null,0);"></img>
                                    <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Portrait"
                                    onclick="deletePortalImages('{$BrandID}','Portrait');"></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=135&amp;requiredWidth=135&amp;requiredFileName=Portrait&amp;Key=UploadPathBrand',
                                                     'Upload_Image','530','390','{$BrandID}','UploadBrandPortrait','div_CoachPortrait',null,0);"
                          style="cursor:pointer;">Here..</span>to upload your
                                <xsl:choose>
                                    <xsl:when test="$PortalTypeID = 2">
                                        <xsl:text>Icon</xsl:text>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:text>Portrait</xsl:text>
                                    </xsl:otherwise>
                                </xsl:choose>
                            </span>
                        </div>

                    </td>
                </tr>
               
                <!--<xsl:if test="$PortalTypeID != 8 or $PortalTypeID != 2 ">
                    <tr>
                        <td>
                            <div style="text-align:center;margin-top:25px;">
                                <span class="packageTitle" >My Profile:</span>
                            </div>
                        </td>
                        <td>
                            <div style="text-align:center;margin-top:25px;">
                                <span class="packageTitle" >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',null,0)"></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',null,0)"></img>
                                        <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Profile"
                                        onclick="deletePortalImages('{$BrandID}','Profile');"></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',null,0)"
                              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>
                                                            <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Video"
                                                                onclick="deletePortalImages('{$BrandID}','Video');"></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>
                                                                <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Video"
                                                                onclick="deletePortalImages('{$BrandID}','Video');"></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>
                                                                <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Video"
                                                                onclick="deletePortalImages('{$BrandID}','Video');"></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>
                                                                <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Video"
                                                                onclick="deletePortalImages('{$BrandID}','Video');"></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:otherwise>
                                                    <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>
                                                            <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Video"
                                                                onclick="deletePortalImages('{$BrandID}','Video');"></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>
                    <tr>
                        <td colspan="2">
                            <div style="text-align:center;margin-top:25px;">
                                <span class="packageTitle" >My Banner:</span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <xsl:choose>
                                <xsl:when test="$BrandBannerImageURL = '' or not($BrandBannerImageURL)">
                                    <div align="center" id="div_BannerImage" style="margin-top:10px;">
                                        <img src="{$TemplateURL}Web/Images/DefaultImage.JPG" style="text-align:center;cursor:pointer;"
                                              onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=3&amp;requiredHeight=135&amp;requiredWidth=980&amp;requiredFileName=Banner&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBannerImage','div_BannerImage',null,0);"></img>
                                    </div>
                                </xsl:when>
                                <xsl:otherwise>
                                    <div align="center" id="div_BannerImage" style="margin-top:10px;">
                                        <img src="{$BrandBannerImageURL}" style="text-align:center;cursor:pointer;"  width="650"
                                              onClick="ImageUploader_PopupCenter('http://{$HostName}/upload/uploadimage.aspx?guid={$PromoteKey}&amp;cropRatio=3&amp;requiredHeight=135&amp;requiredWidth=980&amp;requiredFileName=Banner&amp;Key=UploadPathBrand',
                                                                'Upload_Image','530','390','{$BrandID}','UploadBannerImage','div_BannerImage',null,0);"></img>
                                        <img class="onMouseOver" src="{$TemplateURL}Web/Images/Ver_2_0/BT_x.png" title="Delete Banner"
                                            onclick="deletePortalImages('{$BrandID}','Banner');"></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=3&amp;requiredHeight=135&amp;requiredWidth=980&amp;requiredFileName=Banner&amp;Key=UploadPathBrand',
                                                 'Upload_Image','530','390','{$BrandID}','UploadBannerImage','div_BannerImage',null,0)"
                              style="cursor:pointer;">Here..</span>to upload your Banner
                                </span>
                            </div>
                        </td>
                    </tr>
                </xsl:if>-->
            </table>
        </div>
    </xsl:template>
</xsl:stylesheet>
