<!-- Copyright 2000 - Galichon Enterprises, Inc.  All rights reserved.  -->
<!-- Coded by: Rich Galichon (rich@galichon.net)  -->
<!-- Web Site: http://www.galichon.net  -->
<!-- Please retain this Copyright notice in the script.  License is granted to User to reuse this code on their own website if, and only if, this entire copyright notice is included.  -->

<!-- Begin
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 + "' BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.dispBanner = dispBanner;
banners = new Array();


banners[0] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/5zigen.jpg", "http://www.tougedistribution.com/brand/5zigen/", "5zigen", 1);
banners[1] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/asm.jpg", "http://www.tougedistribution.com/brand/ASM+Yokohama/", "ASM Yokohama", 1);
banners[2] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/abflug.jpg", "http://www.tougedistribution.com/brand/Abflug/", "Abflug", 1);
banners[3] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/advance.jpg", "http://www.tougedistribution.com/brand/Advance/", "Advance", 1);
banners[4] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/airwalker.jpg", "http://www.tougedistribution.com/brand/Air+Walker/", "Air Walker", 1);
banners[5] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/acre.jpg", "http://www.tougedistribution.com/brand/Acre/", "ACRE", 1);
banners[6] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/takata.jpg", "http://www.tougedistribution.com/brand/Takata/", "Takata", 1);
banners[7] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/refer.jpg", "http://www.tougedistribution.com/incentive-scheme/", "Refer a friend!", 1);
banners[8] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/work.jpg", "http://www.tougedistribution.com/brand/Work+wheels/", "Work Wheels", 1);
banners[9] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/alex.jpg", "http://www.tougedistribution.com/brand/Alex+Motorsport/", "Alex Motorsport", 1);
banners[10] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/amuse.jpg", "http://www.tougedistribution.com/brand/Amuse/", "Amuse", 1);
banners[11] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/RPF1.jpg", "http://www.tougedistribution.com/list/60/Enkei+RPF1", "Enkei RPF1", 1);
banners[12] = new banner("http://www.tougedistribution.com/imagefarm/images/adverts/weds.jpg", "http://www.tougedistribution.com/list/60/Weds+Wheels", "Weds", 1);



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 + "' BORDER=0 ALT='" + banners[i].alt + "'></A>");
      return banners[i];
      break;
    }
  }
}
//  End -->
