// JavaScript for Golden Gate Brass index.html slide show. Jon Aymon October 2009
// Load images for index.html.
var images = new Array(5);
if (document.images) {
  var imp = 1;
  var image_src = new Array(5);
  var i;
  image_src[0] = "images/logo.gif";
  image_src[1] = "images/panorama.jpg";
  image_src[2] = "images/ggbmusiciansw.jpg";
  image_src[3] = "images/towerofpower.jpg";
  image_src[4] = "images/laughter.jpg";
  for (i=0;i<5;i++) {
    window.images[i] = new Image();
    window.images[i].src = image_src[i];
  }
}
function fadeIn(ind) {
	var image_src = window.image_src;
	var picture = document.getElementById("picture");
	picture.style.backgroundImage = "url(" + image_src[ind] + ")";
	opacity('picture', 0, 100, 400);
}
function fadeOut() {
	opacity('picture', 100, 0, 400);
}
function show() {
// Recursive call - infinite loop over images.
	setTimeout("show()", 22000);
// Display the four pictures 5500 ms apart, with image on display for 5000 ms.
	setTimeout("fadeIn(1)", 0);
	setTimeout("fadeOut()", 5000);
	setTimeout("fadeIn(2)", 5500);	
	setTimeout("fadeOut()", 10500);
	setTimeout("fadeIn(3)", 11000);	
	setTimeout("fadeOut()", 16000);
	setTimeout("fadeIn(4)", 16500);	
	setTimeout("fadeOut()", 21500);
}
window.onload = show();
