﻿// JScript-Datei

var od_akt = 0;




function get_kat(nr,od)
{
    lp = false;
    hide_tr();
    od_akt = od;
    PageMethods.get_od(nr,od_akt,get_kat_result,onError);
}

function get_kat_result(result,userContext,methodName)
{
   var head = '';
   for (var i=0;i<result[0].all;i++)
   {
     if (i == od_akt)
     {
     
       head = head + '<span class="navi_act">' + result[i].header + "</span>";
       }
       else
       {
         head = head + '<a class="navi" href ="#" onclick="get_kat(2,' + i + ')">' + result[i].header + '</a>';
       }
       if (i < result[0].all-1) head += "|";
   }
   PageMethods.get_od(result[od_akt].id,0,get_kat_plus_result,onError);
   $get("Label_player").innerHTML = head ;
   }
   
   function write_od(count,id,header,subheader,image, start, dura)
{
  var htm = '<table width="640" border="0" cellspacing="2" cellpadding="0">' +
               '<tr><td width="80" rowspan="2" valign="top">'
             + '<a href="#" onclick="set_lp(' + id + ')"><img border=\"0\" src="get_thumbnail.aspx?w=80&h=45&inummer=' + image + '" width="80" height="45"></a></td>'
             + '<td align="left" class="phdauer" width="90">&nbsp;</td><td width="402" align="left" valign="top" class="phheader">' + header + '</td>'
             + '</tr><tr><td align="left" class="phdauer">Dauer: ' + get_ms(dura) + ' Min.</td><td valign="top" class="phsubheader">' + subheader +'</td>'
             + '</tr></table>';
      
      
      return htm;                         
       
}
   
   
   function get_kat_plus_result(result,userContext,methodName)
{
   var head = '';
   head += "<br><table>";
   for (var i=0;i<result[0].all;i++)
   {
    head = head + "<tr><td>" + write_od(i,result[i].id,result[i].header,result[i].subheader,result[i].inummer,result[i].start,result[i].duration) + "</td></tr>";
   }
   head += "<br></table>";
   $get("Label_player").innerHTML += head ;
   }