/*Original:  Robert Bui (astrogate@hotmail.com)
<!-- Web Site:  http://astrogate.virtualave.net 

This script and many more are available free online at 
The JavaScript Source!! http://javascript.internet.com */

<!--// Begin
var interval = 4000; // delay between rotating images (in milliseconds)
var random_display = 1; // 0 = no, 1 = yes

var image_index = 0;

image_list = new Array();
caption_list = new Array();

image_list[image_index] = new imageItem("Images/Depts/Chemistry/ES_MS.png");
caption_list[image_index++] = "Pictured at left : triple quadrupole electrospray mass spectrometer.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/Jack_Glovebox.png");
caption_list[image_index++] = "Pictured at left : Jack Bawiec (M.S. 2006, Stockland Group) in the glovebox.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/Aaron_Fluorimeter.png");
caption_list[image_index++] = "Pictured at left : Aaron Halpern(left, Williams group) driving the new Jobin Yvon spectrofluorimeter with Prof. Williams.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/Adam_CE.png");
caption_list[image_index++] = "Pictured at left : Adam Catherman(Strein group) running capillary electrophoresis experiments.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/NMRRoom.png");
caption_list[image_index++] = "Pictured at left : Bruker ARX 300 MHz Nuclear Magnetic Resonance spectrometer.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/PChem_CompLab.jpg");
caption_list[image_index++] = "Pictured at left : Meghan and Amanda working in the PChem computer lab.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/Caitlyn_Polymers.png");
caption_list[image_index++] = "Pictured at left : Caitlyn Johnson (Tillman Lab) making polymers.";

image_list[image_index] = new imageItem("Images/Depts/Chemistry/eric_at_ftir.png");
caption_list[image_index++] = "Pictured at left : Eric Fournier (McGuire Group) using the new Fourier-Transform Infra-red Spectrometer with an ATR (attenuated total reflection) cell.";

var number_of_image = image_list.length;

function imageItem(image_location) {
   this.image_item = new Image();
   this.image_item.src = image_location;
}

function get_ImageItemLocation(imageObj) {
   return(imageObj.image_item.src)
}

function generate(x, y) {
   var range = y - x + 1;
   return Math.floor(Math.random() * range) + x;
}

function randomImage(place) {
   image_index = generate(0, number_of_image-1);
   var new_image = get_ImageItemLocation(image_list[image_index]);
   document[place].src = new_image;
   var new_caption = document.getElementById("rCaption");
   new_caption.firstChild.nodeValue = caption_list[image_index];
}

//  End -->