// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully
// Modified by Gunnison Carbone to add randomizer

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 6000

// Duration of crossfade (seconds)
var crossFadeDuration = 1

// Specify the image files
var Pic = new Array() // don't touch this
var preLoad = new Array()

// to add more images, just continue
// the pattern, adding to the array below


function storeImages() {

Pic[0] = '/img/ss/slideshow01.jpg'
Pic[1] = '/img/ss/slideshow02.jpg'
Pic[2] = '/img/ss/slideshow03.jpg'
Pic[3] = '/img/ss/slideshow04.jpg'
Pic[4] = '/img/ss/slideshow05.jpg'
Pic[5] = '/img/ss/slideshow06.jpg'
Pic[6] = '/img/ss/slideshow07.jpg'
Pic[7] = '/img/ss/slideshow08.jpg'
Pic[8] = '/img/ss/slideshow09.jpg'
Pic[9] = '/img/ss/slideshow10.jpg'
Pic[10] = '/img/ss/slideshow11.jpg'
Pic[11] = '/img/ss/slideshow12.jpg'
Pic[12] = '/img/ss/slideshow13.jpg'
Pic[13] = '/img/ss/slideshow14.jpg'
Pic[14] = '/img/ss/slideshow15.jpg'
Pic[15] = '/img/ss/slideshow16.jpg'
Pic[16] = '/img/ss/slideshow17.jpg'
Pic[17] = '/img/ss/slideshow18.jpg'




}

// add <body onload="runSlideShow(0);"> to page calling this

// =======================================
// do not edit anything below this line
// =======================================


randomizeImages();

function randomizeImages() {
	
	storeImages();

	var i = 0;
	var p = Pic.length;

	var isFilled = 0;
	var x = 0;
	var tempPic = "";

	while (isFilled < 20) {

		for (i=0; i < p; i++) {
			x = getRandomNumber(0,p);
			tempPic = Pic[x];
			Pic[x] = Pic[i];
			Pic[i] = tempPic;	
		}
	
		isFilled++;
	}

	// for (i=0; i < p; i++) {
	// 	alert("pic " + i + " = " + Pic[i]);	
	// }

	for (i = 0; i < p; i++){
   		preLoad[i] = new Image();
   		preLoad[i].src = Pic[i];
	}
}

function getRandomNumber(start, end) {
	var x = Math.floor((Math.random()*(end-start)) + start);
	return x;
}

function runSlideShow(j){

   var p = Pic.length;

   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();      
   }

   document.images.SlideShow.src = preLoad[j].src;

   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   
   j++;

   if (j > (p-1)) { 
	j=0;
   }
   t = setTimeout("runSlideShow(" + j + ")", slideShowSpeed);
}