/* $Id: common.js,v 1.10 2005/12/11 14:10:38 mitch Exp $ */

/*
 * Random Banner Display
 */

var randomize_banner = true; /* Zum kompletten Deaktivieren der Banner-Funktion
                             auf false setzen. */
var banner_link = new Array();
var banner_img = new Array();
var banner_title = new Array();

if (randomize_banner && banner_link.push) {

  if (!dont_show) {
    var dont_show = new String ("nothing")
  }

/*
 * Verhältnis der angezeigten Banner 5 : 3 : 3
 * (wir haben 5 Marathon-Banner)
 */

  if (dont_show.indexOf ("marathon") == -1) {
    banner_link.push ('http://www.tomodachi.de/html/marathon/');
    banner_img.push ('http://i.tomodachi.de/marathon/2005/banner_obenrechts_1.png');
    banner_title.push ('Anime Marathon - Die Convention des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.tomodachi.de/html/marathon/');
    banner_img.push ('http://i.tomodachi.de/marathon/2005/banner_obenrechts_2.png');
    banner_title.push ('Anime Marathon - Die Convention des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.tomodachi.de/html/marathon/');
    banner_img.push ('http://i.tomodachi.de/marathon/2005/banner_obenrechts_3.png');
    banner_title.push ('Anime Marathon - Die Convention des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.tomodachi.de/html/marathon/');
    banner_img.push ('http://i.tomodachi.de/marathon/2005/banner_obenrechts_4.png');
    banner_title.push ('Anime Marathon - Die Convention des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.tomodachi.de/html/marathon/');
    banner_img.push ('http://i.tomodachi.de/marathon/2005/banner_obenrechts_5.png');
    banner_title.push ('Anime Marathon - Die Convention des Anime no Tomodachi e.V.');
  }

  if (dont_show.indexOf ("funime") == -1) {
    banner_link.push ('http://www.funime.de/');
    banner_img.push ('http://i.tomodachi.de/banner/funime.gif');
    banner_title.push ('FUNime - Das Magazin des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.funime.de/');
    banner_img.push ('http://i.tomodachi.de/banner/funime.gif');
    banner_title.push ('FUNime - Das Magazin des Anime no Tomodachi e.V.');
    banner_link.push ('http://www.funime.de/');
    banner_img.push ('http://i.tomodachi.de/banner/funime.gif');
    banner_title.push ('FUNime - Das Magazin des Anime no Tomodachi e.V.');
  }

  if (dont_show.indexOf ("tvplaner") == -1) {
    banner_link.push ('http://www.tomodachi.de/html/ant/service/tv_planer.html');
    banner_img.push ('http://i.tomodachi.de/banner/tv_planer.gif');
    banner_title.push ('Anime TV-Planer');
    banner_link.push ('http://www.tomodachi.de/html/ant/service/tv_planer.html');
    banner_img.push ('http://i.tomodachi.de/banner/tv_planer.gif');
    banner_title.push ('Anime TV-Planer');
    banner_link.push ('http://www.tomodachi.de/html/ant/service/tv_planer.html');
    banner_img.push ('http://i.tomodachi.de/banner/tv_planer.gif');
    banner_title.push ('Anime TV-Planer');
  }
}

function randomBanner() {
  if (randomize_banner && (banner_link.length > 0)) {
    var idx = Math.floor(Math.random()*banner_link.length);

    document.write ('<a href="'+banner_link[idx]+'"><img src="'+banner_img[idx]+
      '" width="300" height="75" border="0" alt="'+banner_title[idx]+'" title="'+
      banner_title[idx]+'"></a>');
  } else 
    document.write ('<img src="http://i.tomodachi.de/general/right_end.gif"'+
      ' width="50" height="75" border="0" alt="">');
}
