// 
//  (c) Timothy B. Booher 2004.
// 

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 2;

var Picture = new Array(); // 
var Caption = new Array(); // 

// string to hold img directory
var strDir = '../imgs/Welcome/HC/';

// 

Picture[1]  = strDir + 'back-yard-view.jpg';
Picture[2]  = strDir + 'frontal-view-HC.jpg';
Picture[3]  = strDir + 'master-br.jpg';
Picture[4]  = strDir + 'home-beachside.jpg';
Picture[5]  = strDir + 'guestroom-left.jpg';
Picture[6]  = strDir + 'view-from-balcony.jpg';

// 

Caption[1]  = "The view from your personal beach . . .";
Caption[2]  = "Front of the home";
Caption[3]  = "Master bedroom";
Caption[4]  = "Beach-side of the home";
Caption[5]  = "East Guestroom";
Caption[6]  = "View from master bedroom balcony";

// =====================================
// 
// =====================================

var tss = null;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++) {
	preLoad[iss] = new Image();
	preLoad[iss].src = Picture[iss];
}

var myBool;
myBool = true;

function swapImg(intImgIndex) {
   if (tss != null) clearTimeout(tss);
   PictureBox.src = Picture[intImgIndex];
   if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[intImgIndex];
   myBool = false; // this should stop the slide-show
}

function runSlideShow(){
	if (document.all){
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	document.images.PictureBox.src = preLoad[jss].src;
	if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
	if (document.all) document.images.PictureBox.filters.blendTrans.Play();
	jss = jss + 1;
	if (jss > (pss)) jss = 1;
	if (myBool) {
		tss = setTimeout('runSlideShow()', SlideShowSpeed);
	} else { return false; }
}