


// ::::: css rollover menu functions for home page  :::::

/* rollover function*/
	function chgImg(imgField,newImg) {
		if (document.images) {
			document[imgField].src= eval(newImg + ".src")
		}
	}

   if (document.layers){
      //Netscape 4 specific code
      pre = 'document.';
      post = '';
   }
   if (document.getElementById){
      //Netscape 6 specific code
      pre = 'document.getElementById("';
      post = '").style';
   }
   if (document.all){
      //IE4+ specific code
      pre = 'document.all.';
      post = '.style';
   }

// set currentLayer to the bottom (default) layer that is visible when menus are closed
var currentLayer = 'sealbg';

   function showLayer(lyr){
      hideLayer(currentLayer);
      eval(pre + lyr + post).visibility = 'visible';
      currentLayer = lyr;
   }
   function hideLayer(lyr){
      eval(pre + lyr + post).visibility = 'hidden';
   }

/* preload images function */
  	function preloadImages() {
   if (document.images) {
      for (var i = 0; i < preloadImages.arguments.length; i++) {
         (new Image()).src = preloadImages.arguments[i];
      }
   }
}




// ::::: script to load random banner images :::::
// note: set interval to a large number to effectively disable live rotation of images
// note: if random_display is set to "0", images rotate consecutively


var interval = 200; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys01.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys02.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys03.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys04.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys05.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys06.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys07.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys08.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys09.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys10.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys11.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys12.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys13.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys14.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys15.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys16.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys17.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys18.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys19.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys20.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys21.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys22.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys23.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys24.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys25.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys26.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys27.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys28.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys29.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys30.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys31.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys32.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys33.jpg");
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys34.jpg");
/*
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys35.jpg");
*/
image_list[image_index++] = new
imageItem("http://www.universityofcalifornia.edu/images/syshome/sys36.jpg");



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 getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}