// **** SELECCIONES ****

document.write('<script type="text/javascript" src="selecciones/selecciones.txt"></script>')

TablaIS = new Array("#Selecciones#v2#")

function CIS(datos){
  datos=datos.split("|")
  num=TablaIS.length
  TablaIS[num]=new DatosCIS(num,datos)
}

function DatosCIS(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.evento   = datos[6]
  this.fecha    = datos[7]
  this.autor    = datos[8]
  this.foto     = datos[9]
}

function MuestraSeleccion()
{
  ISHome=GetCookie("ISHome")
  if(ISHome)
  {
    datos=ISHome.split("|")
    ISHomeN=parseInt(datos[0])
    ISHomeF=new Date(datos[1])
  }
  else
  {
    ISHomeN=0
    ISHomeF=new Date()
  }

  ahora=new Date()
  marca=ISHomeF
  marca.setTime(marca.getTime()+(1*1*60*60*1000)) // 1 horas
  if(ISHomeN>0 && marca>ahora)
  {numero=ISHomeN}
  else
  {
    numero=ISHomeN+1
    largolista=TablaIS.length-1
    if(numero>largolista){numero=1}

    ISHome=numero+"|"+ahora
    caduca=new Date()
    caduca.setTime(caduca.getTime()+(365*24*60*60*1000))
    SetCookie("ISHome",ISHome,caduca,"/",null,null)
  }

  MuestraSeleccionHome(numero)
}

function MuestraSeleccionHome(numero)
{
  equipoa=TablaIS[numero].equipoa
  equipob=TablaIS[numero].equipob
  evento=TablaIS[numero].evento
  fecha=TablaIS[numero].fecha

  html='<span>'
  html=html+'<img border="0" height="30" src="imagenes/pelotamundo.gif" alt="Selecciones Nacionales">'
  html=html+'<br>Informes de Selecciones Nacionales'
  html=html+'<a href="selecciones/verinforme.html?i='+numero+'">'
  html=html+'<br><b>'+equipoa+' - '+equipob+'</b>'
  html=html+'<br>'+evento
  html=html+'<br>'+fecha
  html=html+'</a></span>'

  document.write(html)
}
