<!-- 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/

// BANNER SCRIPT FOR BIG BOX, Other PAGES
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=300 HEIGHT=250 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();

banners[0] = new banner("../banners/ta_bb.jpg",
                        "http://www.skicanadianrockies.com/6-mountain-resorts.aspx?cid=50061&redirect=false",
                        "Travel Alberta",
                        10);

banners[1] = new banner("../banners/corona_bb.jpg",
                        "http://www.coronaextra.ca/ target='_blank'",
                        "Corona Extra",
                        10);


banners[2] = new banner("../banners/columbia_bb.jpg",
                   	"http://www.columbia.com/ target='_blank'",
                        "Columbia",
                        10);

banners[3] = new banner("../banners/300x250_summer.gif",
                   	"http://www.whistlerblackcomb.com/deals_packages/deals/summer/index.htm?etc=skitheworld-summer-300x250-07-01-10 target='_blank'",
                        "Whistler Blackcomb",
                        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=300 HEIGHT=250 BORDER=0 ALT='" + banners[i].alt + "'></A>");
         return banners[i];
         break;
      }
   }
}
//-->