<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 -->
<style>
/*Sabish TVMod V2 - override*/
.test {color: c6cace; font-weight: normal; font-size: 32pt;!important}
#divEpisodeImgBackSabish {top: 405px; left: 20px;!important}
#divEpisodeImgSabish {top: 417px; left: 31px;!important}
#divEpisodeCertification {top: 597px; left: 161px;!important}
.tvseason {color: c6cace; font-weight: normal; font-size: 32pt;!important}
.tvyear {color: 868686; font-weight: normal; font-size: 32pt;!important}
.tveptitle {font-size:26pt; font-weight: bold; color:#FFFFFF}

.tveptitle24 {font-size:24pt; font-weight: bold; color:#FFFFFF}
.tveptitle22 {font-size:22pt; font-weight: bold; color:#FFFFFF}
.tveptitle20 {font-size:20pt; font-weight: bold; color:#FFFFFF}
.tveptitle18 {font-size:18pt; font-weight: bold; color:#FFFFFF}
.tveptitle16 {font-size:16pt; font-weight: bold; color:#FFFFFF}
.tveptitle14 {font-size:14pt; font-weight: bold; color:#FFFFFF}

.tvplot {color: ececec; font-weight: normal; font-size: 13pt;!important}
.TvLink {color: 868686; font-size: 12pt; font-weight: bold;!important}
.TvLink11 {color: 868686; font-size: 11pt; font-weight: bold;!important}
.rating {color: ffffff; font-weight: 400; font-size: 18pt;!important}

	#noNMT {  visibility: hidden;  display: none;}
	#noNMT a {  visibility: hidden;  display: none;}
</style>

<body bgproperties="fixed" bgcolor="#000000" onloadset="Play" onload="initNew()" focustext="#ffffff" FOCUSCOLOR="transparent">
<!-- <xsl:attribute name="onloadset"><xsl:value-of select="//index[@current='true']/@name"/></xsl:attribute>-->
<xsl:attribute name="onloadset">episode1</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 1 -->
<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' and $tv-number-rating != 'true'">
								<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>
  <xsl:if test="season &lt; 10">                       <td width="90"></td></xsl:if>
   <xsl:if test="(season &gt; 9) and (season &lt; 100)">                       <td width="70"></td></xsl:if>
   <xsl:if test="(season &gt; 99) and (season &lt; 1000)">                       <td width="50"></td></xsl:if>
   <xsl:if test="season &gt; 999">                       <td width="30"></td></xsl:if>
                <td align="right" valign="center" class="rating">						
			<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 test="$tv-number-rating = 'true'">&#160;(<xsl:value-of select="rating div 10" />/10)</xsl:if>
            </xsl:if>
					</td>
                 
                    
           
					
</tr>
</table>

<!-- TABLE 2 -->


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

<!-- TABLE 3 -->


<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" height="314"></td>




<td width="690" valign="top">
<table width="100%" height="314" border="0" cellspacing="0" cellpadding="0" id="episodenInfos" class="hidden">


<tr><td colspan="2" width="100%" height="74" id="episodeName" class="episodeNameSabish" valign="top" align="left">
<xsl:attribute name="class">tveptitle</xsl:attribute>&#160; </td></tr>
<tr>
<td width="320" height="240"></td>
<td width="410" id="episodeId" class="episodeID" align="left" valign="top"><xsl:attribute name="class">tvplot</xsl:attribute>&#160; </td>
</tr>

	</table>

</td>

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

<!--4eme col-->


<td width="360" 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>
<xsl:if test="position()=20">
    <xsl:attribute name="onkeydownset">21</xsl:attribute>
</xsl:if>



<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<tr>
<td height="10">
<a>

<xsl:choose>
<xsl:when test="$tv-random-episode='true'"><xsl:attribute name="class">TvLink11</xsl:attribute></xsl:when>
<xsl:otherwise><xsl:attribute name="class">TvLink</xsl:attribute></xsl:otherwise>
</xsl:choose>

             <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="id">gtPlay</xsl:attribute>
			   <xsl:attribute name="name">Play</xsl:attribute>
			  <xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:if test="$tv-random-episode='false'"><xsl:attribute name="onkeyrightset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-random-episode='true'"><xsl:attribute name="onkeyrightset">randomplay</xsl:attribute></xsl:if>
			  <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="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="$tv-random-episode='false'"><xsl:attribute name="onkeyrightset">episode1</xsl:attribute></xsl:if>
				<xsl:if test="$tv-random-episode='true'"><xsl:attribute name="onkeyrightset">randomplay</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 height="10">
			<xsl:if test="$tv-random-episode='true'">
			<a id="randomplay" name="randomplay" href="#">
			<xsl:choose>
				<xsl:when test="$tv-random-episode='true'"><xsl:attribute name="class">TvLink11</xsl:attribute></xsl:when>
				<xsl:otherwise><xsl:attribute name="class">TvLink</xsl:attribute></xsl:otherwise>
			</xsl:choose>
			<xsl:attribute name="onkeydownset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyrightset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyupset">episode1</xsl:attribute>
			  <xsl:attribute name="onkeyleftset">Play</xsl:attribute>
			<xsl:value-of select="$PlayRandomText"/></a>
			</xsl:if>
        </td>
		<td align="right" width="70">
			<table border="0" cellpadding="0" cellspacing="0"><tr><td align="right"><a href="" vod="" id="a_e_page" name="epispageCount" onfocus="" onmouseover="toggleRight()">
			<xsl:choose>
				<xsl:when test="$tv-random-episode='true'"><xsl:attribute name="class">TvLink11</xsl:attribute></xsl:when>
				<xsl:otherwise><xsl:attribute name="class">TvLink</xsl:attribute></xsl:otherwise>
			</xsl:choose>
			<span class="tabTvShow" id="pageCountNew">&#160;</span></a></td></tr></table>
		</td>
</tr>
<td width="100%" colspan="3">

    		
				<xsl:for-each select="files/file/filePlot">
					<xsl:if test="position() &lt;= 15">
						<xsl:call-template name="getEpisodeList">
							<xsl:with-param name="position" select="position()" />
						</xsl:call-template>
					</xsl:if>
                  
				</xsl:for-each>
			
           
		 </td>
         
        <!-- <td valign="top" width="80">
         
    	<a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_21"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_22" name="toleft" onfocus="toggleLeft()" onmouseover="toggleLeft()"><span class="tabTvShow" id="s_e_22"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_22"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_23" name="toright" onfocus="toggleRight()" onmouseover="toggleRight()"><span class="tabTvShow" id="s_e_23"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_23"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_24" name="toup" onfocus="clickUpNew()" onmouseover="clickUpNew()"><span class="tabTvShow" id="s_e_24"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_24"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_25" name="todown" onfocus="clickDownNew()" onmouseover="clickDownNew()"><span class="tabTvShow" id="s_e_25"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_25"/>
            
		 </td>-->
         <tr>
		 <td valign="top" width="80" colspan="3">
         
    	<a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_21"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_22" name="toleft" onfocus="toggleLeft()" onmouseover="toggleLeft()"><span class="tabTvShow" id="s_e_22"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_22"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_23" name="toright" onfocus="toggleRight()" onmouseover="toggleRight()"><span class="tabTvShow" id="s_e_23"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_23"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_24" name="toup" onfocus="clickUpNew()" onmouseover="clickUpNew()"><span class="tabTvShow" id="s_e_24"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_24"/><table border="0" cellpadding="0" cellspacing="0"><tr><td><a class="TvLink" href="#" vod="" id="a_e_25" name="todown" onfocus="clickDownNew()" onmouseover="clickDownNew()"><span class="tabTvShow" id="s_e_25"><img src="pictures/1x1.png"/>
            			</span></a></td></tr></table><a href="#" class="tabTvShow" TVID="" onclick="" id="t_e_25"/>
            
		 </td>
		 </tr>
         </tr>
		 
         </table>  		
           
  		 </td>
         </tr>
         </table>  	
         
      </td>
         </tr>
         </table>  	
             
    <a> 
	<xsl:attribute name="TVID"><xsl:value-of select="$lowlist-tvshowbutton"/></xsl:attribute>
	<xsl:attribute name="name">gt_tvshow</xsl:attribute>
	<xsl:attribute name="href">#</xsl:attribute>
	<xsl:attribute name="onclick">showSeasonInfo()</xsl:attribute>
	</a>


       				<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="308" id="episodeImgBack" class="hidden" />
      </div>
      <div id="divEpisodeImgSabish" class="abs">
	  		<img src="pictures/wall/wall/transparent.png" width="278" height="164" id="episodeImg" class="hidden" />
      </div>
	  <div id="divEpisodeCertification" class="abs">
		<xsl:if test="certification != 'UNKNOWN' and certification != '' and certification != 'Not Rated' and $lowlist-tvcertification='true'">
          <xsl:call-template name="certification" />
		  </xsl:if>
      </div>
      </xsl:if>
	  
<xsl:if test="$use-pcmenu = 'true'">
	   
<div id="noNMT">    
    <xsl:if test="season != -1">
    <a href="#" class="clickInfos" onclick="showSeasonInfo(); return false;">Season Summary</a>
    </xsl:if>
    
    <a href="#" class="clickUp" onclick="clickUpNew(); return false;">Click Up</a>
    <a href="#" class="clickDown" onclick="clickDownNew(); return false;">Click Down</a>
    <br />
    <xsl:choose>
  		<xsl:when test="season != -1">
        <a href="#" class="pageUp" onclick="toggleLeft(); return false;">Previous Page</a>
    		<a href="#" class="pageDown" onclick="toggleRight(); return false;">Next Page</a>
  		</xsl:when>
  		<xsl:otherwise>
    		<a href="#" class="pageUp" onclick="pageUp(); return false;">Previous Page</a>
    		<a href="#" class="pageDown" onclick="pageDown(); return false;">Next Page</a>
  		</xsl:otherwise>
	  </xsl:choose>
	  <br />
	  <a class="clickIndex"><xsl:attribute name="href"><xsl:value-of select="$mjb.homePage" /></xsl:attribute>Index</a>
	  <br />
	 
  </div>
 </xsl:if>
 
 </body> 

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

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