<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template name="tv-detail">

<!-- BEGIN TV DETAILS PAGE CODE HERE -->

<body bgproperties="fixed" bgcolor="#000000" onload="init()" focustext="#ffffff" FOCUSCOLOR="transparent" topmargin="38" leftmargin="92">
<xsl:attribute name="onloadset">episode1</xsl:attribute>
<xsl:attribute name="background">
	<xsl:if test="fanartFile!='UNKNOWN'"><xsl:value-of select="fanartFile"/></xsl:if>
	<xsl:if test="fanartFile='UNKNOWN'">pictures/detail/dummy_fanart.jpg</xsl:if>
</xsl:attribute>


<table height="656" border="0" cellspacing="0" cellpadding="0">
<xsl:if test="$tv-extras='false'"><xsl:attribute name="width">1102</xsl:attribute></xsl:if>
<xsl:if test="$tv-extras='true'"><xsl:attribute name="width">2650</xsl:attribute></xsl:if>
<tr><td height="253">

<xsl:if test="$ForComputer = 'false'">
    	<xsl:if test="$doReverseEpisodes = 'true'">
				<xsl:for-each select="files/file/filePlot">
					<xsl:sort select="position()" data-type="number" order="descending"/>
					<xsl:if test="position() &lt;= $iEpisodesPerPage">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="$doReverseEpisodes != 'true'">
				<xsl:for-each select="files/file/filePlot">
					<xsl:if test="position() &lt;= $iEpisodesPerPage">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
</xsl:if>

<xsl:if test="$ForComputer = 'true'">
<div id="computereplist">
	<table background="pictures/wall/filterbg1.png" width="635"><tr><td>
    	<xsl:if test="$doReverseEpisodes = 'true'">
				<xsl:for-each select="files/file/filePlot">
					<xsl:sort select="position()" data-type="number" order="descending"/>
					<xsl:if test="position() &lt;= $iEpisodesPerPage">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
			<xsl:if test="$doReverseEpisodes != 'true'">
				<xsl:for-each select="files/file/filePlot">
					<xsl:if test="position() &lt;= $iEpisodesPerPage">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
	</td></tr></table>
</div>
</xsl:if>

</td>

<xsl:if test="$tv-extras='true'">

<td width="1280" align="right" valign="top" rowspan="2">
	<table border="0" cellspacing="0" cellpadding="0">
	<tr><td align="right" bgcolor="Black-alpha2">
<a>
<xsl:attribute name="name">refresh</xsl:attribute>
<xsl:attribute name="onkeyleftset">last</xsl:attribute>
<xsl:attribute name="onkeyupset">last</xsl:attribute>
<xsl:attribute name="onkeydownset">list1</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="details" /></xsl:attribute>
[<xsl:value-of select="$BackToDetails"/>]
</a>
	</td></tr><tr><td>

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="Black-alpha2" valign="top"><!-- 1-28 -->
<table border="0" cellspacing="0" cellpadding="0">
      <xsl:for-each select="files/file[position()>0 and position() &lt; 29]">
		<tr><td>
			<a>
				<xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>
<!--				<xsl:if test="not(contains(//movie/container,'ISO'))">-->
				<xsl:attribute name="vod"></xsl:attribute>
				<xsl:attribute name="name">list<xsl:value-of select="position()"/></xsl:attribute>
				<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
				<xsl:if test="position()=28">
					<xsl:attribute name="onkeydownset">list29</xsl:attribute>
				</xsl:if>
				<xsl:value-of select="@firstPart"/>. 
<!--
<xsl:choose>
	<xsl:when test="@firstPart='0'">
		<xsl:if test="../../season &lt; 10">S0<xsl:value-of select="../../season"/>E00</xsl:if>
		<xsl:if test="../../season &gt; 9">S<xsl:value-of select="../../season"/>E00</xsl:if>
	</xsl:when>
	<xsl:otherwise>
-->
<xsl:choose>
    <xsl:when test="string-length(@title)&lt;25">
        <xsl:value-of select="@title"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="substring(@title,1,21)"/>...
    </xsl:otherwise>
</xsl:choose>
<!--
	</xsl:otherwise>
