//[0] 2011-11-14 - 2011-12-14 20:55//
//[2] 2012-02-14 - 2011-03-15 23:33//
function banner(img_source,url,alt,chance) {
   this.img_source = img_source;
   this.url = url;
   this.alt = alt;
   this.chance = chance;
}
function display() {
   with (this) document.write("<A HREF=" + url + "><IMG SRC='" + img_source + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();
banners[0] = new banner("http://www.ad.hekko.pl/8_tani_hosting_www.jpg",
                        "http://www.hekko.pl/?ref=27405 target='_blank'",
                        "Reklama",
                        0);
banners[1] = new banner("http://www.ad.hekko.pl/8_tanie_domeny.jpg",
                        "http://www.hekko.pl/?ref=27405 target='_blank'",
                        "Reklama",
                        0);
banners[2] = new banner("/images/flubie468x60.png",
                        "http://FLubie.pl target='_blank'",
                        "Reklama",
                        1);
banners[3] = new banner("http://www.nowysacz.biz/images/banners/banner468x60.png",
                        "http://nowysacz.biz target='_blank'",
                        "Reklama",
                        0);
sum_of_all_chances = 0;
for (i = 0; i < banners.length; i++) {
   sum_of_all_chances += banners[i].chance;
}
function display_banner() {
   chance_limit = 0;
   randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
   for (i = 0; i < banners.length; i++) {
      chance_limit += banners[i].chance;
      if (randomly_selected_chance <= chance_limit) {
         document.write("<A HREF=" + banners[i].url + "><IMG SRC='" + banners[i].img_source + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + banners[i].alt + "'></A>");
         return banners[i];
         break;
      }
   }
}
