function banner(img_source,url,alt,width,height,chance) {
   this.img_source = img_source;
   this.url = url;
   this.alt = alt;
   this.chance = chance;
   this.width = width;
   this.height = height;
}
function display() {
   with (this) document.write("<A HREF=" + url + "><IMG SRC='" + img_source + "' WIDTH='" + width + "'  HEIGHT='" + height  + "' BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();
banners[0] = new banner("Images/Bendigo_Bank_Logo.gif",
                        "http://www.bendigobank.com.au/public/community_bank/community_bank.asp?name=Blackburn_South",
                        "Bendigo Bank",
						"180",
						"240",
                        10);
banners[1] = new banner("Images/athletesfootlogo_180x92.jpg",
						"http://www.athletesfoot.com.au/",
						"Athletes Foot",
						"180",
						"92",
						10);
banners[2] = new banner("Images/IGA_180x111.jpg",
                        "http://www.iga.net.au/",
                        "IGA Supermarkets",
						"180",
						"111",
                        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='" + banners[i].width + "'  HEIGHT='" + banners[i].height  +"' BORDER=0 ALT='" + banners[i].alt + "'></A>");
         return banners[i];
         break;
      }
   }
}
//-->