</xsl:choose>
-->
			</a>
		</td></tr>
      </xsl:for-each>
</table>
</td>
<xsl:if test="count(files/file/filePlot) > 28 and count(files/file/filePlot) &lt; 57"><td bgcolor="Black-alpha2" valign="top"><!-- 29-56 -->
<table border="0" cellspacing="0" cellpadding="0">
      <xsl:for-each select="files/file[position()>28 and position() &lt; 57]">
		<tr><td>
			<a>
				<xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>
				<xsl:attribute name="vod"></xsl:attribute>
				<xsl:attribute name="name">list<xsl:value-of select="position()+28"/></xsl:attribute>
				<xsl:if test="position()+28=29">
					<xsl:attribute name="onkeyupset">list28</xsl:attribute>
				</xsl:if>
				<xsl:if test="position()+28=56">
					<xsl:attribute name="onkeydownset">list57</xsl:attribute>
				</xsl:if>
				<xsl:value-of select="@firstPart"/>. 
<xsl:choose>
    <xsl:when test="string-length(@title)&lt;25">
        <xsl:value-of select="@title"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="substring(@title,1,21)"/>...
    </xsl:otherwise>
</xsl:choose>
			</a>
		</td></tr>
      </xsl:for-each>
</table>
</td></xsl:if>
<xsl:if test="count(files/file/filePlot) > 56 and count(files/file/filePlot) &lt; 85"><td bgcolor="Black-alpha2" valign="top"><!-- 57-84 -->
<table border="0" cellspacing="0" cellpadding="0">
      <xsl:for-each select="files/file[position()>56 and position() &lt; 85]">
		<tr><td width="250">
			<a>
				<xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>
				<xsl:attribute name="vod"></xsl:attribute>
				<xsl:attribute name="name">list<xsl:value-of select="position()+56"/></xsl:attribute>
				<xsl:if test="position()+56=57">
					<xsl:attribute name="onkeyupset">list56</xsl:attribute>
				</xsl:if>
				<xsl:if test="position()+56=84">
					<xsl:attribute name="onkeydownset">list85</xsl:attribute>
				</xsl:if>
				<xsl:value-of select="@firstPart"/>. 
<xsl:choose>
    <xsl:when test="string-length(@title)&lt;25">
        <xsl:value-of select="@title"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="substring(@title,1,21)"/>...
    </xsl:otherwise>
</xsl:choose>
			</a>
		</td></tr>
      </xsl:for-each>
</table>
</td></xsl:if>
<xsl:if test="count(files/file/filePlot) > 84 and count(files/file/filePlot) &lt; 113"><td bgcolor="Black-alpha2" valign="top"><!-- 85-112 -->
<table border="0" cellspacing="0" cellpadding="0">
      <xsl:for-each select="files/file[position()>84 and position() &lt; 113]">
		<tr><td width="250">
			<a>
				<xsl:attribute name="href"><xsl:value-of select="fileURL" /></xsl:attribute>
                          <xsl:call-template name="zcd">
                            <xsl:with-param name="url" select="fileURL"/>
                            <xsl:with-param name="container" select="//movie/container"/>
                          </xsl:call-template>
				<xsl:attribute name="vod"></xsl:attribute>
				<xsl:attribute name="name">list<xsl:value-of select="position()+84"/></xsl:attribute>
				<xsl:if test="position()+84=85">
					<xsl:attribute name="onkeyupset">list84</xsl:attribute>
				</xsl:if>
				<xsl:value-of select="@firstPart"/>. 
<xsl:choose>
    <xsl:when test="string-length(@title)&lt;25">
        <xsl:value-of select="@title"/>
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="substring(@title,1,21)"/>...
    </xsl:otherwise>
</xsl:choose>
			</a>
		</td></tr>
      </xsl:for-each>
