
// Global variables
// This part runs the slide show once the images have been pre-loaded.
var slideShowSpeed = 3000;       // Set slideShowSpeed (milliseconds)
var crossFadeDuration = 3;       // Duration of crossfade (seconds)

var Pic = new Array();           // Specify the image file names
Pic[0] = 'Images/Sold/s1_s.jpg'	// Pre-load the image names for this show
Pic[1] = 'Images/Sold/s2_s.jpg'
Pic[2] = 'Images/Sold/s3_s.jpg'
Pic[3] = 'Images/Sold/s4_s.jpg'
Pic[4] = 'Images/Sold/s5_s.jpg'
Pic[5] = 'Images/Sold/s6_s.jpg'
Pic[6] = 'Images/Sold/s7_s.jpg'
//Pic[7] = 'Images/Sold/s8_s.jpg'	// 8 Images for this show

// Pointers from image to image-array  (MUST be outside recursive routine!)
var pA = 0; // 1, 2, 3, 4, 5, 6, 7, 8 = 0, 1, 2, 3, 4, 5, 6, 7
var pB = 1; // 2, 3, 4, 5, 6, 7, 8, 1 = 1, 2, 3, 4, 5, 6, 7, 0
var pC = 2; // 3, 4, 5, 6, 7, 8, 1, 2 = 2, 3, 4, 5, 6, 7, 0, 1
var pD = 3; // 4, 5, 6, 7, 8, 1, 2, 3 = 3, 4, 5, 6, 7, 0, 1, 2
	
// Pre-load the images into this array
var ssImages = new Array();		// Slide Show Images Array
for ( var i = 0; i < Pic.length; i++ )
{
   ssImages[i] = new Image();
   ssImages[i].src = Pic[i];
}

//alert("Number of pictures loaded: " + ssImages.length + " of: " + Pic.length );

// This routine runs a slide show with four pictures
function runSlideShow()
{
	if (document.all)
	{
		document.images.ssI1.style.filter="blendTrans(duration=2)";
		document.images.ssI1.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.ssI1.filters.blendTrans.Apply();
		
		document.images.ssI2.style.filter="blendTrans(duration=2)";
		document.images.ssI2.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.ssI2.filters.blendTrans.Apply();
		
		document.images.ssI3.style.filter="blendTrans(duration=2)";
		document.images.ssI3.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.ssI3.filters.blendTrans.Apply();
		
		document.images.ssI4.style.filter="blendTrans(duration=2)";
		document.images.ssI4.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.ssI4.filters.blendTrans.Apply();
	}
	
   document.images.ssI1.src = ssImages[pA].src;
   document.images.ssI2.src = ssImages[pB].src;
   document.images.ssI3.src = ssImages[pC].src;
   document.images.ssI4.src = ssImages[pD].src;
   
   pA += 1; if ( pA > ssImages.length - 1 ) { pA = 0; }
   pB += 1; if ( pB > ssImages.length - 1 ) { pB = 0; }
   pC += 1; if ( pC > ssImages.length - 1 ) { pC = 0; }
   pD += 1; if ( pD > ssImages.length - 1 ) { pD = 0; }
   
	if (document.all)
	{
		document.images.ssI1.filters.blendTrans.Play();
		document.images.ssI2.filters.blendTrans.Play();
		document.images.ssI3.filters.blendTrans.Play();
		document.images.ssI4.filters.blendTrans.Play();
	}
	
   t = setTimeout('runSlideShow()', slideShowSpeed);
}
