%OPTIONS%
filter="HTML Files|*.htm;*.html"
encoding="UTF8"
replace=""&gt;<->"'>"
replace="&lt;link <-><span class='pvdlink' title='pvdlink "
replace="&lt;/link&gt;<-></span>"
replace="><->&gt;"
replace="<<->&lt;"
replace="'<->&#039;"
replace="&<->&amp;"
%OPTIONS%
%HEAD%<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Script-Type" content="text/javascript">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title>Movie List ({%value=205})</title>

  <style type="text/css">
  <!--
  body
  {
    font-family:sans-serif;
    background-color:#FFFCF0;
    color:#4A3630;
  }

  #overalldata
  {
    position: absolute; top:1em; right:1em;
    padding:0px 0px 0px 0px;
    font-style:normal;
    font-weight:normal;
    font-size:0.8em;
  }
  
  h1, h2, h3, h4
  {
    font-variant:normal;
    font-style:normal;
    font-weight:normal;
    font-size:1em;
  }

  h1
  {
    font-family:sans-serif;
    color:#7A5640;
    padding:1.5em 8% 1em 8%;
    font-size:1.8em;
    font-weight:bold;
    text-align:center;
  }

  h2.title
  {
    padding:0px 0.4em 0px 0px;
    display:inline;
    font-size:1em;
    font-weight:bold;
  }

  h3.cat, div.dateadded
  {display:none;}

  abbr
  {
    text-decoration:none;
    border-bottom:none;
  }

  div.tz
  {
    display:inline;
    padding:0px 0px 0px 0px;
  }

  .tz span.year, .tz span.genre
  {font-size:0.9em;}

  .tz span.genre
  {font-style:italic;}

  .tz span.year
  {padding-right:0.4em;}

  #movies, #movies ul.episodes
  {
    margin:0px 0px 0px 0px;
    padding:0px 0px 0px 0px;
    list-style-type:none;
  }

  #movies li
  {
    border:1px solid #DED0A6;
    background-color:#F8EBDA;
    color:#4A3630;
    margin:1.7em 10% 1.7em 10%;
    padding:1em 5% 1em 5%;
    list-style-type:none;
  }
  
  #movies ul.episodes
  {display:inline;}

  #movies ul.episodes li
  {
    border:none;
    background-color:inherit;
    color:inherit;
    margin:0px 0px 0px 0px;
    padding:0px 0px 0px 0px;
    list-style-type:none;
    display:inline;
  }

  .ds
  {padding:0.4em 2% 0px 2%;}

  .tspecs
  {padding:0px 2% 0.6em 2%;}

  .ds, .tspecs
  {
    font-style:normal;
    font-size:0.8em;
    color:#6A5650;
  }

  .comment, .descr, .otitle
  {
    padding:0.3em 0px 0.3em 0px;
    font-size:0.8em
  }
  
  .otitle:before
  {
    content:"Original Title: ";
    font-weight:bold;
  }

  .info1, .info3, .info2
  {font-weight:bold;}

  a:link
  {color:#003399;}
  a:visited
  {color:#463089;}
  a:focus, a:hover, a:active
  {color:#0655FF;}
  a:visited:focus, a:visited:hover, a:visited:active
  {color:#6B41DF;}

  #menu
  {
    font-size:0.8em;
    text-align:center;
    margin:0px 0px 0px 10%;
    padding:0px 0px 0px 0.5em;
    width:24%;
    color:#7A5640;
  }

  #menu .select, #menu .sortbutton
  {
    padding-left:5%;
    text-align:left;
  }

  #menu .radiobutton
  {
    vertical-align:top;
  }

  #menu .count, #menu .sortbutton
  {
    padding-top:0.8em;
  }

  #wait
  {
    position:absolute; top:30%; left:20%;
    z-index:7;
    padding:2em 4em 2em 4em;
    text-align:center;
    border:0.3em solid #DED0A6;
    background-color:#FFFCF0;
    color:#AA0000;
    font-weight:bold;
    display:none;
  }

  #sort
  {
    position:absolute; top:23%; left:25%;
    z-index:6;
    margin-top:1em;
    padding:2em 4em 2em 4em;
    border:0.3em solid #DED0A6;
    background-color:#FFFCF0;
    display:none;
  }

  #sort .sort
  {
    font-size:0.8em;
  }

  #sort .sortinfo
  {
    font-weight:bold;
    font-size:0.8em;
  }

  @media print
  {
    body
    {
     font-size:9pt;
     font-family:Calibri, Helvetica, sans-serif;
     background-color:#FFFFFF;
     color:#000000;
    }

    h1
    {
      font-family:sans-serif;
      color:#000000;
      padding-top:0.7em;
      padding-bottom:0.7em;
      font-size:1.7em;
    }

    h2.title, .tz span.year
    {padding-right:0.3em;}

    #menu, #sort, #wait
    {display:none;}

    #movies li
    {
      border:none;
      background-color:#FFFFFF;
      color:#000000;
      margin:0px 0px 0px 0px;
      padding:0.9em 6% 0.9em 6%;
    }

    .ds, .tspecs
    {color:#000000;}

    a:link, a:visited, a:focus, a:hover, a:active, a:visited:focus, a:visited:hover, a:visited:active
    {
      color:#000000;
      text-decoration:none;
      outline:none;
    }

    h1, h2, h3, h4, div.tz, div.ds, div.tspecs
    {page-break-after:avoid;}
    div.ds, div.tspecs
    {page-break-before:avoid;}
    li.movie
    {page-break-inside:avoid;}
  }

  -->
  </style>
  <script type="text/javascript">
    function jsstyle()
    {
      var ls = document.getElementsByTagName("div")
      var i;
      for(i=ls.length-1; i>=0; i--)
      {
        if (ls[i].className=="comment" && !ls[i].firstChild)
        {ls[i].parentNode.removeChild(ls[i]);}
        else if (ls[i].className=="descr" && ls[i].childNodes.length==2 && ls[i].lastChild.data==" ")
        {ls[i].parentNode.removeChild(ls[i]);}
      }
    }
  </script>
</head>
<body onload="jsstyle()" onclick="hideall();">

  <h1>Movie List ({%value=205})</h1>
  <div id="overalldata">({%value=231}: {%value=200} movies)</div>

  <script type="text/javascript">
  <!--
   document.write('<div id="menu">')
   document.write('<form action="#" id="choosenewest">')
   document.write('<div class="select"><input type="radio" class="radiobutton" name="newest" value="all" checked onclick="showall();">&nbsp;show all entries</div>')
   document.write('<div class="select"><input type="radio" class="radiobutton" name="newest" value="25" onclick="shownewest();">&nbsp;show newest 25 entries</div>')
   document.write('</form>')
   document.write('<form action="#">')
   document.write('<div class="sortbutton"><input type="button" name="sort" value="Sort list..." onclick="isgoodclick=true; sortmenu();"></div>')
   document.write('</form>')
   document.write('</div>')
  //-->
  </script>

  <ul id="movies">
%HEAD%
    <li class="movie"><a name="mnam{%value=mid}"></a>
      <h2 class="title">{%value=title}</h2>
      <h3 class="cat">Year, Genre</h3>
      <div class="tz"><span class="year">{#StringReplace '{#StringReplace '{%value=year}' '{%value=year}' '('}{#ConditionAdd > '0' '{%value=year}' ')'}' '(0' ''}</span> <span class="genre">{#StringReplace '{%value=genre}' '{%value=genre}' '('}{#ConditionAdd <> '' '{%value=genre}' ')'}</span></div>{#StringReplace '{#ConditionAddFirst <> '' '{#ConditionAdd <> '' '{%value=origtitle}' '</div>'}' '
      <h3 class="cat">Original Title</h3>
      <div class="otitle">'}' '
      <h3 class="cat">Original Title</h3>
      <div class="otitle">{%value=title}</div>' ''}
      <h3 class="cat">Duration, Filesize</h3>
      <div class="ds"><span class="info1">Duration:</span> {%value=length format="H:MM:SS"} - <span class="info1">Filesize:</span> {%value=size}&nbsp;<abbr title="Megabyte">MB</abbr></div>
      <h3 class="cat">Video, Sound</h3>
      <div class="tspecs"><span class="info3">Video:</span> {%value=videocodec}, {%value=resolution}{#ConditionAddFirst <> '' '{%value=rip}' ', <span class="info3">Quality:</span> '} -&nbsp;<span class="info3">Language</span>: {%value=langs}</div>
      <h3 class="cat">Comments, Description</h3>
      <div class="comment">{%value=comment}</div>
      <div class="descr"><span class="info2">Description:</span> {%value=description}</div>{%value=episodes params="full" template="HTML List\episodes.ptm"}
      <h3 class="cat">Date Added</h3>
      <div class="dateadded">{%value=dateadded}</div>
    </li>
%FOOT%
  </ul>

  <script type="text/javascript">
  <!--
   var nodes = document.getElementById("movies").getElementsByTagName("span");
   var tlist = document.getElementById("movies");
   var textnd;
   var linknd;
   var sx;
   var sl;
   var i;
   var b;
   var s,v;
   var enkle;
   var ier;

   for (s=nodes.length-1; s>=0; s--)
       { // bei span mit title="pvdlink id", "pvdlink url", "pvdlink title" und "pvdlink otitle" Verknüpfung basteln
        if (nodes[s].className=="pvdlink" && (nodes[s].title.length>13 && nodes[s].title.substring(8,10)=="id" || nodes[s].title.length>14 && nodes[s].title.substring(8,11)=="url" || nodes[s].title.length>16 && tlist && nodes[s].title.substring(8,13)=="title" || nodes[s].title.length>17 && tlist && nodes[s].title.substring(8,14)=="otitle"))
           {
            enkle = nodes[s].childNodes;
            ier = "";
            for (v=0; v<enkle.length; v++)
                {
                 if (enkle[v].nodeType==3) {ier += enkle[v].data;} // Text aus span zusammenfügen
                }
            if (ier.length>0)
               {
                linknd = document.createElement("a");
                textnd = document.createTextNode(ier);
                if (nodes[s].title.charAt(8)=='i') //pvdlink id...
                {
                  ier = nodes[s].title.substring(12,nodes[s].title.length-1);
                  sl=tlist.getElementsByTagName("a");
                  b=false;
                  for (i=0; (i<sl.length && !b); i++) //link überprüfen...
                  {
                    if (sl[i].name.length>=ier.length+4 && sl[i].name.substring(4,ier.length+4) == ier)
                    {b=true;}
                  }
                  if (b)
                  {
                    ier = "#mnam" + ier;
                  }
                  else
                  {ier="";}
                  v=0;
                }
                else if (nodes[s].title.charAt(8)=='t' || nodes[s].title.charAt(8)=='o') //pvdlink title/otitle...
                {
                 ier="";
                 if (nodes[s].title.charAt(8)=='t')
                 {i=15;}
                 else
                 {i=16;}
                 sx = nodes[s].title.substring(i,nodes[s].title.length-1);
                 v=0;
                 if (nodes[s].title.charAt(8)=='t')
                 {b=true;}
                 else
                 {b=false;}
                 while (v<=1)
                 {
                   if (b)
                   {sl=tlist.getElementsByTagName("h2");}
                   else
                   {sl=tlist.getElementsByTagName("div");}
                   for (i=0; i<sl.length; i++)
                   {
                 	   if (sl[i].firstChild && (b && sl[i].className == "title" && sl[i].firstChild.data==sx || !b && sl[i].className == "otitle" && sl[i].firstChild.data==sx))
                 	   {
                 	     if (sl[i].parentNode && sl[i].parentNode.firstChild && sl[i].parentNode.firstChild.name)
                 	     {ier = "#"+ sl[i].parentNode.firstChild.name;}
                         i=sl.length+1;
                 	   }
                   }
                   if (i==sl.length && v==0) // if nothing was found search title instead of origtitle, or vice versa...
                   {
                    v=1;
                    b=(!b);
                   }
                   else
                   {v=2;}
                 }
                 v=0;
                }
                else // pvdlink url...
                {
                 ier = nodes[s].title.substring(13,nodes[s].title.length-1);
                 if (ier.charAt(0)=='"')
                 {
                  v = ier.lastIndexOf('"');
                  if (v<=1) {v=ier.length();}
                  ier = "file:///" + ier.substring(1,v);
                 }
                 else if (ier.length>1 && (ier.charAt(1)==':' || ier.charAt(1)=='|'))
                 {ier = "file:///" + ier;}
                 ier = ier.replace(/\\/g, "/");
                 ier = ier.replace(/ /g, "%20");
                }
                if (ier.length>0)
                {
                 linknd.setAttribute("href",ier);
                 linknd.appendChild(textnd);
                 nodes[s].parentNode.replaceChild(linknd, nodes[s]);
                }
               }
           }
       }

   var nw = 25;
   var cdatenum = -1; // wird erst in cdatenum gesetzt!
   var issortmenuactive = false;
   var isgoodclick = false;

   function showorhideradios()
   {
     var ls = document.getElementById("movies").getElementsByTagName("li");
     var x = 0;
     var i = 0;
     for (i=0; i<ls.length && x<=nw; i++)
     {
       if (ls[i].className == "movie") {x++;}
     }
     if (x<=nw)
     {
       ls = document.getElementById("choosenewest").style.display = "none";
     }
   }

   function getdatenum(x)
   {
     var i;
     var dstr;
     var os = x.getElementsByTagName("div");
     for (i=0; i<os.length; i++)
     {
      if (os[i].className=="dateadded")
      {
        if (os[i].firstChild.data.length<=1 || os[i].firstChild.data.charAt(6)=='0')
        {return 0;}
        else
        {
          dstr = os[i].firstChild.data.substring(6,10);
          dstr += os[i].firstChild.data.substring(3,5);
          dstr += os[i].firstChild.data.substring(0,2);
          dstr += os[i].firstChild.data.substring(11,13);
          dstr += os[i].firstChild.data.substring(14,16);
        }
        i=os.length;
      }
     }
     return parseInt(dstr);
   }

   function numcomp(a, b) // für absteigende Sortierung
   {return b-a;}

   function setcdatenum()
   {
     var lis = document.getElementById("movies").getElementsByTagName("li");
     var i;
     ds = new Array();
     for (i=0; i<lis.length; i++)
     {
       if (lis[i].className=="movie") {ds.push(getdatenum(lis[i]));}
     }
     ds.sort(numcomp);
     if (ds.length>=nw)
     {cdatenum=ds[nw-1];}
     else if (ds.length>0)
     {cdatenum=ds[ds.length-1];}
     else
     {cdatenum=0;}
     ds.splice(0,ds.length); // free memory
   }

   function hideall()
   {
     var t=setTimeout("hideallx();",10);
   }

   function hideallx()
   {
     if (isgoodclick)
     {
       isgoodclick = false;
       return;
     }
     else
     {
       if (issortmenuactive) {sortmenu();}
     }
   }

   function showallx()
   {
     var i;
     var lis = document.getElementById("movies").getElementsByTagName("li");
     var parent = document.getElementById("movies").parentNode;
     var ul = document.createElement("ul");
     xs = new Array();
     siz=lis.length;
     var sizmod=0;
     for (var i=siz-1; i>=0; i--)
     {
       if (lis[i].className=="movie") {xs.push(lis[i]);}
       else {sizmod++;}
     }
     siz=siz-sizmod;
     parent.removeChild(document.getElementById("movies"));
     for (i=0; i<siz; i++)
     {
       xs[xs.length-1].style.display="block";
       ul.appendChild(xs.pop());
     }
     ul.id = "movies";
     parent.appendChild(ul);
     var w = document.getElementById("wait");
     if (w) {w.style.display="none";}
   }

   function showall()
   {
     var w = document.getElementById("wait");
     if (w) {w.style.display="block";}
     var t=setTimeout("showallx();",200);
   }

   function resetradios()
   {
     var radios = document.getElementById("choosenewest").getElementsByTagName("input");
     if (radios[1].checked==true || radios[0].checked==false)
     {
       radios[0].checked = true;
       radios[1].checked = false;
       showall();
     }
   }

   function shownewestx()
   {
     var i;
     var j;
     if (cdatenum<0) {setcdatenum();}
     var lis = document.getElementById("movies").getElementsByTagName("li");
     var parent = document.getElementById("movies").parentNode;
     var ul = document.createElement("ul");
     xs = new Array();
     siz=lis.length;
     var sizmod=0;
     for (var i=siz-1; i>=0; i--)
     {
       if (lis[i].className=="movie") {xs.push(lis[i]);}
       else {sizmod++;}
     }
     siz=siz-sizmod;
     parent.removeChild(document.getElementById("movies"));
     j=0;
     for (i=0; i<siz; i++)
     {
       if (getdatenum(xs[xs.length-1])<cdatenum || j>=nw)
       {
         xs[xs.length-1].style.display="none";
       }
       else 
       {j++;}
       ul.appendChild(xs.pop());
     }
     ul.id = "movies";
     parent.appendChild(ul);
     var w = document.getElementById("wait");
     if (w) {w.style.display="none";}
   }

   function shownewest()
   {
     var w = document.getElementById("wait");
     if (w) {w.style.display="block";}
     var t=setTimeout("shownewestx();",200);
   }

   function isnormalchar(c)
   {
     if ((c<'a' && c!=' ' && (c<'0' || c>'9')) || c>'z')
     {return false;}
     return true;
   }

   var nchrfrom = new Array('à','á','â','ã','ä','å','æ', 'ç','é','è','ê','ë','ï','î','ì','í','ñ','ô','ö','ò','ó','õ','ø','œ', 'û','ü','ù','ú','û','ÿ','ý','ß' ,'ž','"','#','§','$','%','&','\'','(',')','*','+',',','-','.','/',':',';','<','=','>','?','@','[','\\',']','^','_','`','´','{','|','}','~','!','¡','¢','£','¤','¥','²','³');
   var nchrchto = new Array("a","a","a","a","a","a","ae","c","e","e","e","e","i","i","i","i","n","o","o","o","o","o","o","oe","u","u","u","u","u","y","y","ss","z","!","!","!","!","!","!","!", "!","!","!","!","!","!","!","!","!","!","!","!","!","!","!","!","!", "!","!","!","!","!","!","!","!","!","!","!","c","!","!","y","2","3");

   function makenormalchar(s,i)
   {
     for (var j=0; j<nchrfrom.length; j++)
     {
       if (s.charAt(i)==nchrfrom[j])
       {return s.substr(0,i).concat(nchrchto[j].concat(s.substr(i+1)));}
     }
     return s;
   }

   function getspandata(o,cn)
   {
     spans = o.getElementsByTagName("span");
     for (var i=0; i<spans.length; i++)
     {
       if (spans[i].className==cn) {return spans[i].firstChild.data;}
     }
     return "";
   }

   function gethdata(o,cn)
   {
     h = o.getElementsByTagName("h2");
     for (var i=0; i<h.length; i++)
     {
       if (h[i].className==cn) {return h[i].firstChild.data;}
     }
     return "";
   }

   function ord(a, b)
   {
     a = a.toLowerCase();
     b = b.toLowerCase();
     var l = Math.min(a.length,b.length);
     for (var i=0; i<l; i++)
     {
       if (a.charAt(i)!=b.charAt(i))
       {
        if (!isnormalchar(a.charAt(i)))
        {a=makenormalchar(a,i);}
        if (!isnormalchar(b.charAt(i)))
        {b=makenormalchar(b,i);}
        if (a.charAt(i)>b.charAt(i)) {return 1;}
        else if (a.charAt(i)<b.charAt(i)) {return -1;}
        l = Math.min(a.length,b.length);
       }
     }
     if (a.length>b.length) {return 1;}
     else if (a.length<b.length) {return -1;}
     return 0;
   }

   function ordnewest(a, b)
   {
     var x = -ord(getspandata(a,"year"),getspandata(b,"year"));
     if (x==0) {return ord(gethdata(a,"title"),gethdata(b,"title"));}
     return x;
   }

   function ordtitle(a, b)
   {
     var x = ord(gethdata(a,"title"),gethdata(b,"title"));
     if (x==0) {return ord(getspandata(a,"year"),getspandata(b,"year"));}
     return x;
   }

   function ordnewestadded(a, b)
   {
     var x = getdatenum(a);
     var y = getdatenum(b);
     if (x>y) {return -1;}
     else if (x<y) {return 1;}
     return ordtitle(a,b);
   }

   function resortx(how)
   {
     var ls = document.getElementById("movies").getElementsByTagName("li");
     var parent = document.getElementById("movies").parentNode;
     var ul = document.createElement("ul");
     xs = new Array();
     siz=ls.length;
     var sizmod = 0;
     for (var i=0; i<siz; i++)
     {
       if (ls[i].className=="movie") {xs.push(ls[i]);}
       else {sizmod++;}
     }
     siz=siz-sizmod;
     parent.removeChild(document.getElementById("movies"));
     ul.id = "movies";
     if (how==1) {xs.sort(ordtitle);}
     else if (how==2) {xs.sort(ordnewest);}
     else if (how==3) {xs.sort(ordnewestadded);}
     xs.reverse();
     for (var i=0; i<siz; i++)
     {ul.appendChild(xs.pop());}
     parent.appendChild(ul);
     var w = document.getElementById("wait");
     if (w) {w.style.display="none";}
   }

   function resort(how)
   {
     var w = document.getElementById("sort");
     if (w)
     {
       w.style.display="none";
       issortmenuactive=false;
     }
     w = document.getElementById("wait");
     if (w) {w.style.display="block";}
     var t=setTimeout("resortx("+how+");",200);
   }

   function sortmenu()
   {
     var w = document.getElementById("sort");
     if (w)
     {
       if (!issortmenuactive)
       {
         w.style.display="block";
         issortmenuactive=true
       }
       else
       {
         w.style.display="none";
         issortmenuactive=false;
       }
     }
   }
   
   showorhideradios()
   resetradios();
   document.write('<div id="wait">')
   document.write('Rebuilding list...')
   document.write('</div>')
   document.write('<div id="sort" onclick="isgoodclick=true;">')
   document.write('<form action="#">')
   document.write('<div class="sortinfo">Sort list by...<br>&nbsp;</div>')
   document.write('<div class="sort"><input type="radio" class="radiobutton" name="newest" value="all" onclick="isgoodclick=true; resort(1);">&nbsp;Title (alphabetical)</div>')
   document.write('<div class="sort"><input type="radio" class="radiobutton" name="newest" value="25" onclick="isgoodclick=true; resort(2);">&nbsp;Year (newest first)</div>')
   document.write('<div class="sort"><input type="radio" class="radiobutton" name="newest" value="25" onclick="isgoodclick=true; resort(3);">&nbsp;Date added (newest first)</div>')
   document.write('</form>')
   document.write('</div>')

  // End -->
  </script>
</body>
</html>%FOOT%
