// globalni promena pro vice kategorii
var global_astro_test = 1
var article           = new Array()
var article_counter   = 0
var article           = null

// --------------------------------------------------------------

function sa(server_url,server,cluster,date,author,article_url,article_text) {
   this.server       = server
   this.server_url   = server_url
   this.cluster      = cluster
   this.date         = date
   this.author       = author
   this.article_url  = article_url
   this.article_text = article_text
}

article = new Array(
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-03 15:00:01","Marcel Bělík","http://www.astro.cz/clanek/5020","ČAM Leden 2012: Melotte 15"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-03 07:00:01","František Martinek","http://www.astro.cz/clanek/5019","Výzkum Venuše: Veněra-D a co dál?"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-03 02:34:26","Ivo Míček","http://www.astro.cz/clanek/5018","Moje Vánoční Kometa 2011 - výsledky"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-02 13:00:01","Jindřich Suchánek","http://www.astro.cz/clanek/5017","Hlubinami vesmíru s P. Pavlem Gádorem, SJ, PhD. (2. díl)"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-02 07:00:01","Martin Gembec","http://www.astro.cz/clanek/5016","Vesmírná videa: leden 2012"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-01 13:50:01","Petr Sobotka","http://www.astro.cz/clanek/5015","Rozhovor: Michal Švanda - Otřásající se Slunce"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-02-01 06:50:02","František Martinek","http://www.astro.cz/clanek/5014","Hayabusa-2: další odběr vzorku z asteroidu"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-01-31 07:00:01","Vít Straka","http://www.astro.cz/clanek/5013","Co je nového na palubě ISS?"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-01-30 16:07:05","Karel Mokrý","http://www.astro.cz/clanek/5012","Absolutní vítěz mezinárodní soutěže &quot;Sviťme si na cestu... ne na hvězdy&quot;"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2012-01-30 06:35:43","Martin Gembec","http://www.astro.cz/clanek/5011","5. vesmírný týden 2012")
)

// --------------------------------------------------------------

function astro_show(show_date, show_author) {
  var numberofarticles = global_astro_articles; //article.length
  var odd;
  var columns = 3;

  if ( show_author == null ) { show_author = 1; };
  if ( show_date   == null ) { show_date   = 1; };
  if ( show_author == 0 )    { columns     = columns - 1; };
  if ( show_date   == 0 )    { columns     = columns - 1; };

  document.writeln('<div class="astro_index_div">')
  document.writeln('<table class="astrocz_index_table">')
  document.writeln('<tr><td colspan="'+columns+'" class="astrocz_index_td_header">Přehled článků ze serveru <a class="astrocz_index_link_header" href="http://www.astro.cz/">www.astro.cz</a></td></tr>')

  for (var counter=0; counter < numberofarticles; counter++) {

    if ( counter % 2 ) { odd = '_even'; } else { odd = '_odd'; }

    document.writeln('<tr>')

    // vypis datum
    if ( show_date == 1 ) {
       document.writeln('<td class="astrocz_index_td'+odd+'">')
       document.writeln('<font class="astrocz_index_font_date'+odd+'">'+article[counter].date+'</font>')
       document.writeln('</td>')
    }

    // vypis autora
    if ( show_author == 1 ) {
       document.writeln('<td class="astrocz_index_td'+odd+'">')
       document.writeln('<font class="astrocz_index_font_author'+odd+'">'+article[counter].author+'</font>')
       document.writeln('</td>')
    }

    // Vypisuj nadpisy
    document.writeln('<td class="astrocz_index_td'+odd+'">')
    document.writeln('<a target="_blank" class="astrocz_index_link'+odd+'" href="'+article[counter].article_url+'">'+article[counter].article_text+'</a>')
    document.writeln('</td>')

    document.writeln('</tr>')
  } // konec cyklu vypisu clanku

  document.writeln('</table>')
  document.writeln('</div>')
}

