<xsl:stylesheet version="1.0"	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:str="http://exslt.org/strings"
                                extension-element-prefixes="str">
                                
<xsl:import href="ppp/str.xsl" />

<xsl:output method="xml" omit-xml-declaration="yes"/>

 <xsl:template name="videoSource">
       <xsl:choose>
	    <xsl:when test="contains(videoSource,'DVDSCR')"><img src="pictures/flags/source_dvdscr.png"/></xsl:when>
	    <xsl:otherwise>
	     <xsl:choose>
		  <xsl:when test="contains(videoSource,'R5')"><img src="pictures/flags/source_r5.png"/></xsl:when>
		  <xsl:otherwise>
           <xsl:choose>
            <xsl:when test="contains(videoSource,'BluRay')"><img src="pictures/flags/source_bluray.png"/></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoSource,'HDDVD')"><img src="pictures/flags/source_hddvd.png"/></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoSource,'DVD')"><img src="pictures/flags/source_dvd.png"/></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoSource,'HDTV')"><img src="pictures/flags/source_hdtv.png"/></xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(videoSource,'UNKNOWN')"><img src="pictures/flags/unknownvideo.png"/></xsl:when>
                    <xsl:otherwise>
                     <xsl:choose>
                      <xsl:when test="contains(videoSource,'CAM')"><img src="pictures/flags/source_cam.png"/></xsl:when>
                      <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'TS')"><img src="pictures/flags/source_telecine.png"/></xsl:when>
                        <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'D-THEATER')"><img src="pictures/flags/source_dtheater.png"/></xsl:when>
                        <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'WEBDL')"><img src="pictures/flags/source_webdl.png"/></xsl:when>
                        <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'SDTV')"><img src="pictures/flags/source_sdtv.png"/></xsl:when>
                        <xsl:otherwise>
                         <!--<xsl:value-of select="videoSource" />--><img src="pictures/flags/unknownvideo.png"/>
                        </xsl:otherwise>
                       </xsl:choose>
						 </xsl:otherwise>
                       </xsl:choose>
                        </xsl:otherwise>
                       </xsl:choose>
                        </xsl:otherwise>
                       </xsl:choose>
                      </xsl:otherwise>
                     </xsl:choose>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise> 
             </xsl:choose>
            </xsl:otherwise> 
           </xsl:choose>
		  </xsl:otherwise> 
		 </xsl:choose>
		</xsl:otherwise> 
	   </xsl:choose>
 </xsl:template>
 
<xsl:template name="container">
	<xsl:choose>
		<xsl:when test="contains(container,'ASF')"><img src="pictures/flags/container_asf.png"/></xsl:when>
		<xsl:when test="contains(container,'AVI')"><img src="pictures/flags/container_avi.png"/></xsl:when>
		<xsl:when test="contains(container,'BIN')"><img src="pictures/flags/container_bin.png"/></xsl:when>
		<xsl:when test="contains(container,'DAT')"><img src="pictures/flags/container_dat.png"/></xsl:when>
		<xsl:when test="contains(container,'DIVX')"><img src="pictures/flags/container_divx.png"/></xsl:when>
		<xsl:when test="contains(container,'DVD')"><img src="pictures/flags/container_dvd.png"/></xsl:when>
		<xsl:when test="contains(container,'IMG')"><img src="pictures/flags/container_img.png"/></xsl:when>
		<xsl:when test="contains(container,'ISO')"><img src="pictures/flags/container_iso.png"/></xsl:when>
		<xsl:when test="contains(container,'M1V')"><img src="pictures/flags/container_m1v.png"/></xsl:when>
		<xsl:when test="contains(container,'M2P')"><img src="pictures/flags/container_m2p.png"/></xsl:when>
		<xsl:when test="contains(container,'M2T')"><img src="pictures/flags/container_m2t.png"/></xsl:when>
		<xsl:when test="contains(container,'M2TS') or contains(container,'BDAV')"><img src="pictures/flags/container_m2ts.png"/></xsl:when>
		<xsl:when test="contains(container,'M2V')"><img src="pictures/flags/container_m2v.png"/></xsl:when>
		<xsl:when test="contains(container,'M4V')"><img src="pictures/flags/container_m4v.png"/></xsl:when>
		<xsl:when test="contains(container,'MDF')"><img src="pictures/flags/container_mdf.png"/></xsl:when>
		<xsl:when test="contains(container,'MKV') or contains(container,'Matroska')"><img src="pictures/flags/container_mkv.png"/></xsl:when>
		<xsl:when test="contains(container,'MOV')"><img src="pictures/flags/container_mov.png"/></xsl:when>
		<xsl:when test="contains(container,'MP4') or contains(container,'MPEG-4')"><img src="pictures/flags/container_mp4.png"/></xsl:when>
		<xsl:when test="contains(container,'MPG') or contains(container,'PS')"><img src="pictures/flags/container_mpg.png"/></xsl:when>
		<xsl:when test="contains(container,'MTS')"><img src="pictures/flags/container_mts.png"/></xsl:when>
		<xsl:when test="contains(container,'NRG')"><img src="pictures/flags/container_nrg.png"/></xsl:when>
		<xsl:when test="contains(container,'QT')"><img src="pictures/flags/container_qt.png"/></xsl:when>
		<xsl:when test="contains(container,'RAR')"><img src="pictures/flags/container_rar.png"/></xsl:when>
		<xsl:when test="contains(container,'RM')"><img src="pictures/flags/container_rm.png"/></xsl:when>
		<xsl:when test="contains(container,'RMP4')"><img src="pictures/flags/container_rmp4.png"/></xsl:when>
		<xsl:when test="contains(container,'TP')"><img src="pictures/flags/container_tp.png"/></xsl:when>
		<xsl:when test="contains(container,'TRP')"><img src="pictures/flags/container_trp.png"/></xsl:when>
		<xsl:when test="contains(container,'TS')"><img src="pictures/flags/container_ts.png"/></xsl:when>
		<xsl:when test="contains(container,'VOB')"><img src="pictures/flags/container_vob.png"/></xsl:when>
		<xsl:when test="contains(container,'WMV') or contains(container,'Windows Media')"><img src="pictures/flags/container_wmv.png"/></xsl:when>
		<xsl:otherwise>
			<img src="pictures/flags/container_unknown.png"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
 
  <xsl:template name="alaskavideoSource">
       <xsl:choose>
	    <xsl:when test="contains(videoSource,'DVDSCR')"><img src="pictures/flags/source_dvdscr.png" width="59"/></xsl:when>
	    <xsl:otherwise>
	     <xsl:choose>
		  <xsl:when test="contains(videoSource,'R5')"><img src="pictures/flags/source_r5.png" width="59"/></xsl:when>
		  <xsl:otherwise>
           <xsl:choose>
            <xsl:when test="contains(videoSource,'BluRay')"><img src="pictures/flags/source_bluray.png" width="59"/></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoSource,'HDDVD')"><img src="pictures/flags/source_hddvd.png" width="59"/></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoSource,'DVD')"><img src="pictures/flags/source_dvd.png" width="59"/></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoSource,'HDTV')"><img src="pictures/flags/source_hdtv.png" width="59"/></xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(videoSource,'UNKNOWN')"><img src="pictures/flags/unknownvideo.png" width="59"/></xsl:when>
                    <xsl:otherwise>
                     <xsl:choose>
                      <xsl:when test="contains(videoSource,'CAM')"><img src="pictures/flags/source_cam.png" width="59"/></xsl:when>
                      <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'TS')"><img src="pictures/flags/source_telecine.png" width="59"/></xsl:when>
                        <xsl:otherwise>
                         <!--<xsl:value-of select="videoSource" />--><img src="pictures/flags/unknownvideo.png" width="59"/>
                        </xsl:otherwise>
                       </xsl:choose>
                      </xsl:otherwise>
                     </xsl:choose>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise> 
             </xsl:choose>
            </xsl:otherwise> 
           </xsl:choose>
		  </xsl:otherwise> 
		 </xsl:choose>
		</xsl:otherwise> 
	   </xsl:choose>
 </xsl:template>

 <xsl:template name="subtitles">
           <xsl:choose>
            <xsl:when test="contains(subtitles,'YES')"><img src="pictures/detail/cc.png"/></xsl:when>
            <xsl:otherwise><img src="pictures/detail/cc-off.png"/></xsl:otherwise>
           </xsl:choose>
 </xsl:template>

 <xsl:template name="videoCodec">
           <xsl:choose>
            <xsl:when test="contains(videoCodec,'AVC') or contains(videoCodec,'avc1') or contains(videoCodec,'264')"><img src="pictures/flags/codec_h264.png"/></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoCodec,'XviD')"><img src="pictures/flags/codec_xvid.png"/></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoCodec,'DivX')"><img src="pictures/flags/codec_divx.png"/></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoCodec,'MPEG')"><img src="pictures/flags/codec_mpeg.png"/></xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(videoCodec,'icrosoft') or contains(videoCodec,'MICROSOFT') or contains(videoCodec,'VC-1')"><img src="pictures/flags/codec_ms.png"/></xsl:when>
                    <xsl:otherwise>
                     <!--<xsl:value-of select="videoCodec" />--><img src="pictures/flags/unknownvideo.png"/>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise>
             </xsl:choose>
            </xsl:otherwise>
           </xsl:choose>
 </xsl:template>

 <xsl:template name="videoOutput">
           <xsl:choose>
            <xsl:when test="contains(videoOutput,'720p')"><img src="pictures/flags/output_720p.png"/></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoOutput,'1080p')"><img src="pictures/flags/output_1080p.png"/></xsl:when>
              <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoOutput,'1080')"><img src="pictures/flags/output_1080i.png"/></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoOutput,'NTSC') or contains(videoOutput,'24p')"><img src="pictures/flags/output_ntsc.png"/></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoOutput,'PAL')"><img src="pictures/flags/output_pal.png"/></xsl:when>
                  <xsl:otherwise>
                   <!--<xsl:value-of select="videoOutput" />--><img src="pictures/flags/unknownvideo.png"/>
                  </xsl:otherwise>
                 </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise>
             </xsl:choose>
            </xsl:otherwise>
           </xsl:choose>
 </xsl:template>
 
 <xsl:template name="alaskavideoOutput">
           <xsl:choose>
            <xsl:when test="contains(videoOutput,'720p')">720</xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoOutput,'1080')">1080</xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoOutput,'NTSC') or contains(videoOutput,'24p')">NTSC</xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoOutput,'PAL')">PAL</xsl:when>
                  <xsl:otherwise>
                   ?
                  </xsl:otherwise>
                 </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise>
             </xsl:choose>
 </xsl:template>
 
