// 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","2010-07-29 12:40:01","Petr Horálek","http://www.astro.cz/clanek/4357","VII. expedice SAROS (7): Raemaru aneb Hledej červený šátek"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-29 06:00:02","František Martinek","http://www.astro.cz/clanek/4356","Objeveno 25 000 nových planetek"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-28 13:20:01","Petr Horálek","http://www.astro.cz/clanek/4355","VII. expedice SAROS (6): Vysmátý George, váhové limity a tanečnice"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-28 05:30:01","Jakub Černý","http://www.astro.cz/clanek/4354","Hon na prachovou stopu komety 10P/Tempel"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-27 13:40:01","Petr Horálek","http://www.astro.cz/clanek/4353","VII. expedice SAROS (5): Blízká setkání s Trumpetovou rybou"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-27 05:19:25","Vít Straka","http://www.astro.cz/clanek/4352","Záznam online přenosu výstupu ruských kosmonautů z paluby ISS"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-26 12:50:02","Petr Horálek","http://www.astro.cz/clanek/4351","VII. expedice SAROS (4): Laguna, šátky a ženy"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-26 07:00:01","Marcel Bělík","http://www.astro.cz/clanek/4350","Ze srdce Evropy až pod Jižní kříž"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-25 07:00:01","Jan Veselý","http://www.astro.cz/clanek/4349","Nová největší hvězda ve vesmíru?"),
  new sa("http://www.astro.cz/","astro.cz","astronomie","2010-07-23 13:10:01","Petr Horálek","http://www.astro.cz/clanek/4348","VII. expedice SAROS (3): Přeministrovaná Avarua a kopeček u nemocnice...")
)

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

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>')
}
