// {{{}}}
// {{{  function writeSongContent()  write contents to document
function writeSongContent(meth, lang)
{ var len;
  var i;
  var rowLen;

  // {{{  init
  if (lang=="e")
    // {{{  init from english tables
    { var id;
    
      len = seTab.length/sTabSize;
      for (id=0, i=0; id<len; id++, i+=sTabSize)
        {
          fileN[id]=seTab[i];
          songN[id]=seTab[i+1];
          alphN[id]=seTab[i+1];
          rubId[id]=seTab[i+2];
          fileA[id]=seTab[i+3];
        }
    }
    // }}}
  else
    // {{{  init from german tables
    { var id;
    
      len = sTab.length/sTabSize;
    
      for (id=0, i=0; id<len; id++, i+=sTabSize)
      {
        fileN[id]=sTab[i];
        songN[id]=sTab[i+1];
        alphN[id]=sTab[i+1];
        rubId[id]=sTab[i+2];
        fileA[id]=sTab[i+3];
      }
    }
    // }}}
  
  alphN.sort();
  fileN[len]= "nix";
  songN[len]= "nix";
  
  rowLen=len/4;
  // }}}
  // {{{  header
  document.write("<CENTER>");
  // {{{  english switch
  if (lang == "e")
  {
    document.write("<U><IMG SRC='flag_gb.gif'");
    document.write(" BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'>" +
                   "English</U> | ");
  }
  else
  {
    document.write("<A HREF='content.htm'><IMG SRC='flag_gb.gif'");
    document.write(" BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'>" +
                   "English</"+"A> ! " );
  }
  // }}}
  // {{{  german switch
  if (lang == "d")
  {
    document.write("<U>German<IMG SRC='flag_de.gif'");
    document.write(" BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'></U>");
  }
  else
  {
    document.write("<A HREF='inhalt.htm'>German<IMG SRC='flag_de.gif'");
    document.write(" BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'></"+"A>");
  }
  // }}}
  // {{{  up switch
  document.write("<IMG SRC='0.gif' BORDER='0' WIDTH='20' HEIGHT='15'>");
  
  if (lang == "d")
  {
    document.write("<A HREF='index.htm'>");
    document.write("<IMG SRC='arrow_up.gif' ALT='Zurück'" +
                   " BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'></"+"A><BR>");
  }
  else
  {
    document.write("<A HREF='e_index.htm'>");
    document.write("<IMG SRC='arrow_up.gif' ALT='Back'" +
                   " BORDER='0' HSPACE='5' WIDTH='22' HEIGHT='15'></"+"A><BR>");
  }
  // }}}
  document.write("</CENTER>");
  // }}}
  // {{{  start
  document.write("<TABLE BORDER='0' CELLPADDING=12 ALIGN='CENTER'>" +
                 "<TR><TD VALIGN='TOP'>");
  // }}}
  // {{{  rubrics
  {
    var row=rowLen;
  
    for (i=0, r=-1; i<len; i++)
    { var rub = rubId[i]-1;
  
      if (rub != r)
      {
        if (i > row)
        {
          document.write("</TD><TD VALIGN='TOP'>");
          row += rowLen;
        }
        document.write("<FONT SIZE='+1'>");
        if (lang == "e")
          document.write(reTab[rub]);
        else
          document.write(rTab[rub]);
        document.write("</FONT><BR>");
        r=rub;
      }
      document.write("<A HREF='" + fileN[i] + ".htm'" +
                     " NAME='" + songN[i] + "'>" + songN[i] + "</"+"A><BR>");
    }
  }
  document.write("</TD></TR><TR><TD VALIGN='TOP'>");
  // }}}
  // {{{  alphabet
  { alpha = "_ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
    var r;
    var id;
    var row=rowLen;
  
    for (i=0, r=0; i < len; i++)
    {
      var nameC=alphN[i];
      if (nameC[0] != alpha[r])
        for (r=0; r<alpha.length-1; r++)
          if (nameC[0] == alpha[r])
          {
            if (i > row)
            {
               document.write("</TD><TD VALIGN='TOP'>");
               row+=rowLen;
            }
            document.write("<H3>" + alpha[r] +"</H3>");
            break;
          }
      id=getSongId(nameC);
      document.write("<A HREF='" + fileN[id] + ".htm'> " +
                           songN[id] + " </"+"A><BR>");
    }
  }
  // }}}
  // {{{  end Paragraph
  document.write("</TD></TR></TABLE>" +
                 "<HR SIZE='5' WIDTH='100%' COLOR='#808080'>");
  // }}}
}
// }}}

