function banner(imgSource,url,alt,chance) {
this.imgSource = imgSource;
this.url = url;
this.alt = alt;
this.chance = chance;
}
function dispBanner() {
with (this) document.write("<A HREF=" + url + "><IMG SRC='" + imgSource + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.dispBanner = dispBanner;
banners = new Array();
banners[0] = new banner("http://www.bigbrotheronline.co.uk/images/peugeotuk_banner.gif",
                        "http://www.peugeotmoto.co.uk/ target='_blank'",
                        "Peugeot Motocycles in the UK",
                        8);
banners[1] = new banner("http://www.bigbrotheronline.co.uk/images/logitech_banner.gif",
                        "http://www.logitech.com target='_blank'",
                        "Logitech .com",
                        1);
banners[2] = new banner("http://www.bigbrotheronline.co.uk/images/glastonbury_banner.gif",
                        "http://www.glastonburyfestivals.co.uk/index2.html target='_blank'",
                        "No Ticket - No Festival",
                        20);
banners[3] = new banner("http://www.bigbrotheronline.co.uk/images/gba_banner.gif",
                        "http://www.gameboyadvance.co.uk target='_blank'",
                        "Game Boy Advance",
                        8);
banners[4] = new banner("http://www.bigbrotheronline.co.uk/images/dixons_banner.gif",
                        "http://www.dixons.co.uk target='_blank'",
                        "Dixons",
                        21);
banners[5] = new banner("http://www.bigbrotheronline.co.uk/images/archos_banner.gif",
                        "http://www.archos.com target='_blank'",
                        "Archos MP3 Jukebox Recorders and portable hard drives - click here",
                        10);
banners[6] = new banner("http://www.bigbrotheronline.co.uk/images/thrustmaster_banner.gif",
                        "http://www.thrustmaster.co.uk target='_blank'",
                        "Thrustmaster PC and Console accessories",
                        8);
banners[7] = new banner("http://www.bigbrotheronline.co.uk/images/plextor_banner.gif",
                        "http://www.plextor.com target='_blank'",
                        "Plextor high-end CD-Writers and CD-ROM drives - click here",
                        20);
banners[8] = new banner("http://www.bigbrotheronline.co.uk/images/casio_banner.gif",
                        "http://www.casio.co.uk target='_blank'",
                        "Casio wrist cameras and digital cameras - click here",
                        1);
banners[9] = new banner("http://www.bigbrotheronline.co.uk/images/pentium4_banner.gif",
                        "http://www.intel.co.uk target='_blank'",
                        "The Intel Pentium 4 Processor - click here",
                        20);
///////////////////////////////////////////////////
// banners[x] = new banner(<banner source image>,                                           //                         <url to link to when the banner is clicked>,                     //                         <alt>                                                            //                         <the chance this banner has in which to be randomly selected>);  
// To increase the chance of a banner being randomly selected, increase it's corresponding  // 'chance' property relative to the other banners.                                         
///////////////////////////////////////////////////
sum_of_all_chances = 0;
for (i = 0; i < banners.length; i++) {
sum_of_all_chances += banners[i].chance;
}
function randomBanner() {
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].imgSource + "' WIDTH=468 HEIGHT=60 BORDER=0 ALT='" + banners[i].alt + "'></A>");
return banners[i];
break;
      }
   }
}
