﻿<?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:variable name="VideoURL" select="normalize-space(AjaxRequest/Params/VideoURL)"></xsl:variable>
        <xsl:variable name="Origin" select="AjaxRequest/Params/Origin"></xsl:variable>

        <!--<object width="250" height="200">
            <param name="allowfullscreen" value="true" />
            <param name="allowscriptaccess" value="always" />
            <param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id={$VideoURL}&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=1" />
            <xsl:choose>
                <xsl:when test="$Origin = 'Action'">
                    <embed src="http://www.vimeo.com/moogaloop.swf?clip_id={$VideoURL}&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=1"
                       type="application/x-shockwave-flash"
                       allowfullscreen="true"
                       allowscriptaccess="always"
                       width="490"
                       height="350">
                    </embed>
                </xsl:when>
                <xsl:otherwise>
                    <embed src="http://www.vimeo.com/moogaloop.swf?clip_id={$VideoURL}&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=1"
                        type="application/x-shockwave-flash"
                        allowfullscreen="true"
                        allowscriptaccess="always"
                        width="250"
                        height="200"></embed>
                </xsl:otherwise>
            </xsl:choose>
        </object>-->

        <xsl:choose>
            <xsl:when test="$Origin = 'Action'">
                <iframe src="http://player.vimeo.com/video/{$VideoURL}?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="490"
                        height="350"
                        frameborder="0">
                </iframe>
            </xsl:when>
            <xsl:otherwise>
                <iframe src="http://player.vimeo.com/video/{$VideoURL}?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="250"
                        height="200"
                        frameborder="0">
                </iframe>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
</xsl:stylesheet>
