// (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

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

var t;
var j;
var p;
var preLoad = new Array();

function populatePicArray(page){
	switch(page){
	
	case "all.php":
		Pic[0] = '/images/storePhoto/wine/1.jpg'
		Pic[1] = '/images/storePhoto/wine/2.jpg'
		Pic[2] = '/images/storePhoto/wine/3.jpg'
		Pic[3] = '/images/storePhoto/wine/4.jpg'
		Pic[4] = '/images/storePhoto/beer/1.jpg'
		Pic[5] = '/images/storePhoto/beer/2.jpg'
		Pic[6] = '/images/storePhoto/beer/3.jpg'
		Pic[7] = '/images/storePhoto/beer/4.jpg'
		Pic[8] = '/images/storePhoto/beer/5.jpg'
		Pic[9] = '/images/storePhoto/beer/6.jpg'
		Pic[10] = '/images/storePhoto/beer/7.jpg'
		Pic[11] = '/images/storePhoto/beer/8.jpg'
		Pic[12] = '/images/storePhoto/beer/9.jpg'
		Pic[13] = '/images/storePhoto/liquor/1.jpg'
		Pic[14] = '/images/storePhoto/liquor/2.jpg'
		Pic[15] = '/images/storePhoto/liquor/3.jpg'
		Pic[16] = '/images/storePhoto/liquor/4.jpg'
		break;

	case "beer.php":
		Pic[0] = '/images/storePhoto/beer/1.jpg'
		Pic[1] = '/images/storePhoto/beer/2.jpg'
		Pic[2] = '/images/storePhoto/beer/3.jpg'
		Pic[3] = '/images/storePhoto/beer/4.jpg'
		Pic[4] = '/images/storePhoto/beer/5.jpg'
		Pic[5] = '/images/storePhoto/beer/6.jpg'
		Pic[6] = '/images/storePhoto/beer/7.jpg'
		Pic[7] = '/images/storePhoto/beer/8.jpg'
		Pic[8] = '/images/storePhoto/beer/9.jpg'
		break;

	case "wine.php":
		Pic[0] = '/images/storePhoto/wine/1.jpg'
		Pic[1] = '/images/storePhoto/wine/2.jpg'
		Pic[2] = '/images/storePhoto/wine/3.jpg'
		Pic[3] = '/images/storePhoto/wine/4.jpg'
		break;

	case "liquor.php":
		Pic[0] = '/images/storePhoto/liquor/1.jpg'
		Pic[1] = '/images/storePhoto/liquor/2.jpg'
		Pic[2] = '/images/storePhoto/liquor/3.jpg'
		Pic[3] = '/images/storePhoto/liquor/4.jpg'
		break;

	case "wineClub.php":
		Pic[0] = '/images/storePhoto/wineClub/1.jpg'
		Pic[1] = '/images/storePhoto/wineClub/2.jpg'
		Pic[2] = '/images/storePhoto/wineClub/3.jpg'
		Pic[3] = '/images/storePhoto/wineClub/4.jpg'
		Pic[4] = '/images/storePhoto/wineClub/5.jpg'
		Pic[5] = '/images/storePhoto/wineClub/6.jpg'
		Pic[6] = '/images/storePhoto/wineClub/7.jpg'
		break;

	case "index.php":
	default:
		Pic[0] = '/images/storePhoto/1.jpg'
		Pic[1] = '/images/storePhoto/2.jpg'
		Pic[2] = '/images/storePhoto/3.jpg'
		Pic[3] = '/images/storePhoto/4.jpg'
		Pic[4] = '/images/storePhoto/5.jpg'
		Pic[5] = '/images/storePhoto/6.jpg'
		Pic[6] = '/images/storePhoto/7.jpg'
		Pic[7] = '/images/storePhoto/8.jpg'
		Pic[8] = '/images/storePhoto/9.jpg'
		break;
	}

	j = 0
	p = Pic.length
	for (i = 0; i < p; i++){
		preLoad[i] = new Image()
		preLoad[i].src = Pic[i]
	}
}

// =======================================
// do not edit anything below this line
// =======================================

function runSlideShow(){
   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 = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}