//
// Datenbank / Live 2006
// © Andreas Dost 2002-2008
//
// weitere Stammdaten / Funktionen in spiele.js
//
// Achtung 2008 spezifisch
//

//Spielnummer Botschaftstunier (-1) 2008
spnr_hf1    = 52;
spnr_hf2    = 53; 
spnr_platz  = 54;
spnr_finale = 55;
//Spielnummer Sponsorencup (-1) 2008
spnr_hf1_s    = 12;
spnr_hf2_s    = 13; 
spnr_platz_s  = 14;
spnr_finale_s = 15;

// in liveergebnis_b.js
// l_sp = new Array(      1,      2,      3,      4,      5,      6,      7,      8,      9,     10,     11,     12,     13,     14,     15,     16,     17,     18,     19,     20,     21,     22,     23,     24,     25,     26,     27,     28,     29,     30,     31,     32,     33,     34,     35,     36,     37,     38,     39,     40,     41,     42,     43,     44,     45,     46,     47,     48,     49,     50,     51,     52,     53,     54);
// l_th = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");
// l_ta = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");

// 2007 59 Spiele Botschaftsturnier
//siko_th = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");
//siko_ta = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");

// 2008 56 Spiele Botschaftsturnier
siko_th = new Array(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ");
siko_ta = new Array(" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ");

// 2008 SponsorenCup 16 Spiele
siko_spon_th = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");
siko_spon_ta = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");

// in liveergebnis_t.js
// l_trad_sp = new Array(      1,      2,      3,      4,      5,      6,      7,      8,      9,     10,     11,     12,     13,     14,     15);
// l_trad_th = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");
// l_trad_ta = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");

siko_trad_th = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");
siko_trad_ta = new Array(    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ",    " ");

// in tradspiele.js
// sp_ges_spnr[0] = new Array( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69);
// sp_ges_tunr[0] = new Array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0);
// sp_ges_tusp[0] = new Array( 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44, 1, 2, 3,45,46, 4, 5, 6,47,48, 7, 8, 9,49,50,10,11,12,51,52,13,14,15,53,54);

// alles sonst in spiele.js tradspiele.js
// 2005 = 4 bei Botschaft und 0 bei Tradition

// Manuell
// livetabm_b.js
// livetabm_b2.js
// livetabm_t.js

var qualia2 = new Array(0,0,0,0);
var qualib2 = new Array(0,0,0,0);

var qualia2_s = new Array(0,0,0,0);
var qualib2_s = new Array(0,0,0,0);

var hf1 = new Array(0,0);
var hf2 = new Array(0,0);  

var hf1_s = new Array(0,0);
var hf2_s = new Array(0,0);

var platz3 = new Array(0,0);
var finale = new Array(0,0);

var platz3_s = new Array(0,0);
var finale_s = new Array(0,0);

var manuell = new Array (0,1,2,3,4,5,6,7,8);

manuell[0] = new Array (1,2,3,4,5);
manuell[1] = new Array (1,2,3,4,5);
manuell[2] = new Array (1,2,3,4,5);
manuell[3] = new Array (1,2,3,4,5);

manuell[4] = new Array (1,2,3,4);
manuell[5] = new Array (1,2,3,4);

// Traditionsturnier
manuell[6] = new Array (1,2,3,4,5,6);

// Sponsorencup
manuell[7] = new Array (1,2,3,4);
manuell[8] = new Array (1,2,3,4);

//                    A B C D I II T AS BS
var stern = new Array(0,0,0,0,0,0,0,1,1);


function opentab(adresse)
  {
  //tabelle = window.open(adresse,"Tabelle","width=1024,height=768,left=0,top=0");
  tabelle=window.open(adresse,'Tabelle','width='+screen.width+',height='+screen.height+',left=0,top=0,scrollbars=yes,dependent=no,resizable=yes,fullscreen=yes');
  tabelle.focus();
  }


function sternsetzen(welchen,anaus)
  {
  var wind = 0;
  if (welchen == "A") wind = 0;
  if (welchen == "B") wind = 1;
  if (welchen == "C") wind = 2;
  if (welchen == "D") wind = 3;
  if (welchen == "I") wind = 4;
  if (welchen == "II") wind = 5;
  if (welchen == "T") wind = 6;
  if (welchen == "AS") wind = 7;
  if (welchen == "BS") wind = 8;
  
  stern[wind] = anaus;
  }

function quali(gruppe,platz,mann)
  {
//("2. Gruppe B","1. Gruppe A","1. Gruppe D","2. Gruppe C");
//("2. Gruppe A","1. Gruppe B","1. Gruppe C","2. Gruppe D");

  if ((gruppe == "A") && (platz == 1)) qualia2[1] = mann;
  if ((gruppe == "A") && (platz == 2)) qualib2[0] = mann;
  if ((gruppe == "B") && (platz == 1)) qualib2[1] = mann;
  if ((gruppe == "B") && (platz == 2)) qualia2[0] = mann;
  if ((gruppe == "C") && (platz == 1)) qualib2[2] = mann;
  if ((gruppe == "C") && (platz == 2)) qualia2[3] = mann;
  if ((gruppe == "D") && (platz == 1)) qualia2[2] = mann;
  if ((gruppe == "D") && (platz == 2)) qualib2[3] = mann;


  if ((gruppe == "I") && (platz == 1)) hf1[0] = mann;
  if ((gruppe == "I") && (platz == 2)) hf2[0] = mann;

  if ((gruppe == "II") && (platz == 1)) hf2[1] = mann;
  if ((gruppe == "II") && (platz == 2)) hf1[1] = mann;

  if ((gruppe == "H1") && (platz == 1)) finale[0] = mann;
  if ((gruppe == "H1") && (platz == 2)) platz3[0] = mann;
  
  if ((gruppe == "H2") && (platz == 1)) finale[1] = mann;
  if ((gruppe == "H2") && (platz == 2)) platz3[1] = mann;
  
  }

function quali_spon(gruppe,platz,mann)
  {
//("2. Gruppe B","1. Gruppe A","1. Gruppe D","2. Gruppe C");
//("2. Gruppe A","1. Gruppe B","1. Gruppe C","2. Gruppe D");

  if ((gruppe == "A") && (platz == 1)) hf1_s[0] = mann;
  if ((gruppe == "A") && (platz == 2)) hf2_s[0] = mann;

  if ((gruppe == "B") && (platz == 1)) hf2_s[1] = mann;
  if ((gruppe == "B") && (platz == 2)) hf1_s[1] = mann;

  if ((gruppe == "H1") && (platz == 1)) finale_s[0] = mann;
  if ((gruppe == "H1") && (platz == 2)) platz3_s[0] = mann;
  
  if ((gruppe == "H2") && (platz == 1)) finale_s[1] = mann;
  if ((gruppe == "H2") && (platz == 2)) platz3_s[1] = mann;
  
  }

function setzemanu(gruppe)
  {

  var gefunden = 0;

  // Problem 12345 -> 54321

  if (gruppe == "A") sid=0;
  if (gruppe == "B") sid=1;
  if (gruppe == "C") sid=2;
  if (gruppe == "D") sid=3;
  if (gruppe == "I") sid=4;
  if (gruppe == "II") sid=5;
  if (gruppe == "T") sid=6;
  if (gruppe == "AS") sid=7;
  if (gruppe == "BS") sid=8;

  for (var xm = 0; xm < tabellex.length; xm++)
    {
    if (tabellex[xm][0] == 0) break;
    gefunden = 0;
    for (var xn = 0; xn < manuell[sid].length; xn++)
      {
      if (tabellex[xm][0] == manuell[sid][xn][1])
        {
        gefunden = 1;
        break;
        }
      };
    if (gefunden == 0)
      {
      alert("Fehler bei manueller Tabelle " + gruppe + " " + tabellex[xm][0] + " !");
      }
    else
      {
      // Wertigkeit drehen z.Z. maximal 6er gruppen
      tabellex[xm][9] = (manuell[sid][xn][0] - 7) * (manuell[sid][xn][0] - 7);
      }
    }

  }


function l_tabsort(von,bis,spalte)
  {

//   0,    1,  2,  3,  4,    5,     6,    7,  8    9
// mnr,anzsp,gew,une,ver,tplus,tminus,tdiff,pkt,manu

   for (var i1 = von; i1 < bis; i1++)
     {
     for (var j1 = i1 + 1; j1 < bis; j1++)
       {
       if (tabellex[j1][spalte]>tabellex[i1][spalte])
         {
	 zwischenspeicher = tabellex[j1];
	 tabellex[j1] = tabellex[i1];
	 tabellex[i1] = zwischenspeicher;
	 }
       }
     }
  };

function l_mannschaft(my)
  {
  for (var mi = 0; mi < spjahre[my]; mi++)
    {
    // Zwischenrunde
    if (sg[my][mi] == "I")
      {
      mh[my][mi] = gzwi5[0][bot4system[mi][0]];
      ma[my][mi] = gzwi5[0][bot4system[mi][1]];
      }
    // Zwischenrunde
    if (sg[my][mi] == "II")
      {
      mh[my][mi] = gzwi5[1][bot4system[mi][0]];
      ma[my][mi] = gzwi5[1][bot4system[mi][1]];
      } 
    // Halbfinale
    if (sg[my][mi] == "H1")
      {
      mh[my][mi] = hf1[0];
      ma[my][mi] = hf1[1];
      }    
    // Halbfinale
    if (sg[my][mi] == "H2")
      {
      mh[my][mi] = hf2[0];
      ma[my][mi] = hf2[1];
      }           
    // Platz3
    if (sg[my][mi] == "P")
      {
      mh[my][mi] = platz3[0];
      ma[my][mi] = platz3[1];
      }
    // Finale
    if (sg[my][mi] == "F")
      {
      mh[my][mi] = finale[0];
      ma[my][mi] = finale[1];
      }

    }
  }

function l_mannschaft_spon(my)
  {
  for (var mi = 0; mi < spon_spjahre[my]; mi++)
    {
    // Halbfinale
    if (spon_sg[my][mi] == "H1")
      {
      spon_mh[my][mi] = hf1_s[0];
      spon_ma[my][mi] = hf1_s[1];
      }    
    // Halbfinale
    if (spon_sg[my][mi] == "H2")
      {
      spon_mh[my][mi] = hf2_s[0];
      spon_ma[my][mi] = hf2_s[1];
      }           
    // Platz3
    if (spon_sg[my][mi] == "P")
      {
      spon_mh[my][mi] = platz3_s[0];
      spon_ma[my][mi] = platz3_s[1];
      }
    // Finale
    if (spon_sg[my][mi] == "F")
      {
      spon_mh[my][mi] = finale_s[0];
      spon_ma[my][mi] = finale_s[1];
      }
    }
  }


function l_tabelle(my,gruppe,ausgabe,mitintnr,livex)
  {

  var summespiele = 0;

  tabellex = new Array(6);
  for (var xi = 0; xi < tabellex.length; xi++)
    tabellex[xi] = new Array(10);
  for (var xi = 0; xi < tabellex.length; xi++)
    for (var xy = 0; xy < 10; xy++)
      tabellex[xi][xy] = 0;


  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  if (livex == 1)
    {

    for (var mi = 0; mi < spjahre[my]; mi++)
      {
      siko_th[mi] = th[my][mi];
      siko_ta[mi] = ta[my][mi];
      th[my][mi] = l_th[mi];
      ta[my][mi] = l_ta[mi];

      // Zwischenrunde
      if (sg[my][mi] == "I")
        {
        mh[my][mi] = gzwi5[0][bot4system[mi][0]];
        ma[my][mi] = gzwi5[0][bot4system[mi][1]];
        }
      // Zwischenrunde
      if (sg[my][mi] == "II")
        {
        mh[my][mi] = gzwi5[1][bot4system[mi][0]];
        ma[my][mi] = gzwi5[1][bot4system[mi][1]];
        }
      // Halbfinale
      if (sg[my][mi] == "H1")
        {
        mh[my][mi] = hf1[0];
        ma[my][mi] = hf1[1];
        }    
      // Halbfinale
      if (sg[my][mi] == "H2")
        {
        mh[my][mi] = hf2[0];
        ma[my][mi] = hf2[1];
        }
      // Platz3
      if (sg[my][mi] == "P")
        {
        mh[my][mi] = platz3[0];
        ma[my][mi] = platz3[1];
        }
      // Finale
      if (sg[my][mi] == "F")
        {
        mh[my][mi] = finale[0];
        ma[my][mi] = finale[1];
        }

      }
    }


  for (var mi = 0; mi < spjahre[my]; mi++)
    {
     // hat Spiel schon stattgefunden
     torh = parseInt(th[my][mi]);
     tora = parseInt(ta[my][mi]);

     // richtige Gruppe

     if (sg[my][mi] == gruppe)
       {
       // tabellex durchsuchen nach heimmannschaft
        for (var xi = 0; xi < tabellex.length; xi++)
          {
          if (tabellex[xi][0] == 0) break;
          if (tabellex[xi][0] == mh[my][mi]) break;
          };
       tabellex[xi][0]=mh[my][mi];

       if (isNaN(torh) == false)
       {

       summespiele = summespiele + 1;

       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + torh;
       tabellex[xi][6]=tabellex[xi][6] + tora;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh > tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh < tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       } // Spiel schon stattgefunden

       // tabellex  durchsuchen nach ausmannschaft
       for (var xi = 0; xi < tabellex.length; xi++)
         {
         if (tabellex[xi][0] == 0) break;
         if (tabellex[xi][0] == ma[my][mi]) break;
         };
       tabellex[xi][0]=ma[my][mi];

       if (isNaN(torh) == false)
       {
       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + tora;
       tabellex[xi][6]=tabellex[xi][6] + torh;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh < tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh > tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       }
       } // Spiel schon stattgefunden

    }


  // sind Mannschaften schon da ?
  // z.B. A2 ist am Sonnabend ja noch gar nicht bekannt
  // kann aber schon aktuell aus A/B/C/D ausgelesen werden

  if (tabellex[0][0] != 0)
  {

  // wenn manuell gesetzt dann nach manu sortieren und fertig
  // livetabm_b.js
  // livetabm_b2.js
  // livetabm_t.js

  setzemanu(gruppe);

  // als erstes nach Pkt sortieren
  tabsort(0,tabellex.length,8);
  // jetzt alle heraussuchen, die die gleichen Pkt haben
  // diese dann nach Tordifferenz sortieren
  pktgleich = tabellex[0][8];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8])
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,7);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
      }
    }
  // die letzten können jetzt auch noch punktgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8])
        {
        tabsort(ersterind,xi,7);
        }

  // jetzt alle heraussuchen, die die gleichen Tordifferenz und die gleiche Pkt haben
  // diese dann nach Anzahl geschossener Tore sortieren sortieren
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8] || (pktgleich == tabellex[xi][8] && diffgleich != tabellex[xi][7]))
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,5);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7])
        {
        tabsort(ersterind,xi,5);
        }

  // Pkt/Diff/T+ gleich -> Spiel gegeneinander weiter
  // da sehr schwierig (z.B. bei 3 Mannschaften gehen wir hier jetzt erst mal einfach über
  // die manulle Tabelle
  // todo
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  torgleich = tabellex[0][5];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7] && torgleich == tabellex[xi][5])
      {
      letzterind = xi;
      }
    else
      {
      if (ersterind < letzterind)
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7] && tabellex[ersterind][5] == tabellex[xi -1][5])
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }


   // Pkt/Diff/T+/Spgeg gleich -> Strafstoßschiessen/manuell
   // todo  muss wahrscheinlich weiter oben gemacht werden ???
   // zwei Varianten !
   // erste ganz oben und die hier
   // erst mal wie vorher manuell


  }

  // qualiarray setzen
  // ab Anzahl Spiele (sagen wir mal 2)
  if (tabellex[0][1] > 1)
    quali(gruppe,1,tabellex[0][0]);
  if (tabellex[1][1] > 1)
    quali(gruppe,2,tabellex[1][0]);

  if (gruppe != "I" && gruppe != "II")
    {
    if ( summespiele == 10 ) sternsetzen(gruppe,1)
                        else sternsetzen(gruppe,0);
    }
  else
    {
    if ( summespiele == 6 ) sternsetzen(gruppe,1)
                       else sternsetzen(gruppe,0);
    }


  // ausgabe 0 -> komplett
  if ( ausgabe == 0)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');

