TablaS2 = new Array("#Sub-20#v1#")

function CS2(datos){
  datos=datos.split("|")
  num=TablaS2.length
  TablaS2[num]=new DatosCS2(num,datos)
}

function DatosCS2(numero,datos){
  this.num       = numero
  this.carpeta   = datos[0]
  this.equipoa   = datos[1]
  this.golesa    = datos[2]
  this.equipob   = datos[3]
  this.golesb    = datos[4]
  this.prorroga  = datos[5]
  this.penalties = datos[6]
  this.evento    = datos[7]
  this.fecha     = datos[8]
}

function MuestraListaInformes()
{
  largoselec=TablaS2.length-1
  for(elem=1;elem<=largoselec;elem++)
  {
    titulo='<b>'+TablaS2[elem].equipoa+' - '+TablaS2[elem].equipob+'</b>'
    datos='<span class="textomini">'+TablaS2[elem].evento+'<br>'+TablaS2[elem].fecha+'<span>'
    enlace='<a href="verinforme.html?i='+elem+'">'+titulo+'</a><br>'+datos
    celda='<td align="center" width="250">'+enlace+'</td>'

    if(elem%2!=0){html='<tr>'+celda+'<td width="25">&nbsp;</td>'}
    if(elem%2==0){html=celda+'</tr>'}
    if(elem%2!=0 && elem==largoselec){html=html+'<td>&nbsp;</td></tr>'}

    document.write(html)
  }
}

function MuestraEquiposResultados(numero)
{
  html=TablaS2[numero].equipoa+' '+TablaS2[numero].golesa+' - '+TablaS2[numero].equipob+' '+TablaS2[numero].golesb
  document.write(html)
}

function MuestraEventoFecha(numero)
{
  html=TablaS2[numero].evento.toUpperCase()+'<br>'+TablaS2[numero].fecha
  document.write(html)
}

function MuestraInforme(numero)
{
  carpeta=TablaS2[numero].carpeta
  prorroga=TablaS2[numero].prorroga
  penalties=TablaS2[numero].penalties
  
  imga1='<img border="0" src="'+carpeta+'/equipo-a-1.jpg">'
  imga2='<img border="0" src="'+carpeta+'/equipo-a-2.jpg">'
  imgb1='<img border="0" src="'+carpeta+'/equipo-b-1.jpg">'
  imgb2='<img border="0" src="'+carpeta+'/equipo-b-2.jpg">'

  html='<table border="0" cellpadding="0" cellspacing="5" class="textomini">'
  html=html+'<tr><td align="center">'
  html=html+'<div style="border: 1px solid green; padding: 2px">PRIMERA PARTE<br>'+imga1+'&nbsp;'+imgb1+'</div>'
  html=html+'</td></tr>'
  html=html+'<tr><td align="center">'
  html=html+'<div style="border: 1px solid green; padding: 2px">SEGUNDA PARTE<br>'+imga2+'&nbsp;'+imgb2+'</div>'
  html=html+'</td></tr>'

  if(prorroga=="S")
  {
    imga1='<img border="0" src="'+carpeta+'/equipo-a-p1.jpg">'
    imga2='<img border="0" src="'+carpeta+'/equipo-a-p2.jpg">'
    imgb1='<img border="0" src="'+carpeta+'/equipo-b-p1.jpg">'
    imgb2='<img border="0" src="'+carpeta+'/equipo-b-p2.jpg">'

    html=html+'<tr><td align="center">'
    html=html+'<div style="border: 1px solid green; padding: 2px">PRIMERA PARTE DE LA PRÓRROGA<br>'+imga1+'&nbsp;'+imgb1+'</div>'
    html=html+'</td></tr>'
    html=html+'<tr><td align="center">'
    html=html+'<div style="border: 1px solid green; padding: 2px">SEGUNDA PARTE DE LA PRÓRROGA<br>'+imga2+'&nbsp;'+imgb2+'</div>'
    html=html+'</td></tr>'
  }

  if(penalties=="S")
  {
    imgpn='<img border="0" src="'+carpeta+'/penalties.jpg">'

    html=html+'<tr><td align="center">'
    html=html+'<div style="border: 1px solid green; padding: 2px">PENALTIES<br>'+imgpn+'</div>'
    html=html+'</td></tr>'
  }

  html=html+'</table>'

  document.write(html)
}
