startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("navlist");
		for (i=0; i < navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload = function() {
      startList();
}


var timer = 5;

var photos = [
   ['member_01', 'Cruiser Cars'],
   ['member_02', 'Cruiser Cars'],
   ['member_03', 'Cruiser Cars'],
   ['member_04', 'Cruiser Cars'],
   ['member_05', 'Cruiser Cars'],
   ['member_06', 'Cruiser Cars'],
   ['member_07', 'Cruiser Cars'],
   ['member_08', 'Cruiser Cars'],
   ['member_09', 'Cruiser Cars'],
   ['member_10', 'Cruiser Cars'],
   ['member_11', 'Cruiser Cars'],
   ['member_12', 'Cruiser Cars'],
   ['member_13', 'Cruiser Cars']
];

var img, count = 1;

function startSlideshow()
{
   img = document.getElementById('photo');
   window.setTimeout('cueNextSlide()', timer * 1000);
}

function cueNextSlide()
{
   var next = new Image();

   next.onerror = function()
   {
      alert('Failed to load next image');
   };

   next.onload = function()
   {
      img.src = next.src;
      img.alt = photos[count][1];
      img.title = photos[count][1];

      img.width = next.width;
      img.height = next.height;

      if (++count == photos.length) { count = 0; }
      
      window.setTimeout('cueNextSlide()', timer * 1000);
   };
   
   next.src = 'images/slideshow/' + photos[count][0] + '.jpg';
}

addLoadListener(startSlideshow);

function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}