var timeout = 4000

// format: 
//   field1: image in folder /images/rotate
//   field2: text to appear below image
//   field3: link to bio HTML 
var rotating_images = new Array(
  "dennett_daniel.jpg", "Daniel Dennett", "index.html#daniel-dennett",
  "pinker.jpg", "Steven Pinker", "index.html#steven-pinker",
  "downey_margaret.jpg", "Margaret Downey", "index.html#margaret-downey",
  "dawkins_richard.jpg", "Richard Dawkins", "index.html#richard-dawkins",
  "randi_james.jpg", "James Randi", "index.html#james-randi",
  "shermer_michael.jpg", "Michael Shermer", "index2.html#michael-shermer",
  "igwe_leo.jpg", "Leo Igwe", "index2.html#leo-igwe",
  "penn_teller.jpg", "Penn & Teller", "index2.html#penn-and-teller",
  "hemant_mehta.jpg", "Hemant Mehta", "index2.html#hemant-mehta",
  "roberts_richard.jpg", "Richard Roberts", "index.html#richard-roberts",
  "edis_taner.jpg", "Taner Edis", "index4.html#taner-edis",
  "kagins.jpg", "Kagins of Camp Quest", "index.html#kagins",
  "glashow_sheldon_lee.jpg", "Sheldon Lee Glashow", "index3.html#sheldon-lee-glashow",
  "pigliucci_massimo.jpg", "Massimo Pigliucci", "index4.html#massimo-pigliucci",
  "futrell_mynga.jpg", "Mynga Futrell", "index2.html#mynga-futrell",
  "geisert_paul.jpg", "Paul Geisert", "index3.html#paul-geisert",
  "schultz_kevin.jpg", "Kevin Schultz", "index2.html#kevin-schultz",
  "will_morris.jpg", "Will Morris", "index4.html#will-morris",
  "skye_theo.jpg", "Theo Skye", "index2.html#theo-skye",
  "churchill.jpg", "Bob Churchill", "index4.html#bob-churchill",
  "cherry_matt.jpg", "Matt Cherry", "index3.html#matt-cherry",
  "gogineni_babu.jpg", "Babu Gogineni", "index3.html#babu-gogineni",
  "lipman_mel.jpg", "Mel Lipman", "index.html#mel-lipman",
  "silverman_herb.jpg", "Herb Silverman", "index.html#herb-silverman",
  "kirkhart_bobbie.jpg", "Bobbie Kirkhart", "index.html#bobbie-kirkhart",
  "brunsman_august.jpg", "August E. Brunsman IV", "index2.html#august-brunsman",
  "sturmark_christer.jpg", "Christer Sturmark", "index3.html#christer-sturmark",
  "alkon_amy.jpg", "Amy Alkon", "index3.html#amy-alkon",
  "mcnally_robert.jpg", "Robert McNally", "index2.html#robert-mcnally",
  "lacourt_marilyn.jpg", "Marilyn LaCourt", "index2.html#marilyn-lacourt",
  "wales_vincent.jpg", "Vincent M. Wales", "index3.html#vincent-wales",
  "melnik_ray.jpg", "Ray Melnik", "index3.html#ray-melnik",
  "cantu_andres_gonzalez.jpg", "Andrés González Cantú", "index3.html#andrés-gonzáles-cantú",
  "boniakowski_jozef.jpg", "Jozef Hand-Boniakowski", "index3.html#jozef-boniakowski",
  "debra_olson.jpg", "Debra Deanne Olson", "index4.html#debra-deanne-olson",
  "sue_blackmore.jpg", "Sue Blackmore", "index4.html#sue-blackmore",
  "RaoulCrudeli.jpg", "Raoul Tomassini Crudeli", "index5.html#raoul-crudeli",
  "dan_hooper.jpg", "Dan Hooper", "index5.html#dan-hooper",
  "wadhawan_vinod.jpg", "Vinod Wadhawan", "index5.html#vinod-wadhawan",
  "ac_grayling.jpg", "AC Grayling", "index5.html#ac-grayling");

var current = 0;
var current_text = 1;
var current_link = 2;
var server = "http://the-brights.net";
var image_prefetch = new Image();

function init()
{
  if (!document.images) return

  current_prefetch = (current+3 > rotating_images.length-1) ? 0 : current + 3;

  image_prefetch.src = server + 
                       "/images/rotate/" + 
                       rotating_images[current_prefetch];
  document.images['rotating_images'].src = server + 
                                           "/images/rotate/" + rotating_images[current];
  document.getElementById('rotating_images_text').innerHTML = "<a href=\"" + 
                                                              server + 
                                                              "/people/enthusiastic/" + 
                                                              rotating_images[current_link] + 
                                                              "\">" + 
                                                              rotating_images[current_text] + 
                                                              "</a>";

  current = (current+3 > rotating_images.length-1) ? 0 : current + 3;
  current_text = current+1;
  current_link = current+2;

  setTimeout('init()', timeout);
}

