<!-- Copyright 2000 - Galichon Enterprises, Inc.  rich@galichon.net  http://www.galichon.net
// Permission granted to SimplytheBest.net to list the script in the DHTML scripts library
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
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=575 HEIGHT=257 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();
banners[0] = new banner("images/index-blast-goodies.jpg",
                        "http://www.goodiessweetshop.co.uk/products/4/66/goodies_sweet_shop_jar_of_retro_sweets.html target='_self'",
                        "Goodies Sweet Shop Jar of Retro Sweets",
                        10);
banners[1] = new banner("images/index-tube-goodies.jpg",
                        "http://www.goodiessweetshop.co.uk/products/4/67/goodies_tuck_shop_time_capsule.html target='_self'",
                        "Goodies Sweet Shop Tuck Shop Time Capsule",
                        10);
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=575 HEIGHT=257 BORDER=0 ALT='" + banners[i].alt + "'></A>");
         return banners[i];
         break;
      }
   }
}
//-->