<xsl:template name="framerate">
<xsl:choose><xsl:when test="contains(fps,'23.976')"><img src="pictures/flags/fps_23976.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'24')"><img src="pictures/flags/fps_24.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'25')"><img src="pictures/flags/fps_25.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'29.97')"><img src="pictures/flags/fps_2997.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'30')"><img src="pictures/flags/fps_30.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'50')"><img src="pictures/flags/fps_50.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'59')"><img src="pictures/flags/fps_59.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'59.94')"><img src="pictures/flags/fps_5994.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="contains(fps,'60')"><img src="pictures/flags/fps_60.png"/></xsl:when><xsl:otherwise>
<!--<xsl:value-of select="videoOutput" />--><img src="pictures/flags/unknownvideo.png"/>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:template>

<xsl:template name="aspectratio">
<xsl:variable name="aspectratio" select="substring-before(aspect,':')"/>
<xsl:choose><xsl:when test="$aspectratio &gt;= 1.000 and $aspectratio &lt;= 1.555"><img src="pictures/flags/ar_133.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 1.556 and $aspectratio &lt;= 1.719"><img src="pictures/flags/ar_166.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 1.720 and $aspectratio &lt;= 1.814"><img src="pictures/flags/ar_178.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 1.815 and $aspectratio &lt;= 2.090"><img src="pictures/flags/ar_185.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.100 and $aspectratio &lt;= 2.369"><img src="pictures/flags/ar_235.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.370 and $aspectratio &lt;= 2.394"><img src="pictures/flags/ar_239.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.395 and $aspectratio &lt;= 2.404"><img src="pictures/flags/ar_240.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.405 and $aspectratio &lt;= 2.414"><img src="pictures/flags/ar_241.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.415 and $aspectratio &lt;= 2.484"><img src="pictures/flags/ar_242.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.485 and $aspectratio &lt;= 2.569"><img src="pictures/flags/ar_255.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.570 and $aspectratio &lt;= 2.624"><img src="pictures/flags/ar_259.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.625 and $aspectratio &lt;= 2.709"><img src="pictures/flags/ar_266.png"/></xsl:when><xsl:otherwise>
<xsl:choose><xsl:when test="$aspectratio &gt;= 2.710 and $aspectratio &lt;= 3.000"><img src="pictures/flags/ar_276.png"/></xsl:when><xsl:otherwise>
<img src="pictures/flags/unknownvideo.png"/>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:otherwise></xsl:choose>
</xsl:template>

