<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" onloadset="Play" onload="init()" focustext="#ffffff" FOCUSCOLOR="transparent">
<xsl:attribute name="onloadset"><xsl:value-of select="//index[@current='true']/@name"/></xsl:attribute>
<xsl:attribute name="background"><xsl:value-of select="concat(baseFilename,concat($fanart.scanner.fanartToken,'.jpg'))"/></xsl:attribute>


<table height="656" width="1102" border="0" cellspacing="0" cellpadding="0" background="pictures/sabishmod/tvbg-v2.png">

<tr>
<td>


<table border="0" cellspacing="0" cellpadding="0">
<tr height="50" valign="bottom">
                <td width="18"></td>

<td width="250">
	 <img width="244" height="45">
				<xsl:choose><xsl:when test="$tv-banners-file='true'"><xsl:attribute name="src"><xsl:value-of select="bannerFile"/></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="src"><xsl:value-of select="bannerURL"/></xsl:attribute></xsl:otherwise></xsl:choose>
				<xsl:attribute name="id">banner<xsl:value-of select="position()+4"/></xsl:attribute>
				<xsl:attribute name="onmouseover">show(<xsl:value-of select="position()+4"/>)</xsl:attribute>
				<xsl:attribute name="onmouseout">hide(<xsl:value-of select="position()+4"/>)</xsl:attribute>
				<xsl:attribute name="onfocus">banner(<xsl:value-of select="position()+4"/>,'visible');</xsl:attribute>
				<xsl:attribute name="onblur">banner(<xsl:value-of select="position()+4"/>,'hidden');</xsl:attribute>
				<xsl:attribute name="onfocussrc">pictures/wall/transbanner.png</xsl:attribute>
				</img>
                </td>
                <td width="30"></td>
                 <td align="center" valign="center">
							<xsl:attribute name="class">tvseason</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 width="20"></td>

                        <td align="center" valign="center">
							<xsl:if test="year != 'UNKNOWN'">
								<xsl:attribute name="class">tvyear</xsl:attribute>
							  <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 width="50"></td>
<td valign="center">
						<xsl:if test="$ShowAudioCodec='true'"><xsl:call-template name="audioCodec" />&#160;&#160;</xsl:if>
						<xsl:if test="$ShowContainer='true'"><xsl:call-template name="container" />&#160;&#160;</xsl:if>
						<xsl:if test="$ShowVideoOutput='true'"><xsl:call-template name="videoOutput" />&#160;&#160;</xsl:if>
					</td>
                    <td width="90"></td>
                <td align="right" valign="center">						
			<xsl:if test="rating != -1">
              <xsl:if test="$star_rating = 'true'">
                <img hspace="10" vspace="6" ><xsl:attribute name="src">pictures/detail/rating_<xsl:value-of select="round(rating div 10)*10" />.png</xsl:attribute>
				</img>
              </xsl:if>
            </xsl:if>
					</td>
                 
                    
           
					
</tr>
</table>


<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="287">
</td>
</tr>
</table>

</td>
</tr>

<tr height="300">
<!--1ere col-->
<td>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="450"></td>

<!--2eme col-->

<td width="285" valign="top">

<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="episodenInfos" class="hidden">
	 <tr><td height="30" id="episodeName" class="episodeNameSabish" valign="top" align="left"><xsl:attribute name="class">multi</xsl:attribute>&#160; </td></tr>
    

		<tr><td id="episodeId" class="episodeID" align="left" valign="top" height="243"><xsl:attribute name="class">tvplot</xsl:attribute>&#160; </td></tr>

	</table>

</td>

<!--3eme col-->
<td width="20" valign="top"></td>

<!--4eme col-->


<td width="350" valign="top">

<!--list episodes-->

<xsl:variable name="iEpisodesPerPage" select="38" />

<xsl:variable name="tooManySeries">
	<xsl:choose>
		<xsl:when test="count(/details/movie/files/file/filePlot) &gt; $iEpisodesPerPage">true</xsl:when>
		<xsl:otherwise>false</xsl:otherwise>
	</xsl:choose>
</xsl:variable>




<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="50%">

    	<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;= 19">
						<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;= 19">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
            
		 </td>
         
         <td valign="top" width="50%">
         
    	<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() &gt;= 20">
						<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() &gt;= 20">
						<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>  		
           
  		 </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 plotInfoSabish tabPlot">&#160;</div>

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

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

      <xsl:if test="season != -1  and $mjb.includeVideoImages='true' ">
      <div id="divEpisodeImgBackSabish" class="abs">
        <img src="pictures/sabishmod/epi_back.png" width="430" id="episodeImgBack" class="hidden" />
      </div>
      <div id="divEpisodeImgSabish" class="abs">
	  		<img src="pictures/wall/wall/transparent.png" width="400" id="episodeImg" class="hidden" />
      </div>
 
      
      </xsl:if>

 </body>


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

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