</table>
</td></xsl:if>
<td valign="top" bgcolor="Black-alpha2">
		<xsl:if test="count(extras) != 0">
			   <xsl:for-each select="extras/extra"><!--[position() &lt;= 1]-->
			   <table border="0" cellspacing="0" cellpadding="0">
					<tr><td>
					<a>
						<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
						<xsl:attribute name="name">extras</xsl:attribute>
						<xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
							<xsl:call-template name="zcd">
								<xsl:with-param name="url" select="."/>
							</xsl:call-template>
								<xsl:if test="//movie/prebuf != '-1'">
									<xsl:attribute name="prebuf"><xsl:value-of select="//movie/prebuf" /></xsl:attribute>
								</xsl:if>
								<xsl:attribute name="vod"/>
							<xsl:value-of select="@title" />
						</a>
						</td></tr></table>
				</xsl:for-each>
		</xsl:if>
</td>
</tr>
</table>

	</td></tr><tr><td align="right" bgcolor="Black-alpha2">
<a>
<xsl:attribute name="name">last</xsl:attribute>
<xsl:attribute name="onkeyleftset">refresh</xsl:attribute>
<xsl:attribute name="onkeydownset">refresh</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="details" /></xsl:attribute>
[<xsl:value-of select="$BackToDetails"/>]
</a>
	</td></tr>
				</table>
</td>
</xsl:if>

</tr>
<tr>
	<td height="435">
		<table width="1102" height="435" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="250" height="435" valign="top"  align="right">
						<xsl:if test="$dim='false'"><xsl:attribute name="background">pictures/detail/tvbg-l.png</xsl:attribute></xsl:if>
						<xsl:if test="$dim='true'"><xsl:attribute name="background">pictures/dim/tvbg-l_dim.png</xsl:attribute></xsl:if>
					<table width="250" height="435" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td width="20" height="435" rowspan="3"></td>
							<td width="230" height="332" align="center" valign="bottom">
								<img width="224">
									<xsl:attribute name="src">
										<xsl:if test="$LowList='false'">
											<xsl:value-of select="thumbnail" />
										</xsl:if>
										<xsl:if test="$LowList='true'">
											<xsl:value-of select="detailPosterFile" />
										</xsl:if>
									</xsl:attribute>
								</img>
							</td>
						</tr>
						<tr>
							<td width="230" height="56" background="pictures/detail/spotlight-tv.png" align="center" valign="middle">
<xsl:call-template name="network" />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
         <xsl:if test="certification != 'UNKNOWN' and certification != '' and certification != 'Not Rated'">
          <xsl:if test="count(genres) != 0 or (runtime != 'UNKNOWN' and runtime != '')"></xsl:if>
          <xsl:call-template name="certification" />
		  </xsl:if>
							</td>
						</tr>
						<tr>
							<td height="47"></td>
						</tr>
					</table>
				</td>
				<td>
					<table height="435" border="0" cellspacing="0" cellpadding="0">
					
<xsl:if test="$dim='false'">
						<tr>
							<td height="75" width="832" align="right" valign="bottom">
								<table border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="20" valign="bottom"><img src="pictures/detail/tvdetbg-l.png"></img></td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">tvdet</xsl:attribute>
            <a>
             <xsl:if test="count(files/file/filePlot) != '1'">
              <xsl:attribute name="href">
			  <xsl:value-of select="concat(concat(concat(/details/movie/baseFilename,'.playlist'),/details/movie/files/file/@firstPart),'.jsp')" /></xsl:attribute>
              <xsl:attribute name="vod">playlist</xsl:attribute>
			   <xsl:attribute name="name">Play</xsl:attribute>
			  <xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyrightset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyupset">episode1</xsl:attribute>
				<xsl:if test="$tv-extras='false'"><xsl:attribute name="onkeyleftset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-extras='true'"><xsl:attribute name="onkeyleftset">refresh</xsl:attribute></xsl:if>