<xsl:template name="audioCodec">
			<xsl:variable name="parsedAudioCodec" select="tokenize(//details/movie/audioCodec,' / ')"/>           
			<xsl:variable name="parsedAudioChannels" select="tokenize(//details/movie/audioChannels,' / ')"/>
           
<!--           <xsl:for-each select="$parsedAudioCodec">-->
            <xsl:variable name="pass" select="position()" />
            <xsl:if test="$pass!=1"><img src="pictures/Dot.png" /></xsl:if>
            <xsl:choose>
             <xsl:when test="contains($parsedAudioCodec[$pass],'AC3') or contains($parsedAudioCodec[$pass],'DTS') or contains($parsedAudioCodec[$pass],'MP3') or contains($parsedAudioCodec[$pass],'AAC') or contains($parsedAudioCodec[$pass],'TrueHD') or contains($parsedAudioCodec[$pass],'VORBIS') or contains($parsedAudioCodec[$pass],'orbis') or contains($parsedAudioCodec[$pass],'A_FLAC') or contains($parsedAudioCodec[$pass],'QDM') or contains($parsedAudioCodec[$pass],'MICROSOFT') or contains($parsedAudioCodec[$pass],'icrosoft') or contains($parsedAudioCodec[$pass],'162') or contains($parsedAudioCodec[$pass],'VC-1') or contains($parsedAudioCodec[$pass],'PCM')">
              <xsl:if test="contains($parsedAudioCodec[$pass],'AC3') and $parsedAudioChannels[$pass]=2" ><img src="pictures/flags/audcod_dolby20.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'AC3') and $parsedAudioChannels[$pass]=3" ><img src="pictures/flags/audcod_dolby30.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'AC3') and $parsedAudioChannels[$pass]=6" ><img src="pictures/flags/audcod_dolby51.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'TrueHD') and $parsedAudioChannels[$pass]=6" ><img src="pictures/flags/audcod_truehd51.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'TrueHD') and $parsedAudioChannels[$pass]=7" ><img src="pictures/flags/audcod_truehd61.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'TrueHD') and $parsedAudioChannels[$pass]=8" ><img src="pictures/flags/audcod_truehd71.png" align="top"/></xsl:if>
               <xsl:choose>
               <xsl:when test="contains($parsedAudioCodec[$pass],'DTS-HD') and $parsedAudioChannels[$pass]=6"><img src="pictures/flags/audcod_dtshd51.png" align="top"/></xsl:when>
               <xsl:when test="contains($parsedAudioCodec[$pass],'DTS-HD') and $parsedAudioChannels[$pass]=7"><img src="pictures/flags/audcod_dtshd61.png" align="top"/></xsl:when>
               <xsl:when test="contains($parsedAudioCodec[$pass],'DTS-HD') and $parsedAudioChannels[$pass]=8"><img src="pictures/flags/audcod_dtshd71.png" align="top"/></xsl:when>
               <xsl:otherwise>
			   <xsl:if test="contains($parsedAudioCodec[$pass],'DTS') and $parsedAudioChannels[$pass]=6"><img src="pictures/flags/audcod_dts.png" align="top"/></xsl:if></xsl:otherwise>
              </xsl:choose>
              <xsl:if test="contains($parsedAudioCodec[$pass],'MP3')"><img src="pictures/flags/audcod_mp3.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'AAC')"><img src="pictures/flags/audcod_aac.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'VORBIS') or contains($parsedAudioCodec[$pass],'orbis')"><img src="pictures/flags/audcod_ogg.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'A_FLAC')"><img src="pictures/flags/flags/audcod_flac.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'QDM2') or contains($parsedAudioCodec[$pass],'QDMC')"><img src="pictures/flags/audcod_q.png" align="top"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'MICROSOFT') or contains($parsedAudioCodec[$pass],'icrosoft') or contains($parsedAudioCodec[$pass],'162') or contains($parsedAudioCodec[$pass],'VC-1')"><img src="pictures/flags/codec_ms.png" align="top"/></xsl:if>
			  <xsl:if test="contains($parsedAudioCodec[$pass],'PCM')"><img src="pictures/flags/audcod_pcm.png" align="top"/></xsl:if>
             </xsl:when>
             <xsl:otherwise>
              <!--<xsl:value-of select="$parsedAudioCodec[$pass]" />--><img src="pictures/flags/unknownaudio.png"/>
             <!--/xsl:otherwise>
            </xsl:choose>
			<xsl:if test="$LowList='true'"><xsl:text> </xsl:text></xsl:if>
			<xsl:choose>			
             <xsl:when test="$parsedAudioChannels[$pass]=6">
              <img src="pictures/flags/audch_51.png" align="top"/>
             </xsl:when>
             <xsl:otherwise>
              <xsl:choose>
               <xsl:when test="$parsedAudioChannels[$pass]=8">
                <img src="pictures/flags/audch_71.png" align="top"/>
               </xsl:when>
               <xsl:otherwise>
                <xsl:choose>
                 <xsl:when test="$parsedAudioChannels[$pass]=2">
                  <img src="pictures/flags/audch_20.png" align="top"/>
                 </xsl:when>
                 <xsl:otherwise>
                  <xsl:choose>
                   <xsl:when test="$parsedAudioChannels[$pass]=3">
                    <img src="pictures/flags/audch_21.png" align="top"/>
                   </xsl:when>
                 <xsl:otherwise>
                  <xsl:choose>
                   <xsl:when test="$parsedAudioChannels[$pass]=7">
                    <img src="pictures/flags/audch_61.png" align="top"/>
                   </xsl:when>
                   <xsl:otherwise>
                    <!--<xsl:value-of select="$parsedAudioChannels[$pass]" />-->
                   </xsl:otherwise>
                  </xsl:choose>
                 </xsl:otherwise>
                  </xsl:choose>
                 </xsl:otherwise>
                </xsl:choose>
               </xsl:otherwise>
              </xsl:choose>
             </xsl:otherwise>			 
            </xsl:choose>
			
<!--            <xsl:if test="contains($parsedAudioCodec,'(')">
             <xsl:variable name="langAfter" select="substring-after($parsedAudioCodec[$pass],'(')"/>
             <xsl:variable name="langBefore" select="substring-before($langAfter,')')"/>
             <xsl:text>(</xsl:text><xsl:value-of select="$langBefore"/><xsl:text>)</xsl:text>
            </xsl:if>-->
<!--           </xsl:for-each>-->
</xsl:template>

