// This script cycles through two sets of images,
// changing one image and then the other after a
// delay.  The next image is preloaded while the
// current image is being displayed, so that the
// image-swap will be immediate.

var timeDelay = 5; // time delay in seconds
var Pix = new Array
("images/cycled_images/poetry_dk_rd_dtl_195w.jpg" 
,"images/cycled_images/poetry_fire_dtl_195w.jpg" 
,"images/cycled_images/poetry_angel_dtl_195w.jpg" 
,"images/cycled_images/poetry_monster_dtl_195w.jpg"
,"images/cycled_images/poetry_rose_dtl_195w.jpg"
,"images/cycled_images/poetry_roots_dtl_195w.jpg"
,"images/cycled_images/poetry_window_dtl_195w.jpg"
,"images/cycled_images/poetry_forest_dtl_195w.jpg"
);
var Pix1 = new Array
("images/cycled_images/marg_beer_baby_dtl_193w.jpg"
,"images/cycled_images/marg_brain_dtl_193w.jpg"
,"images/cycled_images/marg_balloon_dtl_193w.jpg"
,"images/cycled_images/marg_worm_dtl_193w.jpg"
,"images/cycled_images/marg_pic_dtl_193w.jpg"
,"images/cycled_images/marg_pi_dtl_193w.jpg"
,"images/cycled_images/marg_wal_dtl_193w.jpg"
,"images/cycled_images/marg_book_dtl_193w.jpg"
);
var howMany = Pix.length;
var howMany1 = Pix1.length;
timeDelay *= 1000;
var PicCurrentNum = 1;
var PicCurrentNum1 = 1;
var PicCurrent = new Image(195,140);
var PicCurrent1 = new Image(193,271);
var imgLoc = 0;
PicCurrent.src = Pix[PicCurrentNum];
PicCurrent1.src = Pix1[PicCurrentNum1];
function startPix() 
{
	setInterval("slideshow()", timeDelay);
}
function slideshow()
{
	if (imgLoc == 0) 
	{
		imgLoc = 1;
		document["poetry_img"].style.filter="blendTrans(duration=2)";
		document["poetry_img"].filters.blendTrans.apply();
		document["poetry_img"].src = PicCurrent.src;
		document["poetry_img"].filters.blendTrans.play();
		PicCurrentNum++;
		if (PicCurrentNum == howMany) 
			PicCurrentNum = 0;
		PicCurrent.src = Pix[PicCurrentNum];
	}
	else 
	{
		imgLoc = 0;
		document["marg_img"].style.filter="blendTrans(duration=2)";
		document["marg_img"].filters.blendTrans.apply();
		document["marg_img"].src = PicCurrent1.src;
		document["marg_img"].filters.blendTrans.play();
		PicCurrentNum1++;
		if (PicCurrentNum1 == howMany1) 
			PicCurrentNum1 = 0;
		PicCurrent1.src = Pix1[PicCurrentNum1];
	}
}