<!--			  <xsl:attribute name="onkeyupset">episode<xsl:value-of select="count(/details/movie/files/file)"/></xsl:attribute>
			  <xsl:attribute name="onkeyleftset">episode<xsl:value-of select="count(/details/movie/files/file)"/></xsl:attribute>-->
             </xsl:if>
             <xsl:if test="count(files/file/filePlot) = '1'">
              <xsl:attribute name="href"><xsl:value-of select="/details/movie/files/file/fileURL"/></xsl:attribute>
			  <xsl:attribute name="name">Play</xsl:attribute>
			  <xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyrightset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyupset">episode1</xsl:attribute>
				<xsl:if test="$tv-extras='false'"><xsl:attribute name="onkeyleftset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-extras='true'"><xsl:attribute name="onkeyleftset">refresh</xsl:attribute></xsl:if>
              <xsl:if test="//movie/container = 'ISO' or 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="//movie/container = 'IMG' or 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:if>
             <xsl:value-of select="$PlayAllText"/>
            </a>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<img src="pictures/detail/tvdiv.png"></img>
									</td>
								<xsl:if test="$ShowFilesize='true'">
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">tvdet</xsl:attribute>
										<xsl:value-of select="fileSize" />
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<img src="pictures/detail/tvdiv.png"></img>
									</td>
								</xsl:if>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">tvdet</xsl:attribute>
								<xsl:if test="season &gt; 0">S<xsl:value-of select="season" /></xsl:if>
								<xsl:if test="season = 0">Sp</xsl:if>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<img src="pictures/detail/tvdiv.png"></img>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">tvdet</xsl:attribute>
							<xsl:if test="year != 'UNKNOWN'">
							  <xsl:choose>
								<xsl:when test="year/@index != ''">
									<xsl:value-of select="year" />
								</xsl:when>
								<xsl:otherwise>
								  <xsl:value-of select="year" />
								</xsl:otherwise>
							  </xsl:choose>
							</xsl:if>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<img src="pictures/detail/tvdiv.png"></img>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">tvdet</xsl:attribute>
							<xsl:if test="count(files/file/filePlot)=1">
								<xsl:value-of select="count(files/file/filePlot)" /> Ep
							</xsl:if>
							<xsl:if test="count(files/file/filePlot)!=1">
								<xsl:value-of select="count(files/file/filePlot)" /> Eps
							</xsl:if>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<img src="pictures/detail/tvdiv.png"></img>
									</td>
									<td valign="bottom" background="pictures/detail/tvdetbg.png">
										<xsl:attribute name="class">rating</xsl:attribute>
			<xsl:if test="rating != -1">
              <xsl:if test="$star_rating = 'true'">
                <img><xsl:attribute name="src">pictures/detail/rating_tv_<xsl:value-of select="round(rating div 10)*10" />.png</xsl:attribute>
				</img>
              </xsl:if>
            </xsl:if>
              <xsl:if test="$number-rating =	'true'">&#160;(<xsl:value-of select="rating div 10" />/10)</xsl:if>
									</td>
									<td width="20" valign="bottom"><img src="pictures/detail/tvdetbg-r.png"></img></td>
									</tr></table>
							</td>
							<td width="20"></td>
						</tr>
</xsl:if>

<xsl:if test="$dim='true'">
						<tr>
							<td height="75" width="832" align="right" valign="bottom">
								<table border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="22" valign="bottom"><img src="pictures/dim/tvdetbg-l_dim.png"></img></td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">tvdet_dim</xsl:attribute>
            <a>
             <xsl:if test="count(files/file/filePlot) != '1'">
			 <xsl:attribute name="href">
			 <xsl:value-of select="concat(concat(concat(/details/movie/baseFilename,'.playlist'),/details/movie/files/file/@firstPart),'.jsp')" />
			 </xsl:attribute>
              <xsl:attribute name="vod">playlist</xsl:attribute>
			   <xsl:attribute name="name">Play</xsl:attribute>
			  <xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyrightset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyupset">episode1</xsl:attribute>
				<xsl:if test="$tv-extras='false'"><xsl:attribute name="onkeyleftset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-extras='true'"><xsl:attribute name="onkeyleftset">refresh</xsl:attribute></xsl:if>