<xsl:template name="AudioLanguages">
			<xsl:variable name="parsedAudioCodec" select="tokenize(//details/movie/audioCodec,' / ')"/>
			
			<xsl:if test="count($parsedAudioCodec) &gt; 2">
				<xsl:value-of select="count($parsedAudioCodec)"/>
			</xsl:if>
			<img src="pictures/lowlist/multiaudio.png">
				<xsl:if test="$dim='true'"><xsl:attribute name="height">24</xsl:attribute></xsl:if>
				<xsl:if test="$dim='false'"><xsl:attribute name="height">35</xsl:attribute></xsl:if>
			</img>

           <xsl:for-each select="$parsedAudioCodec[position() &lt;= 2]">
            <xsl:variable name="pass" select="position()" />
            <xsl:if test="$pass!=1">/</xsl:if>
<!--
            <xsl:if test="not(contains($parsedAudioCodec,'(')) or contains($parsedAudioCodec,'()')">
             <xsl:variable name="langAfter" select="substring-after($parsedAudioCodec[$pass],'(')"/>
             <xsl:variable name="langBefore" select="substring-before($langAfter,')')"/>
				<xsl:if test="$langBefore!=''"><xsl:value-of select="$langBefore"/></xsl:if>
				<xsl:if test="$langBefore=''">?</xsl:if>
            </xsl:if>
           </xsl:for-each>
-->
            <xsl:if test="contains($parsedAudioCodec,'(')">
             <xsl:variable name="langAfter" select="substring-after($parsedAudioCodec[$pass],'(')"/>
             <xsl:variable name="langBefore" select="substring-before($langAfter,')')"/>
				<xsl:value-of select="$langBefore"/>
            </xsl:if>
           </xsl:for-each>
		   
		   <xsl:if test="$parsedAudioCodec[position() = 3] != ''">/...</xsl:if>
</xsl:template>

<xsl:template name="alaskaaudioCodec">
			<xsl:variable name="parsedAudioCodec" select="tokenize(//details/movie/audioCodec,' / ')"/>           
			<xsl:variable name="parsedAudioChannels" select="tokenize(//details/movie/audioChannels,' / ')"/>
            <xsl:variable name="pass" select="position()" />

<td background="pictures/alaska/flags/audcod-frame.png" width="59" align="center">

            <xsl:choose>
             <xsl:when test="contains($parsedAudioCodec[$pass],'AC3') or contains($parsedAudioCodec[$pass],'DTS') or contains($parsedAudioCodec[$pass],'MP3') or contains($parsedAudioCodec[$pass],'AAC') or contains($parsedAudioCodec[$pass],'TrueHD') or contains($parsedAudioCodec[$pass],'VORBIS') or contains($parsedAudioCodec[$pass],'orbis') or contains($parsedAudioCodec[$pass],'A_FLAC') or contains($parsedAudioCodec[$pass],'QDM') or contains($parsedAudioCodec[$pass],'MICROSOFT') or contains($parsedAudioCodec[$pass],'icrosoft') or contains($parsedAudioCodec[$pass],'162') or contains($parsedAudioCodec[$pass],'VC-1') or contains($parsedAudioCodec[$pass],'PCM')">
              <xsl:if test="contains($parsedAudioCodec[$pass],'AC3')" ><img src="pictures/flags/audcod_dolby.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'TrueHD')" ><img src="pictures/flags/audcod_truehd.png" align="top" width="55"/></xsl:if>
              <xsl:choose>
               <xsl:when test="contains($parsedAudioCodec[$pass],'DTS-HD')"><img src="pictures/flags/audcod_dtshd.png" align="top" width="55"/></xsl:when>
               <xsl:otherwise><xsl:if test="contains($parsedAudioCodec[$pass],'DTS')"><img src="pictures/flags/audcod_dts.png" align="top" width="55"/></xsl:if></xsl:otherwise>
              </xsl:choose>
              <xsl:if test="contains($parsedAudioCodec[$pass],'MP3')"><img src="pictures/flags/audcod_mp3.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'AAC')"><img src="pictures/flags/audcod_aac.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'VORBIS') or contains($parsedAudioCodec[$pass],'orbis')"><img src="pictures/flags/audcod_ogg.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'A_FLAC')"><img src="pictures/flags/flags/audcod_flac.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'QDM2') or contains($parsedAudioCodec[$pass],'QDMC')"><img src="pictures/flags/audcod_q.png" align="top" width="55"/></xsl:if>
              <xsl:if test="contains($parsedAudioCodec[$pass],'MICROSOFT') or contains($parsedAudioCodec[$pass],'icrosoft') or contains($parsedAudioCodec[$pass],'162') or contains($parsedAudioCodec[$pass],'VC-1')"><img src="pictures/flags/codec_ms.png" align="top" width="55"/></xsl:if>
			  <xsl:if test="contains($parsedAudioCodec[$pass],'PCM')"><img src="pictures/flags/audcod_pcm.png" align="top" width="55"/></xsl:if>
             </xsl:when>
             <xsl:otherwise>
              <!--<xsl:value-of select="$parsedAudioCodec[$pass]" />--><img src="pictures/flags/unknownaudio.png" height="22"/>
             </xsl:otherwise>
			 </xsl:choose>

</td><td background="pictures/alaska/flags/audch.png" width="25" class="alaska-flags" align="center">

			<xsl:choose>			
             <xsl:when test="$parsedAudioChannels[$pass]=6">
              5.1
             </xsl:when>
             <xsl:otherwise>
              <xsl:choose>
               <xsl:when test="$parsedAudioChannels[$pass]=8">
                7.1
               </xsl:when>
               <xsl:otherwise>
                <xsl:choose>
                 <xsl:when test="$parsedAudioChannels[$pass]=2">
                  2.0
                 </xsl:when>
                 <xsl:otherwise>
                  <xsl:choose>
                   <xsl:when test="$parsedAudioChannels[$pass]=3">
                    2.1
                   </xsl:when>
                 <xsl:otherwise>
                  <xsl:choose>
                   <xsl:when test="$parsedAudioChannels[$pass]=7">
                    6.1
                   </xsl:when>
                   <xsl:otherwise>
                    <!--<xsl:value-of select="$parsedAudioChannels[$pass]" />-->
                   </xsl:otherwise>
                  </xsl:choose>
                 </xsl:otherwise>
                  </xsl:choose>
                 </xsl:otherwise>
                </xsl:choose>
               </xsl:otherwise>
              </xsl:choose>
             </xsl:otherwise>			 
            </xsl:choose>

