// Calls random image and corresponding alt tag into home page

var banners = [
  { src: "/files/images/iHeaders/1.png", alt: "Photo: Azusa Light and Water Department, California" },
  { src: "/files/images/iHeaders/21.png", alt: "Photo: Banning Electric Department, California" },
  { src: "/files/images/iHeaders/3.png", alt: "Photo: Emerald People's Utility District, Oregon" },
  { src: "/files/images/iHeaders/4.png", alt: "Photo: Jamestown Board of Public Utilities, New York" },
  { src: "/files/images/iHeaders/5.png", alt: "Photo: Moreno Valley Utilities, California" },
  { src: "/files/images/iHeaders/6.png", alt: "Photo: Naperville Public Utilities, Illinois" },
  { src: "/files/images/iHeaders/7.png", alt: "Photo: Rock Falls Electric Department, Illinois" },
  { src: "/files/images/iHeaders/8.png", alt: "Photo: Virgin Islands Water and Power Authority" },
];

var now = new Date();
var seed = now.getTime() % 0xffffffff;

function rand(n) {
  seed = (0x015a4e35 * seed) % 0x7fffffff;
  return ( seed >> 16 ) % n;
}

var num = rand(banners.length);

document.write("<img alt='" + banners[num].alt + "' name='main_image' src='" + banners[num].src + "' width='509' height='120' border='0'>");
