
<!-- 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=386 HEIGHT=125 BORDER=0 ALT='" + alt + "'></A>");
}
banner.prototype.display = display;
banners = new Array();
banners[0] = new banner("header-1.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[1] = new banner("header-2.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[2] = new banner("header-3.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[3] = new banner("header-4.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[4] = new banner("header-5.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[5] = new banner("header-6.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[6] = new banner("header-7.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[7] = new banner("header-8.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[8] = new banner("header-9.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[9] = new banner("header-10.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[10] = new banner("header-11.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[11] = new banner("header-12.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[12] = new banner("header-13.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[13] = new banner("header-14.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        10);
banners[13] = new banner("header-15.jpg",
                        "http://www.cityofcolemantx.us",
                        "City of Coleman Home Page",
                        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=386 HEIGHT=125 BORDER=0 ALT='" + banners[i].alt + "'></A>");
         return banners[i];
         break;
      }
   }
}
//-->