</td>
</xsl:template>

 <xsl:template name="extras">
         <xsl:for-each select="extras/extra">
          <div class="link">
          <a>
            <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
            <xsl:if test="substring(.,string-length(.)-2) = 'ISO'">
             <xsl:attribute name="zcd">2</xsl:attribute>
            </xsl:if>
            <xsl:if test="substring(.,string-length(.)-2) = 'iso'">
             <xsl:attribute name="zcd">2</xsl:attribute>
            </xsl:if>
            <xsl:if test="substring(.,string-length(.)-2) = 'IMG'">
             <xsl:attribute name="zcd">2</xsl:attribute>
            </xsl:if>
            <xsl:if test="substring(.,string-length(.)-2) = 'img'">
            <xsl:attribute name="zcd">2</xsl:attribute>
            </xsl:if>
            <xsl:if test="substring(.,string-length(.)-7) = 'VIDEO_TS'">
             <xsl:attribute name="zcd">2</xsl:attribute>
            </xsl:if>
            <xsl:attribute name="vod"/>
            <xsl:attribute name="onkeyupset">Play</xsl:attribute>
              <xsl:choose>
               <xsl:when test="contains(@title,'hort')"><img src="pictures/Short.png" onMouseOver="this.src='pictures/ShortSelect.png'" onMouseOut="this.src='pictures/Short.png'" onfocussrc="pictures/ShortSelect.png" align="top" /></xsl:when>
               <xsl:otherwise>
                <xsl:choose>
                 <xsl:when test="contains(@title,'onus')"><img src="pictures/Bonus.png" onMouseOver="this.src='pictures/BonusSelect.png'" onMouseOut="this.src='pictures/Bonus.png'" onfocussrc="pictures/BonusSelect.png" align="top" /></xsl:when>
                 <xsl:otherwise>
                  <xsl:choose>
                   <xsl:when test="contains(.,'clip')"><img src="pictures/Clip.png" onMouseOver="this.src='pictures/ClipSelect.png'" onMouseOut="this.src='pictures/Clip.png'" onfocussrc="pictures/ClipSelect.png" align="top" /></xsl:when>
                   <xsl:otherwise>
                    <xsl:choose>
                     <xsl:when test="contains(.,'30sec')"><img src="pictures/30sec.png" onMouseOver="this.src='pictures/30secSelect.png'" onMouseOut="this.src='pictures/30sec.png'" onfocussrc="pictures/30secSelect.png" align="top" /></xsl:when>
                     <xsl:otherwise>
                      <xsl:choose>
                       <xsl:when test="contains(.,'tsr')"><img src="pictures/Teaser.png" onMouseOver="this.src='pictures/TeaserSelect.png'" onMouseOut="this.src='pictures/Teaser.png'" onfocussrc="pictures/TeaserSelect.png" align="top" /></xsl:when>
                       <xsl:otherwise>
                        <xsl:choose>
                         <xsl:when test="contains(.,'tlr') or contains(@title,'railer') or @title = 'TRAILER'"><img src="pictures/Trailer.png" onMouseOver="this.src='pictures/TrailerSelect.png'" onMouseOut="this.src='pictures/Trailer.png'" onfocussrc="pictures/TrailerSelect.png" align="top" /></xsl:when>
                         <xsl:otherwise>
                          <img src="pictures/Extra.png" onMouseOver="this.src='pictures/ExtraSelect.png'" onMouseOut="this.src='pictures/Extra.png'" onfocussrc="pictures/ExtraSelect.png" align="top" />
                         </xsl:otherwise>
                        </xsl:choose>
                       </xsl:otherwise>
                      </xsl:choose>
                     </xsl:otherwise>
                    </xsl:choose>
                   </xsl:otherwise>
                  </xsl:choose>
                 </xsl:otherwise>
                </xsl:choose>
               </xsl:otherwise>
              </xsl:choose>
           </a>
           <xsl:choose>
            <xsl:when test="contains(@title,'TRAILER')"><xsl:variable name="trlrafter" select="substring-after(.,'TRAILER%5D.')"/><xsl:variable name="trlrbefore" select="substring-before($trlrafter,'.mov')"/><xsl:value-of select="$trlrbefore"/></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(@title,'Extra')">
               <xsl:if test="contains(@title,'Extra - ')"><xsl:variable name="titleAfter" select="substring-after(@title,'Extra - ')"/><xsl:value-of select="$titleAfter"/></xsl:if>
               <xsl:if test="contains(@title,'Extra-')"><xsl:variable name="titleAfter" select="substring-after(@title,'Extra-')"/><xsl:value-of select="$titleAfter"/></xsl:if>
              </xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(@title,'Short')">
                 <xsl:if test="contains(@title,'Short - ')"><xsl:variable name="titleAfter" select="substring-after(@title,'Short - ')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                 <xsl:if test="contains(@title,'Short-')"><xsl:variable name="titleAfter" select="substring-after(@title,'Short-')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                </xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(@title,'Bonus')">
                   <xsl:if test="contains(@title,'Bonus - ')"><xsl:variable name="titleAfter" select="substring-after(@title,'Bonus - ')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                   <xsl:if test="contains(@title,'Bonus-')"><xsl:variable name="titleAfter" select="substring-after(@title,'Bonus-')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                  </xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(@title,'Trailer')">
                     <xsl:if test="contains(@title,'Trailer - ')"><xsl:variable name="titleAfter" select="substring-after(@title,'Trailer - ')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                     <xsl:if test="contains(@title,'Trailer-')"><xsl:variable name="titleAfter" select="substring-after(@title,'Trailer-')"/><xsl:value-of select="$titleAfter"/></xsl:if>
                    </xsl:when>
                    <xsl:otherwise>
                     <xsl:value-of select="@title"/>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise>
             </xsl:choose>
            </xsl:otherwise>
           </xsl:choose>
          </div>
         </xsl:for-each>
 </xsl:template>

 <xsl:template name="playsing">
           <a class="link">
            <xsl:attribute name="href"><xsl:value-of select="//files/file/fileURL" /></xsl:attribute>                     
            <xsl:if test="substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.ISO' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.iso'">
             <xsl:attribute name="zcd">2</xsl:attribute> 
            </xsl:if>
            <xsl:if test="substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.IMG' or substring(//files/file/fileURL,string-length(//files/file/fileURL)-3,4) = '.img'">
             <xsl:attribute name="zcd">2</xsl:attribute> 
            </xsl:if>
            <xsl:if test="substring(//files/file/fileURL,string-length(//files/file/fileURL)-7,8) = 'VIDEO_TS'">
             <xsl:attribute name="zcd">2</xsl:attribute> 
            </xsl:if>
            <xsl:attribute name="vod"/>               
            <xsl:attribute name="TVID">Play</xsl:attribute>
            <xsl:attribute name="name">Play</xsl:attribute>
            <xsl:if test="//movie/prebuf != '-1'">
             <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
            </xsl:if>
            <img src="pictures/MainNavCenter.png">
             <xsl:attribute name="onmouseover">this.src='pictures/MainNavCenterSelect.png'</xsl:attribute>
             <xsl:attribute name="onmouseout">this.src='pictures/MainNavCenter.png'</xsl:attribute>
             <xsl:attribute name="onfocussrc">pictures/MainNavCenterSelect.png</xsl:attribute>
            </img>
           </a>
 </xsl:template>

 <xsl:template name="playmult">
           <a class="link">
            <xsl:attribute name="href"><xsl:value-of select="concat(/details/movie/baseFilename,'.playlist.jsp')" /></xsl:attribute>
            <xsl:attribute name="vod">playlist</xsl:attribute>
            <xsl:attribute name="TVID">Play</xsl:attribute>
            <xsl:attribute name="name">Play</xsl:attribute>
            <xsl:if test="//movie/prebuf != '-1'">
             <xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
            </xsl:if>
            <img src="pictures/MainNavCenter.png">
             <xsl:attribute name="onmouseover">this.src='pictures/MainNavCenterSelect.png'</xsl:attribute>
             <xsl:attribute name="onmouseout">this.src='pictures/MainNavCenter.png'</xsl:attribute>
             <xsl:attribute name="onfocussrc">pictures/MainNavCenterSelect.png</xsl:attribute>
            </img>
           </a>
 </xsl:template>
 
 <xsl:template name="certification">
         <xsl:choose>
          <xsl:when test="/details/movie/certification = 'R' or /details/movie/certification = 'PG' or /details/movie/certification = 'PG-13' or /details/movie/certification = 'G' or /details/movie/certification = 'NC-17' or /details/movie/certification = 'TV-14' or /details/movie/certification = 'TV-G' or /details/movie/certification = 'TV-MA' or /details/movie/certification = 'TV-PG' or /details/movie/certification = 'TV-Y' or /details/movie/certification = 'TV-Y7' or /details/movie/certification = 'TV-Y7FV' or /details/movie/certification = '12' or /details/movie/certification = '12A' or /details/movie/certification = '15' or /details/movie/certification = '18' or /details/movie/certification = 'PG' or /details/movie/certification = 'U' or /details/movie/certification = 'X' or /details/movie/certification = '0' or /details/movie/certification = '6' or /details/movie/certification = '12' or /details/movie/certification = '16' or /details/movie/certification = '18' or /details/movie/certification = 'o.Al.' or /details/movie/certification = 'M' or /details/movie/certification = 'MA'">
           <xsl:if test="/details/movie/certification = 'R'"><img src="pictures/certificates/mpaa_r.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'PG'"><img src="pictures/certificates/mpaa_pg.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'PG-13'"><img src="pictures/certificates/mpaa_pg13.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'G'"><img src="pictures/certificates/mpaa_g.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'NC-17'"><img src="pictures/certificates/mpaa_nc17.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-14'"><img src="pictures/certificates/tv_14.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-G'"><img src="pictures/certificates/tv_g.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-MA'"><img src="pictures/certificates/tv_ma.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-PG'"><img src="pictures/certificates/tv_pg.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-Y'"><img src="pictures/certificates/tv_y.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-Y7'"><img src="pictures/certificates/tv_y7.png" /></xsl:if>
           <xsl:if test="/details/movie/certification = 'TV-Y7FV'"><img src="pictures/certificates/tv_y7fv.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '12'"><img src="pictures/certificates/bbfc_12.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '12A'"><img src="pictures/certificates/bbfc_12a.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '15'"><img src="pictures/certificates/bbfc_15.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '18'"><img src="pictures/certificates/bbfc_18.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = 'U'"><img src="pictures/certificates/bbfc_u.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = 'X'"><img src="pictures/certificates/bbfc_x.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '0'"><img src="pictures/certificates/fsk_0.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = 'o.Al.'"><img src="pictures/certificates/fsk_0.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '6'"><img src="pictures/certificates/fsk_6.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = '16'"><img src="pictures/certificates/fsk_16.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = 'M'"><img src="pictures/certificates/oflc_m.png" /></xsl:if>
		   <xsl:if test="/details/movie/certification = 'MA'"><img src="pictures/certificates/oflc_ma.png" /></xsl:if>
          </xsl:when>
          <xsl:otherwise>
           <img src="pictures/certificates/mpaa_nr.png" />
          </xsl:otherwise>
         </xsl:choose>

 </xsl:template>
 