<!--			  <xsl:attribute name="onkeyupset">episode<xsl:value-of select="count(/details/movie/files/file)"/></xsl:attribute>
			  <xsl:attribute name="onkeyleftset">episode<xsl:value-of select="count(/details/movie/files/file)"/></xsl:attribute>-->
             </xsl:if>
             <xsl:if test="count(files/file/filePlot) = '1'">
              <xsl:attribute name="href"><xsl:value-of select="/details/movie/files/file/fileURL"/></xsl:attribute>
			  <xsl:attribute name="name">Play</xsl:attribute>
			  <xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyrightset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyupset">episode1</xsl:attribute>
				<xsl:if test="$tv-extras='false'"><xsl:attribute name="onkeyleftset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-extras='true'"><xsl:attribute name="onkeyleftset">refresh</xsl:attribute></xsl:if>
              <xsl:if test="//movie/container = 'ISO' or 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="//movie/container = 'IMG' or 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:if>
             <xsl:value-of select="$PlayAllText"/>
            </a>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<img src="pictures/dim/tvdiv_dim.png"></img>
									</td>
								<xsl:if test="$ShowFilesize='true'">
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">tvdet_dim</xsl:attribute>
										<xsl:value-of select="fileSize" />
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<img src="pictures/dim/tvdiv_dim.png"></img>
									</td>
								</xsl:if>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">tvdet_dim</xsl:attribute>
								<xsl:if test="season &gt; 0">S<xsl:value-of select="season" /></xsl:if>
								<xsl:if test="season = 0">Sp</xsl:if>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<img src="pictures/dim/tvdiv_dim.png"></img>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">tvdet_dim</xsl:attribute>
							<xsl:if test="year != 'UNKNOWN'">
							  <xsl:choose>
								<xsl:when test="year/@index != ''">
									<xsl:value-of select="year" />
								</xsl:when>
								<xsl:otherwise>
								  <xsl:value-of select="year" />
								</xsl:otherwise>
							  </xsl:choose>
							</xsl:if>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<img src="pictures/dim/tvdiv_dim.png"></img>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">tvdet_dim</xsl:attribute>
							<xsl:if test="count(files/file/filePlot)=1">
								<xsl:value-of select="count(files/file/filePlot)" /> Ep
							</xsl:if>
							<xsl:if test="count(files/file/filePlot)!=1">
								<xsl:value-of select="count(files/file/filePlot)" /> Eps
							</xsl:if>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<img src="pictures/dim/tvdiv_dim.png"></img>
									</td>
									<td valign="bottom" background="pictures/dim/tvdetbg_dim.png">
										<xsl:attribute name="class">rating_dim</xsl:attribute>
			<xsl:if test="rating != -1">
              <xsl:if test="$star_rating='true'">
                <img><xsl:attribute name="src">pictures/detail/rating_<xsl:value-of select="round(rating div 10)*10" />.png</xsl:attribute>
				</img>
              </xsl:if>
            </xsl:if>
              <xsl:if test="$number-rating='true'">&#160;(<xsl:value-of select="rating div 10" />/10)</xsl:if>
									</td>
									</tr></table>
							</td>
							<td width="20" valign="bottom"><img src="pictures/dim/tvdetbg-r_dim.png"></img></td>
						</tr>
</xsl:if>
						
						<tr><td colspan="2">
							<xsl:if test="$dim='false'"><xsl:attribute name="background">pictures/detail/tvbg-r.png</xsl:attribute></xsl:if>
							<xsl:if test="$dim='true'"><xsl:attribute name="background">pictures/dim/tvbg-r_dim.png</xsl:attribute></xsl:if>

	<table width="100%" height="100%" border="0" cellspacing="15" cellpadding="0" id="episodenInfos" class="hidden"><!--background="pictures/tvbg.png"-->
		<tr>
			<td id="episodeId" class="episodeID" align="left" valign="top" height="230" width="426">
				<xsl:attribute name="class">plot</xsl:attribute>&#160; 
			</td>
			<td height="230" width="426"></td>
		</tr>
		<tr>
			<td height="95" width="852" id="episodeName" class="episodeName" align="left" colspan="2" valign="top">
				<xsl:attribute name="class">tvtt</xsl:attribute>&#160; 
			</td>
		</tr>
	</table>

						</td></tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
	

	
