﻿<?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="AjaxRequest/Params/VideoURL"></xsl:variable>
        <xsl:variable name="Origin" select="AjaxRequest/Params/Origin"></xsl:variable>


        <object width="250" height="200">
            <param name="movie" value="http://www.youtube.com/v/{$VideoURL}?autoplay=1&amp;version=3&amp;autohide=1&amp;showinfo=0"></param>
            <param name="allowFullScreen" value="true"></param>
            <param name="allowScriptAccess" value="always"></param>
            <param name="wmode" value="opaque" />           
            <xsl:choose>               
                <xsl:when test="$Origin = 'Action'">
                    <embed src="http://www.youtube.com/v/{$VideoURL}?autoplay=1&amp;version=3&amp;autohide=1&amp;showinfo=0"
                            type="application/x-shockwave-flash"
                            allowfullscreen="true"
                            allowscriptaccess="always"
                            wmode="window"
                            width="490"
                            height="350">
                    </embed>
                </xsl:when>                
                <xsl:otherwise>
                    <embed src="http://www.youtube.com/v/{$VideoURL}?autoplay=1&amp;version=3&amp;autohide=1&amp;showinfo=0"
                            type="application/x-shockwave-flash"
                            allowfullscreen="true"
                            allowscriptaccess="always"
                            wmode="opaque"
                            width="250"
                            height="200">
                    </embed>
                </xsl:otherwise>
            </xsl:choose>

        </object>
    </xsl:template>
</xsl:stylesheet>