<xsl:template name="studio">

           <xsl:choose>
            <xsl:when test="contains(company,'Fox')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/20thcenturyfox.png</xsl:attribute></img></xsl:when>
            <xsl:otherwise> 

			<xsl:choose>
              <xsl:when test="contains(company,'Artisan')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/artisan.png</xsl:attribute></img></xsl:when>
              <xsl:otherwise>

			  <xsl:choose>
                <xsl:when test="contains(company,'Carolco')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/carolco.png</xsl:attribute></img></xsl:when>
                <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'Castle Rock')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/castlerock.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Columbia Pictures')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/columbia.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Dimension')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/dimension.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Walt')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/disney.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'DreamWorks')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/dreamworks.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'FilmFour')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/filmfour.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Gaumont')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/gaumont.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Hollywood Pictures')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/hollywood.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Lionsgate')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/lionsgate.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Lucasfilm')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/lucasfilm.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'MGM')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/mgm.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Miramax')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/miramax.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'New Line')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/newlinecinema.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Paramount')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/paramount.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Revolution Pictures')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/revolution.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Screen Gems')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/screengems.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Sony Pictures')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/sonypictures.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Studio Canal')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/studiocanal.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Touchstone')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/touchstone.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'TriStar')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/tristar.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'United Artists')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/unitedartists.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Universal')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/universal.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Warner')"><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/warner.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

					<xsl:choose>
                    <xsl:when test="not(contains(company,'Fox')) or not(contains(company,'Artisan')) or not(contains(company,'Carolco')) or not(contains(company,'Castle Rock')) or not(contains(company,'Columbia Pictures')) or not(contains(company,'Dimension')) or not(contains(company,'Walt')) or not(contains(company,'DreamWorks')) or not(contains(company,'FilmFour')) or not(contains(company,'Gaumont')) or not(contains(company,'Hollywood Pictures')) or not(contains(company,'Lionsgate')) or not(contains(company,'Lucasfilm')) or not(contains(company,'MGM')) or not(contains(company,'Miramax')) or not(contains(company,'New Line')) or not(contains(company,'Paramount')) or not(contains(company,'Revolution Pictures')) or not(contains(company,'Screen Gems')) or not(contains(company,'Sony Pictures')) or not(contains(company,'Studio Canal')) or not(contains(company,'Touchstone')) or not(contains(company,'TriStar')) or not(contains(company,'United Artists')) or not(contains(company,'Universal')) or not(contains(company,'Warner'))">
                      <!--<xsl:value-of select="studio" />--><img><xsl:attribute name="id">stulistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/studios/unknownstudio.png</xsl:attribute></img></xsl:when>
					  </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>
				   
                  </xsl:otherwise>
                 </xsl:choose>
				 
                </xsl:otherwise>
               </xsl:choose>
			   
              </xsl:otherwise>
             </xsl:choose>
			 
            </xsl:otherwise>
           </xsl:choose>
 </xsl:template>


 <xsl:template name="network">

           <xsl:choose>
            <xsl:when test="contains(company,'A&#38;E')"><img><xsl:attribute name="src">pictures/tvlogos/ae.png</xsl:attribute></img></xsl:when>
            <xsl:otherwise> 

			<xsl:choose>
              <xsl:when test="contains(company,'ABC')"><img><xsl:attribute name="src">pictures/tvlogos/abc.png</xsl:attribute></img></xsl:when>
              <xsl:otherwise>

			  <xsl:choose>
                <xsl:when test="contains(company,'AMC')"><img><xsl:attribute name="src">pictures/tvlogos/amc.png</xsl:attribute></img></xsl:when>
                <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'BBC One') or contains(company,'BBC ONE')"><img><xsl:attribute name="src">pictures/tvlogos/bbc1.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'BBC Two') or contains(company,'BBC TWO')"><img><xsl:attribute name="src">pictures/tvlogos/bbc2.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'BBC Three') or contains(company,'BBC THREE')"><img><xsl:attribute name="src">pictures/tvlogos/bbc3.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'BBC Four')"><img><xsl:attribute name="src">pictures/tvlogos/bbc4.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				<xsl:choose>
                  <xsl:when test="contains(company,'BBC')"><img><xsl:attribute name="src">pictures/tvlogos/bbc.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Bravo')"><img><xsl:attribute name="src">pictures/tvlogos/bravo.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Cartoon Network')"><img><xsl:attribute name="src">pictures/tvlogos/cartoonnetwork.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'CBS')"><img><xsl:attribute name="src">pictures/tvlogos/cbs.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Channel 4')"><img><xsl:attribute name="src">pictures/tvlogos/channel4.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'The CW')"><img><xsl:attribute name="src">pictures/tvlogos/cw.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Discovery')"><img><xsl:attribute name="src">pictures/tvlogos/discovery.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Disney')"><img><xsl:attribute name="src">pictures/tvlogos/disney.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'E!')"><img><xsl:attribute name="src">pictures/tvlogos/e.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Five') or contains(company,'five')"><img><xsl:attribute name="src">pictures/tvlogos/five.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Food Network')"><img><xsl:attribute name="src">pictures/tvlogos/foodnetwork.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'FOX')"><img><xsl:attribute name="src">pictures/tvlogos/fox.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'FX')"><img><xsl:attribute name="src">pictures/tvlogos/fx.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'HBO')"><img><xsl:attribute name="src">pictures/tvlogos/hbo.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'History')"><img><xsl:attribute name="src">pictures/tvlogos/historychannel.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'ITV')"><img><xsl:attribute name="src">pictures/tvlogos/itv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Lifetime')"><img><xsl:attribute name="src">pictures/tvlogos/lifetime.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'MTV')"><img><xsl:attribute name="src">pictures/tvlogos/mtv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'NBC')"><img><xsl:attribute name="src">pictures/tvlogos/nbc.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Nickelodeon')"><img><xsl:attribute name="src">pictures/tvlogos/nickelodeon.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'PBS')"><img><xsl:attribute name="src">pictures/tvlogos/pbs.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Showcase') or contains(company,'ShowCase')"><img><xsl:attribute name="src">pictures/tvlogos/showcase.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Showtime')"><img><xsl:attribute name="src">pictures/tvlogos/showtime.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Spike')"><img><xsl:attribute name="src">pictures/tvlogos/spike.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'SciFi')"><img><xsl:attribute name="src">pictures/tvlogos/syfy.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'TBS Japan') or contains(company,'Tokyo Broadcasting System')"><img><xsl:attribute name="src">pictures/tvlogos/tokyobroadcastingsystem.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'TBS')"><img><xsl:attribute name="src">pictures/tvlogos/tbs.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'TLC')"><img><xsl:attribute name="src">pictures/tvlogos/tlc.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'TNT')"><img><xsl:attribute name="src">pictures/tvlogos/tnt.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'TV Land')"><img><xsl:attribute name="src">pictures/tvlogos/tvland.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'USA')"><img><xsl:attribute name="src">pictures/tvlogos/usa.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'UPN')"><img><xsl:attribute name="src">pictures/tvlogos/upn.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'VH1')"><img><xsl:attribute name="src">pictures/tvlogos/vh1.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Comedy Central')"><img><xsl:attribute name="src">pictures/tvlogos/comedycentral.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'CTV')"><img><xsl:attribute name="src">pictures/tvlogos/ctv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'E4')"><img><xsl:attribute name="src">pictures/tvlogos/e4.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Rai') or contains(company,'RAI')"><img><xsl:attribute name="src">pictures/tvlogos/rai.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'Fuji')"><img><xsl:attribute name="src">pictures/tvlogos/fuji.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'NTV')"><img><xsl:attribute name="src">pictures/tvlogos/ntv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'Asahi')"><img><xsl:attribute name="src">pictures/tvlogos/tvasahi.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'TV Tokyo') or contains(company,'TV TOKYO')"><img><xsl:attribute name="src">pictures/tvlogos/tvtokyo.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'KTV')"><img><xsl:attribute name="src">pictures/tvlogos/ktv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'YTV')"><img><xsl:attribute name="src">pictures/tvlogos/ytv.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'WOWOW') or contains(company,'Wowow')"><img><xsl:attribute name="src">pictures/tvlogos/wowow.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'KBS') or contains(company,'KBS2')"><img><xsl:attribute name="src">pictures/tvlogos/kbs.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'MBC')"><img><xsl:attribute name="src">pictures/tvlogos/mbc.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'OCN')"><img><xsl:attribute name="src">pictures/tvlogos/ocn.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'SBS')"><img><xsl:attribute name="src">pictures/tvlogos/sbs.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'ARD')"><img><xsl:attribute name="src">pictures/tvlogos/ard.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					
				  <xsl:choose>
                    <xsl:when test="contains(company,'WDR')"><img><xsl:attribute name="src">pictures/tvlogos/wdr.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

				  <xsl:choose>
                    <xsl:when test="contains(company,'NHK')"><img><xsl:attribute name="src">pictures/tvlogos/nhk.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>

					<xsl:choose>
