function rotator(img_source,alt,chance) {
   this.img_source = img_source;
   this.alt = alt;
   this.chance = chance;
}
function viewer() {
   with (this) document.write("<IMG SRC='" + img_source + "' WIDTH=200 BORDER=0 ALT='" + alt + "'>");
}
rotator.prototype.viewer = viewer;
rotators = new Array();
rotators[0] = new rotator("Images/Home/image1.jpg",
                        "image 1",
                        10);
rotators[1] = new rotator("Images/Home/image2.jpg",
                        "image 2",
                        10);
rotators[2] = new rotator("Images/Home/image3.jpg",
                        "image 3",
                        10);
rotators[3] = new rotator("Images/Home/image4.jpg",
                        "image 4",
                        10);
rotators[4] = new rotator("Images/Home/image5.jpg",
                        "image 5",
                        10);
rotators[5] = new rotator("Images/Home/image6.jpg",
                        "image 6",
                        10);
rotators[6] = new rotator("Images/Home/image7.jpg",
                        "image 7",
                        10);
rotators[7] = new rotator("Images/Home/image8.jpg",
                        "image 8",
                        10);
rotators[8] = new rotator("Images/Home/image9.jpg",
                        "image 9",
                        10);
rotators[9] = new rotator("Images/Home/image10.jpg",
                        "image 10",
                        10);
rotators[10] = new rotator("Images/Home/image11.jpg",
                        "image 11",
                        10);
rotators[11] = new rotator("Images/Home/image12.jpg",
                        "image 12",
                        10);
sum_of_all_chances = 0;
for (j = 0; j < rotators.length; j++) {
   sum_of_all_chances += rotators[j].chance;
}
function viewer_rotator() {
   chance_limit = 0;
   randomly_selected_chance = Math.round((sum_of_all_chances - 1) * Math.random()) + 1;
   for (j = 0; j < rotators.length; j++) {
      chance_limit += rotators[j].chance;
      if (randomly_selected_chance <= chance_limit) {
         document.write("<IMG SRC='" + rotators[j].img_source + "' Width=200 Border=0 ALT='" + rotators[j].alt + "'>");
         return rotators[j];
         break;
      }
   }
}