</tr>
</table>



      				<a>
        		    <xsl:attribute name="id">openEpisode</xsl:attribute>
        				<xsl:attribute name="TVID">Play</xsl:attribute>
        		    <xsl:attribute name="href">#</xsl:attribute>
        		    <xsl:attribute name="vod"></xsl:attribute>
        		 	</a>

        		 	<a href="#" onclick="return  toggleEpisodeDetails();" tvid="{$show-hide-episode-plot}"></a>

      <div id="plotInfo" class="abs plotInfo tabPlot">&#160;</div>

      <xsl:if test="$tooManySeries = 'true'">
        <div id="pageCount" class="abs plotInfo tabTvShow">&#160;</div>
			</xsl:if>

			<div id="episodePages" class="abs episodePages tabTvShow">&#160;</div>

      <xsl:if test="season != -1  and $mjb.includeVideoImages='true' ">
      <div class="abs">
		<xsl:if test="$ForComputer='false'">
			<xsl:attribute name="id">divEpisodeImgBack</xsl:attribute>
		</xsl:if>
		<xsl:if test="$ForComputer='true'">
			<xsl:attribute name="id">computerdivEpisodeImgBack</xsl:attribute>
		</xsl:if>
        <img src="pictures/detail/noprev.png" height="225" width="400" id="episodeImgBack" class="hidden" />
      </div>
      <div class="abs">
		<xsl:if test="$ForComputer='false'">
			<xsl:attribute name="id">divEpisodeImg</xsl:attribute>
		</xsl:if>
		<xsl:if test="$ForComputer='true'">
			<xsl:attribute name="id">computerdivEpisodeImg</xsl:attribute>
		</xsl:if>
	  		<img src="pictures/detail/noprev.png" height="225" width="400" id="episodeImg" class="hidden" />
      </div>
      </xsl:if>
	  
	<xsl:if test="$LowListOverlay='true'">
		<xsl:if test="$ForComputer='false'">
			<img src="pictures/detail/tvposteroverlay.png" id="Poster_Overlay__TV_NMT"/>
			<img src="pictures/detail/tvepoverlay.png" id="tvepoverlay"/>
		</xsl:if>
		<xsl:if test="$ForComputer='true'">
			<img src="pictures/detail/tvposteroverlay.png" id="Poster_Overlay__LowList_NMT_and_PC__TV_PC"/>
			<img src="pictures/detail/tvepoverlay.png" id="computertvepoverlay"/>
		</xsl:if>
	</xsl:if>

	<xsl:if test="$LowListOverlay='box'">
		<xsl:if test="$ForComputer='false'">
			<img>
				<xsl:choose>
					<xsl:when test="contains(videoSource,'BluRay')"><xsl:attribute name="src">pictures/boxes/bluray.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'D-THEATER')"><xsl:attribute name="src">pictures/boxes/dtheater.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'DVD')"><xsl:attribute name="src">pictures/boxes/dvd.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'HDDVD')"><xsl:attribute name="src">pictures/boxes/hddvd.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'HDTV')"><xsl:attribute name="src">pictures/boxes/hdtv.png</xsl:attribute></xsl:when>
					<xsl:otherwise><xsl:attribute name="src">pictures/boxes/tv.png</xsl:attribute></xsl:otherwise>
				</xsl:choose>
				<xsl:attribute name="id">Box_Overlay__TV_NMT</xsl:attribute>
			</img>
			<img src="pictures/detail/tvepoverlay.png" id="tvepoverlay"/>
		</xsl:if>
		<xsl:if test="$ForComputer='true'">
			<img>
				<xsl:choose>
					<xsl:when test="contains(videoSource,'BluRay')"><xsl:attribute name="src">pictures/boxes/bluray.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'D-THEATER')"><xsl:attribute name="src">pictures/boxes/dtheater.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'DVD')"><xsl:attribute name="src">pictures/boxes/dvd.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'HDDVD')"><xsl:attribute name="src">pictures/boxes/hddvd.png</xsl:attribute></xsl:when>
					<xsl:when test="contains(videoSource,'HDTV')"><xsl:attribute name="src">pictures/boxes/hdtv.png</xsl:attribute></xsl:when>
					<xsl:otherwise><xsl:attribute name="src">pictures/boxes/tv.png</xsl:attribute></xsl:otherwise>
				</xsl:choose>
				<xsl:attribute name="id">Box_Overlay__LowList_NMT_and_PC__TV_PC</xsl:attribute>
			</img>
			<img src="pictures/detail/tvepoverlay.png" id="computertvepoverlay"/>
		</xsl:if>
	</xsl:if>
	
	 </body>


<!-- END TV DETAILS PAGE CODE HERE -->

</xsl:template>
</xsl:stylesheet>