<xsl:when test="not(contains(company,'A&#38;E')) or not(contains(company,'ABC')) or not(contains(company,'AMC')) or not(contains(company,'BBC')) or not(contains(company,'Bravo')) or not(contains(company,'Cartoon Network')) or not(contains(company,'CBS')) or not(contains(company,'The CW')) or not(contains(company,'Discovery')) or not(contains(company,'Disney')) or not(contains(company,'E!')) or not(contains(company,'Food Network')) or not(contains(company,'FOX')) or not(contains(company,'FX')) or not(contains(company,'HBO')) or not(contains(company,'History')) or not(contains(company,'Lifetime')) or not(contains(company,'MTV')) or not(contains(company,'NBC')) or not(contains(company,'Nickelodeon')) or not(contains(company,'PBS')) or not(contains(company,'Showtime')) or not(contains(company,'Spike')) or not(contains(company,'SciFi')) or not(contains(company,'TBS')) or not(contains(company,'TLC')) or not(contains(company,'TNT')) or not(contains(company,'TV Land')) or not(contains(company,'USA')) or not(contains(company,'VH1')) or not(contains(company,'Comedy Central')) or not(contains(company,'BBC One')) or not(contains(company,'BBC ONE')) or not(contains(company,'BBC Two')) or not(contains(company,'BBC TWO')) or not(contains(company,'BBC Three')) or not(contains(company,'BBC THREE')) or not(contains(company,'BBC Four')) or not(contains(company,'Channel 4')) or not(contains(company,'Five')) or not(contains(company,'five')) or not(contains(company,'ITV')) or not(contains(company,'Showcase')) or not(contains(company,'ShowCase')) or not(contains(company,'CTV')) or not(contains(company,'E4')) or not(contains(company,'UPN')) or not(contains(company,'Rai')) or not(contains(company,'RAI')) or not(contains(company,'Fuji')) or not(contains(company,'NTV')) or not(contains(company,'Asahi')) or not(contains(company,'TV Tokyo')) or not(contains(company,'TV TOKYO')) or not(contains(company,'KTV')) or not(contains(company,'YTV')) or not(contains(company,'WOWOW')) or not(contains(company,'Wowow')) or not(contains(company,'KBS')) or not(contains(company,'KBS2')) or not(contains(company,'MBC')) or not(contains(company,'OCN')) or not(contains(company,'SBS')) or not(contains(company,'ARD')) or not(contains(company,'WDR')) or not(contains(company,'TBS Japan')) or not(contains(company,'Tokyo Broadcasting System'))">
                      <!--<xsl:value-of select="studio" />--><img><xsl:attribute name="src">pictures/studios/unknownstudio.png</xsl:attribute></img></xsl:when>
					  </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
					  
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>
				   
                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>

                    </xsl:otherwise>
                   </xsl:choose>
				   
                  </xsl:otherwise>
                 </xsl:choose>
				 
                </xsl:otherwise>
               </xsl:choose>
			   
              </xsl:otherwise>
             </xsl:choose>
			 
            </xsl:otherwise>
           </xsl:choose>
 </xsl:template>


 <xsl:template name="videoSourcelist">
           <xsl:choose>
            <xsl:when test="contains(videoSource,'BluRay')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_bluray.png</xsl:attribute></img></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoSource,'HDDVD')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_hddvd.png</xsl:attribute></img></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoSource,'DVD')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_dvd.png</xsl:attribute></img></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoSource,'HDTV')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_hdtv.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(videoSource,'UNKNOWN')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/unknownvideo.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
                     <xsl:choose>
                      <xsl:when test="contains(videoSource,'CAM')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_cam.png</xsl:attribute></img></xsl:when>
                      <xsl:otherwise>
                       <xsl:choose>
                        <xsl:when test="contains(videoSource,'TS')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/source_telecine.png</xsl:attribute></img></xsl:when>
                        <xsl:otherwise>
					<xsl:choose>
                    <xsl:when test="not(contains(videoSource,'BluRay')) or not(contains(videoSource,'HDDVD')) or not(contains(videoSource,'DVD')) or not(contains(videoSource,'HDTV')) or not(contains(videoSource,'UNKNOWN')) or not(contains(videoSource,'CAM')) or not(contains(videoSource,'TS'))">
                      <img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/unknownvideo.png</xsl:attribute></img></xsl:when>
					  </xsl:choose>
                        </xsl:otherwise>
                       </xsl:choose>
                      </xsl:otherwise>
                     </xsl:choose>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise> 
             </xsl:choose>
            </xsl:otherwise> 
           </xsl:choose>
 </xsl:template>
 
  <xsl:template name="videoCodeclist">
           <xsl:choose>
            <xsl:when test="contains(videoCodec,'AVC') or contains(videoCodec,'avc1')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/codec_h264.png</xsl:attribute></img></xsl:when>
            <xsl:otherwise>
             <xsl:choose>
              <xsl:when test="contains(videoCodec,'XviD')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/codec_xvid.png</xsl:attribute></img></xsl:when>
              <xsl:otherwise>
               <xsl:choose>
                <xsl:when test="contains(videoCodec,'DivX')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/codec_divx.png</xsl:attribute></img></xsl:when>
                <xsl:otherwise>
                 <xsl:choose>
                  <xsl:when test="contains(videoCodec,'MPEG')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/codec_mpeg.png</xsl:attribute></img></xsl:when>
                  <xsl:otherwise>
                   <xsl:choose>
                    <xsl:when test="contains(videoCodec,'icrosoft') or contains(videoCodec,'MICROSOFT') or contains(videoCodec,'VC-1')"><img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/codec_ms.png</xsl:attribute></img></xsl:when>
                    <xsl:otherwise>
					<xsl:choose>
                    <xsl:when test="not(contains(videoCodec,'AVC')) or not(contains(videoCodec,'avc1')) or not(contains(videoCodec,'XviD')) or not(contains(videoCodec,'DivX')) or not(contains(videoCodec,'MPEG')) or not(contains(videoCodec,'icrosoft')) or not(contains(videoCodec,'MICROSOFT')) or not(contains(videoCodec,'VC-1'))">
                      <img><xsl:attribute name="id">vidlistDVD<xsl:value-of select="position()"/></xsl:attribute><xsl:attribute name="src">pictures/flags/unknownvideo.png</xsl:attribute></img></xsl:when>
					  </xsl:choose>
                    </xsl:otherwise>
                   </xsl:choose>
                  </xsl:otherwise>
                 </xsl:choose>
                </xsl:otherwise>
               </xsl:choose>
              </xsl:otherwise>
             </xsl:choose>
            </xsl:otherwise>
           </xsl:choose>
 </xsl:template>
 
 <xsl:variable name="aeonversion">v2.10.0117</xsl:variable>
 
</xsl:stylesheet>