/*    
 siehe Parameter 3 = 6 
    if (kurz[tabellex[xi][0]] == 'o_s')
      {
      document.write('<img src="KFlaggen/aut.gif" border="0"><img src="KFlaggen/sui.gif" border="0">');        
      }
    else
      {
      document.write('<img src="KFlaggen/xxx.gif" border="0"><img src="KFlaggen/');
      document.write(kurz[tabellex[xi][0]]);
      document.write('.gif" border="0">');
      }
*/

    document.write('<img src="KFlaggen/');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

if (mitintnr == 1)
  {
    document.write(tabellex[xi][0]);
    document.write(' ');
  }

    document.write(mann[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 1 -> Platz / mannschaft / Spiele  / Pkt
  if ( ausgabe == 1)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write(mann[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / Fahne / Kurz / Spiele  / Pkt
  if ( ausgabe == 2)
  {

  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[0] == 1)
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[1] == 1)
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "C")
  {
  if ( stern[2] == 1)
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a>')
  else
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "D")
  {
  if ( stern[3] == 1)
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a>')
  else
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "I")
  {
  if ( stern[4] == 1)
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a>')
  else
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "II")
  {
  if ( stern[5] == 1)
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a>')
  else
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }

  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write('<img src="KFlaggen/');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(kurzb[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  if ( ausgabe == 3)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="100%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_16">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_16l">&nbsp;&nbsp;');
    document.write('<img src="D_Fahnen/');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

    document.write(mann[tabellex[xi][0]]);

    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / Fahne / Mann / Spiele  / Pkt
  if ( ausgabe == 4)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="4">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[0] == 1)
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[1] == 1)
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "C")
  {
  if ( stern[2] == 1)
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a>')
  else
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "D")
  {
  if ( stern[3] == 1)
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a>')
  else
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "I")
  {
  if ( stern[4] == 1)
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a>')
  else
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "II")
  {
  if ( stern[5] == 1)
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a>')
  else
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }

  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');    
    document.write('<img src="KFlaggen/');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(mann[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / DoppelFahne / Mann / Spiele  / Pkt
  if ( ausgabe == 5)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="4">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[0] == 1)
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[1] == 1)
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "C")
  {
  if ( stern[2] == 1)
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a>')
  else
    document.write('<a href="live_ht7_tabellec.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe C</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "D")
  {
  if ( stern[3] == 1)
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a>')
  else
    document.write('<a href="live_ht7_tabelled.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe D</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "I")
  {
  if ( stern[4] == 1)
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a>')
  else
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "II")
  {
  if ( stern[5] == 1)
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a>')
  else
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }

  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');

    if (kurz[tabellex[xi][0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    document.write(mann[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 6 -> komplett -> mit zwei Fahnen
  if ( ausgabe == 6)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[tabellex[xi][0]]);
    document.write('.html">');
    if (kurz[tabellex[xi][0]] == 'o_s')
      {
      document.write('<img src="KFlaggen/aut.gif" border="0"><img src="KFlaggen/sui.gif" border="0">');        
      }
    else
      {
      document.write('<img src="KFlaggen/xxx.gif" border="0"><img src="KFlaggen/');
      document.write(kurz[tabellex[xi][0]]);
      document.write('.gif" border="0">');
      }
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

if (mitintnr == 1)
  {
    document.write(tabellex[xi][0]);
    document.write(' ');
  }

    document.write(mann[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  // hier wird die Siko wieder zurueckgesetzt
  if (livex == 1)
    {
    for (var mi = 0; mi < spjahre[my]; mi++)
      {
      th[my][mi] = siko_th[mi];
      ta[my][mi] = siko_ta[mi];
      }
    }

 }

function aushf1()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  if (stern[4] == 1 && stern[5] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf1[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[hf1[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[hf1[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_th[spnr_hf1]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf1[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[hf1[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[hf1[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_ta[spnr_hf1]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_th[spnr_hf1]);
  tora = parseInt(l_ta[spnr_hf1]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali("H1",1,hf1[0]);
      quali("H1",2,hf1[1]);      
      }
    else  
      {
      quali("H1",2,hf1[0]);
      quali("H1",1,hf1[1]);      
      }  
    }
  }  

function aushf1_mann(xfahnen)
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="2">&nbsp;');
  
  if (stern[4] == 1 && stern[5] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf1[0]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[hf1[0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[hf1[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[hf1[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }  
  
  document.write(mann[hf1[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_th[spnr_hf1]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf1[1]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[hf1[1]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[hf1[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[hf1[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    } 

  document.write(mann[hf1[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_ta[spnr_hf1]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_th[spnr_hf1]);
  tora = parseInt(l_ta[spnr_hf1]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali("H1",1,hf1[0]);
      quali("H1",2,hf1[1]);      
      }
    else  
      {
      quali("H1",2,hf1[0]);
      quali("H1",1,hf1[1]);      
      }  
    }
  }  



function aushf1_spon()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  if (stern[7] == 1 && stern[8] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf1_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf1_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[hf1_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_th[spnr_hf1_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf1_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf1_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[hf1_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_ta[spnr_hf1_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_spon_th[spnr_hf1_s]);
  tora = parseInt(l_spon_ta[spnr_hf1_s]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali_spon("H1",1,hf1_s[0]);
      quali_spon("H1",2,hf1_s[1]);      
      }
    else  
      {
      quali_spon("H1",2,hf1_s[0]);
      quali_spon("H1",1,hf1_s[1]);      
      }  
    }
  }  

function aushf1_spon_mann()
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="2">&nbsp;');
  document.write('Halbfinale');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf1_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf1_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[hf1_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_th[spnr_hf1_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf1_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf1_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[hf1_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_ta[spnr_hf1_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_spon_th[spnr_hf1_s]);
  tora = parseInt(l_spon_ta[spnr_hf1_s]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali_spon("H1",1,hf1_s[0]);
      quali_spon("H1",2,hf1_s[1]);      
      }
    else  
      {
      quali_spon("H1",2,hf1_s[0]);
      quali_spon("H1",1,hf1_s[1]);      
      }  
    }
  } 
  
function aushf2()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  if (stern[4] == 1 && stern[5] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf2[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[hf2[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[hf2[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_th[spnr_hf2]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf2[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[hf2[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[hf2[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_ta[spnr_hf2]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
 
  // hat Spiel schon stattgefunden
  torh = parseInt(l_th[spnr_hf2]);
  tora = parseInt(l_ta[spnr_hf2]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali("H2",1,hf2[0]);
      quali("H2",2,hf2[1]);      
      }
    else  
      {
      quali("H2",2,hf2[0]);
      quali("H2",1,hf2[1])      
      }  
    }
  
  }

function aushf2_mann(xfahnen)
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="2">&nbsp;');
  
  if (stern[4] == 1 && stern[5] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf2[0]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[hf2[0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[hf2[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[hf2[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }   
  
  document.write(mann[hf2[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_th[spnr_hf2]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[hf2[1]]);
  document.write('.html">');

    if (xfahnen == 2)
    {
    if (kurz[hf2[1]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[hf2[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[hf2[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }   
  
  document.write(mann[hf2[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_ta[spnr_hf2]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
 
  // hat Spiel schon stattgefunden
  torh = parseInt(l_th[spnr_hf2]);
  tora = parseInt(l_ta[spnr_hf2]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali("H2",1,hf2[0]);
      quali("H2",2,hf2[1]);      
      }
    else  
      {
      quali("H2",2,hf2[0]);
      quali("H2",1,hf2[1])      
      }  
    }
  
  }

function aushf2_spon()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  if (stern[7] == 1 && stern[8] == 1)
    document.write('Halbfinale');
  else
    document.write('Halbfinale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf2_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf2_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[hf2_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_th[spnr_hf2_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf2_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf2_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[hf2_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_ta[spnr_hf2_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_spon_th[spnr_hf2_s]);
  tora = parseInt(l_spon_ta[spnr_hf2_s]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali_spon("H2",1,hf2_s[0]);
      quali_spon("H2",2,hf2_s[1]);      
      }
    else  
      {
      quali_spon("H2",2,hf2_s[0]);
      quali_spon("H2",1,hf2_s[1]);      
      }  
    }
  }  

function aushf2_spon_mann()
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="2">&nbsp;');
  document.write('Halbfinale');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf2_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf2_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[hf2_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_th[spnr_hf2_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[hf2_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[hf2_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[hf2_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_ta[spnr_hf2_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  
  // hat Spiel schon stattgefunden
  torh = parseInt(l_spon_th[spnr_hf2_s]);
  tora = parseInt(l_spon_ta[spnr_hf2_s]);
  if (isNaN(torh) == false)
    {
    if (torh > tora) 
      {
      quali_spon("H2",1,hf2_s[0]);
      quali_spon("H2",2,hf2_s[1]);      
      }
    else  
      {
      quali_spon("H2",2,hf2_s[0]);
      quali_spon("H2",1,hf2_s[1]);      
      }  
    }
  }  

function ausplatz()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

//  if (stern[6] == 1 && stern[7] == 1)
    document.write('Platz 3');
//  else
//    document.write('Platz 3 <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[platz3[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[platz3[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[platz3[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_th[spnr_platz]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[platz3[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[platz3[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[platz3[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_ta[spnr_platz]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausplatz_mann(xfahnen)
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  document.write('Platz 3');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[platz3[0]]);
  document.write('.html">');

    if (xfahnen == 2)
    {
    if (kurz[platz3[0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[platz3[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[platz3[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
  
  document.write(mann[platz3[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_th[spnr_platz]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[platz3[1]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[platz3[1]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[platz3[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[platz3[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }  
  
  document.write(mann[platz3[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_ta[spnr_platz]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausplatz_spon()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  document.write('Platz 3');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[platz3_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[platz3_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[platz3_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_th[spnr_platz_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[platz3_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[platz3_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[platz3_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_ta[spnr_platz_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausplatz_spon_mann()
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');
  document.write('Platz 3');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[platz3_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[platz3_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[platz3_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_th[spnr_platz_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[platz3_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[platz3_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[platz3_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_ta[spnr_platz_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }
  
function ausfinale()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

//  if (stern[6] == 1 && stern[7] == 1)
    document.write('Finale');
//  else
//    document.write('Finale <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[finale[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[finale[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[finale[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_th[spnr_finale]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[finale[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(kurz[finale[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(kurzb[finale[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
   
  document.writeln(l_ta[spnr_finale]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausfinale_mann(xfahnen)
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="2">&nbsp;');

  document.write('Finale');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[finale[0]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[finale[0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[finale[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[finale[0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }  
  
  document.write(mann[finale[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_th[spnr_finale]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(kurz[finale[1]]);
  document.write('.html">');
  
    if (xfahnen == 2)
    {
    if (kurz[finale[1]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[finale[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[finale[1]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }  

  document.write(mann[finale[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
   
  document.writeln(l_ta[spnr_finale]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausfinale_spon()
  {
  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="2">&nbsp;');

  document.write('Finale');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[finale_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[finale_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[finale_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
  
  document.writeln(l_spon_th[spnr_finale_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[finale_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[finale_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(spon_kurzb[finale_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c">');
   
  document.writeln(l_spon_ta[spnr_finale_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }

function ausfinale_spon_mann()
  {
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  document.write('Finale');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[finale_s[0]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[finale_s[0]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[finale_s[0]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
  
  document.writeln(l_spon_th[spnr_finale_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_14bleft">&nbsp;&nbsp;');
  document.write('<a class="live_12r" href="');
  document.write(spon_kurz[finale_s[1]]);
  document.write('.html">');
  document.write('<img src="KFlaggen/');
  document.write(spon_kurz[finale_s[1]]);
  document.write('.gif" border="0">&nbsp;&nbsp;');
  document.write(sponmannk[finale_s[1]]);
  document.write('</a>');
  document.writeln('</td>');
  document.writeln('<td class="tab_6c" width="30">');
   
  document.writeln(l_spon_ta[spnr_finale_s]);
  
  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('</table>');
  }
  
// BTurnier Gruppen Mannschaften einzeln anzeigen
// Gruppen sind im speziellen Array gzwi5 gehalten
// zwei KFlaggen !
// wenn zwei Botschaften zusammen
function ausmanngruppe(gruppe,position)
  {

  if (gzwi5[gruppe][position] > 0)
    {
    if (kurz[gzwi5[gruppe][position]] == "o_s")
      {
      document.write('&nbsp;&nbsp;&nbsp;<img src="KFlaggen/aut.gif" border="0">&nbsp;<a href="');
      document.write(kurz[gzwi5[gruppe][position]]);
      document.write('.html">');
      document.write('<img src="KFlaggen/sui.gif" border="0">');
      document.write('</a>');
      document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
      document.write(mann[gaus5[gruppe][position]]);    
      }
    else
      {
      document.write('&nbsp;&nbsp;&nbsp;<img src="KFlaggen/xxx.gif" border="0">&nbsp;<a href="');
      document.write(kurz[gzwi5[gruppe][position]]);
      document.write('.html">');
      document.write('<img src="KFlaggen/');
      document.write(kurz[gzwi5[gruppe][position]]);
      document.write('.gif" border="0">');
      document.write('</a>');
      document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
      document.write(mann[gzwi5[gruppe][position]]);
      }
    }
  else
    {
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;<img src="KFlaggen/___.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
//    document.write(position + 1);
//    document.write('. Mannschaft');
    }
  };

function ausqualia()
  {

  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="3">&nbsp;');

  if (stern[0] == 1 && stern[1] == 1 && stern[2] == 1 && stern[3] == 1)
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I');
  else
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');


//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('</tr>');

  for (var xi = 0; xi < qualia2.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('</td>')
    document.writeln('<td class="tab_6">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[qualia2[xi]]);
    document.write('.html">');
    document.write('<img src="KFlaggen/');
    document.write(kurz[qualia2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(kurzb[qualia2[xi]]);
    document.write('</a>');
    document.writeln('</td>');
    document.write('<td class="tab_6c">');

    if ((xi == 0 && stern[1] == 1) || (xi == 1 && stern[0] == 1) || (xi == 2 && stern[3] == 1) || (xi == 3 && stern[2] == 1))
      document.write('&nbsp')
    else
      document.write('<a style="color:red;font-size:10pt;font-weight:bold;">*&nbsp;</a>');

    document.writeln('</td>');
    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

function ausqualia_mann(xfahnen)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="3">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if (stern[0] == 1 && stern[1] == 1 && stern[2] == 1 && stern[3] == 1)
    document.write('<a href="live_ht7_tabellea2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I');
  else
    document.write('<a href="live_ht7_tabellea2.html?1?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe I <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');


//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<tr>');
//  document.writeln('<td class="tab_6c">&nbsp;</td>');
//  document.writeln('<td class="tab_6c">Mannschaft</td>');
  
  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');  
  document.writeln('</tr>');

  for (var xi = 0; xi < qualia2.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');    
    document.write('<a class="live_12r" href="');
    document.write(kurz[qualia2[xi]]);
    document.write('.html">');
    
    if (xfahnen == 2)
    {
    if (kurz[qualia2[xi]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[qualia2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[qualia2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    document.write(mann[qualia2[xi]]);
    document.write('</a>');
    document.writeln('</td>');
    document.writeln('<td>&nbsp;');
    document.writeln('</td>');
    document.write('<td class="tab_6c">');

    if ((xi == 0 && stern[1] == 1) || (xi == 1 && stern[0] == 1) || (xi == 2 && stern[3] == 1) || (xi == 3 && stern[2] == 1))
      document.write('&nbsp')
    else
      document.write('<a style="color:red;font-size:10pt;font-weight:bold;">*&nbsp;</a>');

    document.writeln('</td>');
    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

function ausqualib()
  {

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="3">&nbsp;');

  if (stern[0] == 1 && stern[1] == 1 && stern[2] == 1 && stern[3] == 1)
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II');
  else
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');

  document.writeln('<tr>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('</tr>');

  for (var xi = 0; xi < qualib2.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('</td>')
    document.writeln('<td class="tab_6">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(kurz[qualib2[xi]]);
    document.write('.html">');
    document.write('<img src="KFlaggen/');
    document.write(kurz[qualib2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(kurzb[qualib2[xi]]);
    document.write('</a>');
    document.writeln('</td>');
    document.write('<td class="tab_6c">');

    if ((xi == 0 && stern[0] == 1) || (xi == 1 && stern[1] == 1) || (xi == 2 && stern[2] == 1) || (xi == 3 && stern[3] == 1))
      document.write('&nbsp')
    else
      document.write('<a style="color:red;font-size:10pt;font-weight:bold;">*&nbsp;</a>');

    document.writeln('</td>');
    document.writeln('</tr>');
    }
  document.writeln('</table>');

  }
  
function ausqualib_mann(xfahnen)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="3">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if (stern[0] == 1 && stern[1] == 1 && stern[2] == 1 && stern[3] == 1)
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II');
  else
    document.write('<a href="live_ht7_tabelleb2.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe II <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');


  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');

  document.writeln('<tr>');
//  document.writeln('<td class="tab_6c">&nbsp;</td>');
//  document.writeln('<td class="tab_6c">Mannschaft</td>');
  
  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');  
  document.writeln('</tr>');

  for (var xi = 0; xi < qualia2.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');    
    document.write('<a class="live_12r" href="');
    document.write(kurz[qualib2[xi]]);
    document.write('.html">');
    
    if (xfahnen == 2)
    {
    if (kurz[qualib2[xi]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(kurz[qualib2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    }
    else
    {
    document.write('<img src="KFlaggen/');
    document.write(kurz[qualib2[xi]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    document.write(mann[qualib2[xi]]);
    document.write('</a>');
    document.writeln('</td>');
    document.writeln('<td>&nbsp;');
    document.writeln('</td>');
    document.write('<td class="tab_6c">');

    if ((xi == 0 && stern[0] == 1) || (xi == 1 && stern[1] == 1) || (xi == 2 && stern[2] == 1) || (xi == 3 && stern[3] == 1))
      document.write('&nbsp')
    else
      document.write('<a style="color:red;font-size:10pt;font-weight:bold;">*&nbsp;</a>');

    document.writeln('</td>');
    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

//-------------------------------------------------------------------------------------------------------------

// Tabelle Traditionsturnier
function l_tabellet(my,gruppe,ausgabe,mitintnr,livex)
  {

  var summespiele = 0;

  tabellex = new Array(6);
  for (var xi = 0; xi < tabellex.length; xi++)
    tabellex[xi] = new Array(10);
  for (var xi = 0; xi < tabellex.length; xi++)
    for (var xy = 0; xy < 10; xy++)
      tabellex[xi][xy] = 0;

  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  if (livex == 1)
    {
    for (var mi = 0; mi < trad_sp[my].length; mi++)
      {
      siko_trad_th[mi] = trad_th[my][mi];
      siko_trad_ta[mi] = trad_ta[my][mi];
      trad_th[my][mi] = l_trad_th[mi];
      trad_ta[my][mi] = l_trad_ta[mi];
      }
    }


  for (var mi = 0; mi < trad_sp[my].length; mi++)
    {
     // hat Spiel schon stattgefunden
     torh = parseInt(trad_th[my][mi]);
     tora = parseInt(trad_ta[my][mi]);

     // richtige Gruppe

     if (trad_sg[my][mi] == gruppe)
       {
       // tabellex durchsuchen nach heimmannschaft
        for (var xi = 0; xi < tabellex.length; xi++)
          {
          if (tabellex[xi][0] == 0) break;
          if (tabellex[xi][0] == trad_mh[my][mi]) break;
          };
       tabellex[xi][0]=trad_mh[my][mi];

       if (isNaN(torh) == false)
       {

       summespiele = summespiele + 1;

       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + torh;
       tabellex[xi][6]=tabellex[xi][6] + tora;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh > tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh < tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       } // Spiel schon stattgefunden

       // tabellex  durchsuchen nach ausmannschaft
       for (var xi = 0; xi < tabellex.length; xi++)
         {
         if (tabellex[xi][0] == 0) break;
         if (tabellex[xi][0] == trad_ma[my][mi]) break;
         };
       tabellex[xi][0]=trad_ma[my][mi];

       if (isNaN(torh) == false)
       {
       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + tora;
       tabellex[xi][6]=tabellex[xi][6] + torh;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh < tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh > tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       }
       } // Spiel schon stattgefunden

    }


  // sind Mannschaften schon da ?
  // z.B. A2 ist am Sonnabend ja noch gar nicht bekannt
  // kann aber schon aktuell aus A/B/C/D ausgelesen werden


  if (tabellex[0][0] != 0)
  {

  // wenn manuell gesetzt dann nach manu sortieren und fertig
  // livetabm_b.js
  // livetabm_t.js

  setzemanu("T");

  // als erstes nach Pkt sortieren
  tabsort(0,tabellex.length,8);
  // jetzt alle heraussuchen, die die gleichen Pkt haben
  // diese dann nach Tordifferenz sortieren
  pktgleich = tabellex[0][8];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8])
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,7);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
      }
    }
  // die letzten können jetzt auch noch punktgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8])
        {
        tabsort(ersterind,xi,7);
        }

  // jetzt alle heraussuchen, die die gleichen Tordifferenz und die gleiche Pkt haben
  // diese dann nach Anzahl geschossener Tore sortieren sortieren
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8] || (pktgleich == tabellex[xi][8] && diffgleich != tabellex[xi][7]))
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,5);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7])
        {
        tabsort(ersterind,xi,5);
        }

  // Pkt/Diff/T+ gleich -> Spiel gegeneinander weiter
  // z.Z. einfach ueber Tabelle manuell gehen
  // todo
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  torgleich = tabellex[0][5];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7] && torgleich == tabellex[xi][5])
      {
      letzterind = xi;
      }
    else
      {
      if (ersterind < letzterind)
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7] && tabellex[ersterind][5] == tabellex[xi -1][5])
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }


   // Pkt/Diff/T+/Spgeg gleich -> Strafstoßschiessen/manuell
   // todo  muss wahrscheinlich weiter oben gemacht werden ???
   // zwei Varianten !
   // erste ganz oben und die hier
   // erst mal wie vorher manuell


  }

  if ( summespiele == 15 ) sternsetzen("T",1)
                      else sternsetzen("T",0);

  // ausgabe 0 -> komplett
  if ( ausgabe == 0)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(trad_kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write('<img src="logoverein/t_');
    document.write(trad_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
    document.write(tradmannk[tabellex[xi][0]]);
    document.writeln('</a>');
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 1 -> Platz / mannschaftkurz / Spiele  / Pkt
  if ( ausgabe == 1)
  {

  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="4">&nbsp;');

  if ( stern[6] == 1)
    document.write('<a href="live_tabellet.html" onclick="opentab(this.href); return false;">Tradition')
  else
    document.write('<a href="live_tabellet.html" onclick="opentab(this.href); return false;">Tradition <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');

  document.writeln('</td>');
  document.writeln('</tr>');


//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6c">');
    document.write('<a class="live_12r" href="');
    document.write(trad_kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write(trad_kurzb[tabellex[xi][0]]);
    document.write('</a>');
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  if ( ausgabe == 3)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="100%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_16">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_16l">&nbsp;&nbsp;');
    document.write('<img src="');
    document.write(trad_flag[tabellex[xi][0]]);
    document.write('" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

    document.write(tradmannk[tabellex[xi][0]]);

    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }


  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  // hier wird die Siko wieder zurueckgesetzt
  if (livex == 1)
    {
    for (var mi = 0; mi < trad_sp[my].length; mi++)
      {
      trad_th[my][mi] = siko_trad_th[mi];
      trad_ta[my][mi] = siko_trad_ta[mi];
      }
    }

 }




function l_tabelle_spon(my,gruppe,ausgabe,mitintnr,livex)
  {

  var summespiele = 0;

  tabellex = new Array(6);
  for (var xi = 0; xi < tabellex.length; xi++)
    tabellex[xi] = new Array(10);
  for (var xi = 0; xi < tabellex.length; xi++)
    for (var xy = 0; xy < 10; xy++)
      tabellex[xi][xy] = 0;


  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  if (livex == 1)
    {
    for (var mi = 0; mi < spon_spjahre[my]; mi++)
      {
      siko_spon_th[mi] = spon_th[my][mi];
      siko_spon_ta[mi] = spon_ta[my][mi];
      spon_th[my][mi] = l_spon_th[mi];
      spon_ta[my][mi] = l_spon_ta[mi];

      // Halbfinale
      if (spon_sg[my][mi] == "H1")
        {
        spon_mh[my][mi] = hf1_s[0];
        spon_ma[my][mi] = hf1_s[1];
        }    
      // Halbfinale
      if (spon_sg[my][mi] == "H2")
        {
        spon_mh[my][mi] = hf2_s[0];
        spon_ma[my][mi] = hf2_s[1];
        }
      // Platz3
      if (spon_sg[my][mi] == "P")
        {
        spon_mh[my][mi] = platz3_s[0];
        spon_ma[my][mi] = platz3_s[1];
        }
      // Finale
      if (spon_sg[my][mi] == "F")
        {
        spon_mh[my][mi] = finale_s[0];
        spon_ma[my][mi] = finale_s[1];
        }
      }
    }

  for (var mi = 0; mi < spon_spjahre[my]; mi++)
    {
 
     // hat Spiel schon stattgefunden
     torh = parseInt(spon_th[my][mi]);
     tora = parseInt(spon_ta[my][mi]);

     // richtige Gruppe

     if (spon_sg[my][mi] == gruppe)
       {
       // tabellex durchsuchen nach heimmannschaft
        for (var xi = 0; xi < tabellex.length; xi++)
          {
          if (tabellex[xi][0] == 0) break;
          if (tabellex[xi][0] == spon_mh[my][mi]) break;
          };
       tabellex[xi][0]=spon_mh[my][mi];

       if (isNaN(torh) == false)
       {

       summespiele = summespiele + 1;

       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + torh;
       tabellex[xi][6]=tabellex[xi][6] + tora;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh > tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh < tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       } // Spiel schon stattgefunden

       // tabellex  durchsuchen nach ausmannschaft
       for (var xi = 0; xi < tabellex.length; xi++)
         {
         if (tabellex[xi][0] == 0) break;
         if (tabellex[xi][0] == spon_ma[my][mi]) break;
         };
       tabellex[xi][0]=spon_ma[my][mi];

       if (isNaN(torh) == false)
       {
       tabellex[xi][1]=tabellex[xi][1] + 1;
       tabellex[xi][5]=tabellex[xi][5] + tora;
       tabellex[xi][6]=tabellex[xi][6] + torh;
       tabellex[xi][7]=tabellex[xi][5] - tabellex[xi][6];
       if (torh < tora)
         {
         tabellex[xi][2]=tabellex[xi][2] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 3;
         }
       if (torh == tora)
         {
         tabellex[xi][3]=tabellex[xi][3] + 1;
         tabellex[xi][8]=tabellex[xi][8] + 1;
         }
       if (torh > tora)
         {
         tabellex[xi][4]=tabellex[xi][4] + 1;
         }
       }
       } // Spiel schon stattgefunden

    }


  // sind Mannschaften schon da ?
  // z.B. A2 ist am Sonnabend ja noch gar nicht bekannt
  // kann aber schon aktuell aus A/B/C/D ausgelesen werden

  if (tabellex[0][0] != 0)
  {

  // wenn manuell gesetzt dann nach manu sortieren und fertig
  // livetabm_b.js
  // livetabm_b2.js
  // livetabm_t.js

  if (gruppe == "A")
    setzemanu("AS")
  else  
    setzemanu("BS");

  // als erstes nach Pkt sortieren
  tabsort(0,tabellex.length,8);
  // jetzt alle heraussuchen, die die gleichen Pkt haben
  // diese dann nach Tordifferenz sortieren
  pktgleich = tabellex[0][8];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8])
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,7);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
      }
    }
  // die letzten können jetzt auch noch punktgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8])
        {
        tabsort(ersterind,xi,7);
        }

  // jetzt alle heraussuchen, die die gleichen Tordifferenz und die gleiche Pkt haben
  // diese dann nach Anzahl geschossener Tore sortieren sortieren
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7])
      {
      letzterind = xi;
      }
    if (pktgleich != tabellex[xi][8] || (pktgleich == tabellex[xi][8] && diffgleich != tabellex[xi][7]))
      {
      if (ersterind < letzterind)
        {
        tabsort(ersterind,letzterind + 1,5);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7])
        {
        tabsort(ersterind,xi,5);
        }

  // Pkt/Diff/T+ gleich -> Spiel gegeneinander weiter
  // da sehr schwierig (z.B. bei 3 Mannschaften gehen wir hier jetzt erst mal einfach über
  // die manulle Tabelle
  // todo
  pktgleich = tabellex[0][8];
  diffgleich = tabellex[0][7];
  torgleich = tabellex[0][5];
  ersterind = 0;
  letzterind = 0;
  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    if (pktgleich == tabellex[xi][8] && diffgleich == tabellex[xi][7] && torgleich == tabellex[xi][5])
      {
      letzterind = xi;
      }
    else
      {
      if (ersterind < letzterind)
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }
        ersterind = xi;
        letzerind = xi;
        pktgleich = tabellex[xi][8];
        diffgleich = tabellex[xi][7];
      }
    }
  // die letzten können jetzt auch noch torgleich sein
  if (tabellex[ersterind][8] == tabellex[xi -1][8] && tabellex[ersterind][7] == tabellex[xi -1][7] && tabellex[ersterind][5] == tabellex[xi -1][5])
        {
        // Spiel(e) gegeneinander
        // hier sortieren wir einfach nach manuell
        tabsort(ersterind,letzterind + 1,9);
        }


   // Pkt/Diff/T+/Spgeg gleich -> Strafstoßschiessen/manuell
   // todo  muss wahrscheinlich weiter oben gemacht werden ???
   // zwei Varianten !
   // erste ganz oben und die hier
   // erst mal wie vorher manuell


  }

  // qualiarray setzen
  // ab Anzahl Spiele (sagen wir mal 2)
  if (tabellex[0][1] > 1)
    quali_spon(gruppe,1,tabellex[0][0]);
  if (tabellex[1][1] > 1)
    quali_spon(gruppe,2,tabellex[1][0]);

  /*
  if (gruppe != "I" && gruppe != "II")
    {
    if ( summespiele == 10 ) sternsetzen(gruppe,1)
                        else sternsetzen(gruppe,0);
    }
  else
    {
    }
  */
    
  if (gruppe == "A")
    {
    if ( summespiele == 6 ) sternsetzen("AS",1)
                       else sternsetzen("AS",0);
    }
  else  
    {
    if ( summespiele == 6 ) sternsetzen("BS",1)
                       else sternsetzen("BS",0);
    }

  // ausgabe 0 -> komplett
  if ( ausgabe == 0)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');

/*    
 siehe Parameter 3 = 6 
    if (kurz[tabellex[xi][0]] == 'o_s')
      {
      document.write('<img src="KFlaggen/aut.gif" border="0"><img src="KFlaggen/sui.gif" border="0">');        
      }
    else
      {
      document.write('<img src="KFlaggen/xxx.gif" border="0"><img src="KFlaggen/');
      document.write(kurz[tabellex[xi][0]]);
      document.write('.gif" border="0">');
      }
*/

    document.write('<img src="KFlaggen/');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

if (mitintnr == 1)
  {
    document.write(tabellex[xi][0]);
    document.write(' ');
  }

    document.write(sponmannk[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 1 -> Platz / mannschaft / Spiele  / Pkt
  if ( ausgabe == 1)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write(sponmannk[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / Fahne / Kurz / Spiele  / Pkt
  if ( ausgabe == 2)
  {

  document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<tr>');
  document.writeln('<td class="rubrik" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[7] == 1)
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[8] == 1)
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }


  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');
    document.write('<img src="KFlaggen/');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(spon_kurzb[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  if ( ausgabe == 3)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="100%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_16">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_16l">&nbsp;&nbsp;');
    document.write('<img src="D_Fahnen/');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">');
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

    document.write(sponmannk[tabellex[xi][0]]);

    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_16">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / Fahne / Mann / Spiele  / Pkt
  if ( ausgabe == 4)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="4">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[7] == 1)
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[8] == 1)
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }

  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');    
    document.write('<img src="KFlaggen/');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    document.write(sponmannk[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 2 -> Platz / DoppelFahne / Mann / Spiele  / Pkt
  if ( ausgabe == 5)
  {

  //document.writeln('<table bgcolor="#FFFFFF" width="140" border="0" cellpadding="0" cellspacing="0" class="partner" align="center" style="border:solid 1px black">');
  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="1" cellspacing="0" class="tab_12" align="center" style="border:solid 1px #FFCC66">');
  
  document.writeln('<tr>');
  //document.writeln('<td class="rubrik" colspan="4">&nbsp;');
  document.writeln('<td class="tab_14t" colspan="4">&nbsp;');

  if ( gruppe == "A")
  {
  if ( stern[7] == 1)
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a>')
  else
    document.write('<a href="live_ht7_tabellea_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe A</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }
  if ( gruppe == "B")
  {
  if ( stern[8] == 1)
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a>')
  else
    document.write('<a href="live_ht7_tabelleb_spon.html?1" class="link_14gruppe" onclick="opentab(this.href); return false;">Gruppe B</a> <a style="color:red;font-size:10pt;font-weight:bold;">*</a>');
  }

  document.writeln('</td>');
  document.writeln('</tr>');

//  document.writeln('<table border="solid 1px #FFCC66" width="140" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
//  document.writeln('<tr>');

  document.writeln('<td class="tab_6c" width="20">&nbsp;</td>');
  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">&nbsp;');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_14bleft">&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');

    if (spon_kurz[tabellex[xi][0]] == "o_s")
    {
    document.write('<img src="KFlaggen/aut.gif" border="0">&nbsp;<img src="KFlaggen/sui.gif" border="0">');
    document.write('&nbsp;&nbsp;');
    }    
    else
    {     
    document.write('<img src="KFlaggen/xxx.gif" border="0">&nbsp;<img src="KFlaggen/');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.gif" border="0">&nbsp;&nbsp;');
    }
    document.write(sponmannk[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // ausgabe 6 -> komplett -> mit zwei Fahnen
  if ( ausgabe == 6)
  {

  document.writeln('<table border="solid 1px #FFCC66" width="90%" cellpadding="0" cellspacing="0" align="center" style="border:solid 1px #FFCC66">');
  document.writeln('<tr>');

  document.writeln('<td class="tab_6c">&nbsp;</td>');
  document.writeln('<td class="tab_6c">Mannschaft</td>');
  document.writeln('<td class="tab_6c" width="30">Sp.</td>');
  document.writeln('<td class="tab_6c" width="30">gew.</td>');
  document.writeln('<td class="tab_6c" width="30">une.</td>');
  document.writeln('<td class="tab_6c" width="30">ver.</td>');
  document.writeln('<td class="tab_6c" width="30">T+</td>');
  document.writeln('<td class="tab_6c" width="30">T&minus;</td>');
  document.writeln('<td class="tab_6c" width="30">Diff.</td>');
  document.writeln('<td class="tab_6c" width="30">Pkt.</td>');

  document.writeln('</tr>');

  for (var xi = 0; xi < tabellex.length; xi++)
    {
    if (tabellex[xi][0] == 0) break;

    document.writeln('<tr>');
    document.write('<td class="tab_6c">');
    document.write(xi + 1);
    document.writeln('.</td>')
    document.writeln('<td class="tab_6">&nbsp;&nbsp;');
    document.write('<a class="live_12r" href="');
    document.write(spon_kurz[tabellex[xi][0]]);
    document.write('.html">');
    if (spon_kurz[tabellex[xi][0]] == 'o_s')
      {
      document.write('<img src="KFlaggen/aut.gif" border="0"><img src="KFlaggen/sui.gif" border="0">');        
      }
    else
      {
      document.write('<img src="KFlaggen/xxx.gif" border="0"><img src="KFlaggen/');
      document.write(spon_kurz[tabellex[xi][0]]);
      document.write('.gif" border="0">');
      }
    document.write('&nbsp;&nbsp;&nbsp;&nbsp;');

if (mitintnr == 1)
  {
    document.write(tabellex[xi][0]);
    document.write(' ');
  }

    document.write(sponmannk[tabellex[xi][0]]);
    document.write('</a>');

    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][1]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][2]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][3]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][4]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][5]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][6]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][7]);
    document.writeln('</td>');

    document.writeln('<td class="tab_6c">');
    document.writeln(tabellex[xi][8]);
    document.writeln('</td>');

    document.writeln('</tr>');
    }
  document.writeln('</table>');
  }

  // wenn live dann Daten aul l_ holen
  // ansonsten aus Statistikdaten - wenn diese schon vorhanden
  // z.B. am Tag der Zwischenrunde können Vorrundentabellen schon aus Statistikdaten
  // angezeigt werden
  // hier wird die Siko wieder zurueckgesetzt
  if (livex == 1)
    {
    for (var mi = 0; mi < spon_spjahre[my]; mi++)
      {
      spon_th[my][mi] = siko_spon_th[mi];
      spon_ta[my][mi] = siko_spon_ta[mi];
      }
    }

 }
