/*****************************************************
TRANSITION BETWEEN IMAGES */

	var preLoad = new Array();
	var currentImg = 0;
	var t;

	// Preload images
	function preloadImg() {
		for (i = 0; i < arrLength; i++) { 
			preLoad[i] = new Image();
			preLoad[i].src = imgArr[i];
		}
	}

	// Slideshow 
	function runSlideShow(filterFunction) {
		var filterable = false;

		// If Filters work 
		if ((document.images.SlideShow) && (document.images.SlideShow.style) && (document.images.SlideShow.style.filters)) {
			filterable = true;
			target = document.images.SlideShow;
		}

		if (document.getElementById("SlideShow")) {
			filterable = true;
			target = document.getElementById("SlideShow");
		}

		// Checks to make sure it's preloaded 
		if (preLoad[currentImg].complete) {
			if (filterable) {
				if (filterFunction == null) filterFunction = "blendTrans(duration=" + duration + ")"

				target.style.filter = filterFunction;

				if ((target.filters) && (target.filters[0])) {
					target.filters[0].Apply();
					target.filters[0].Play();
				}
			}

			document.images.SlideShow.src = preLoad[currentImg].src;

			if (document.getElementById) { document.getElementById("caption").innerHTML = captionArr[currentImg]; }
			else if (document.all) { document.caption.innerHTML = captionArr[currentImg]; }
			else if (document.layers) {
				document.layers.caption.document.write(captionArr[currentImg]);
				document.layers.caption.document.close();
			}

			if (document.getElementById) {
				document.getElementById("link").onclick = function() {
					window.location.href= linkArr[currentImg-1];	// why -1? no idea 
				}
			}

			currentImg = currentImg + 1;
			if (currentImg > (arrLength - 1)) currentImg = 0;

			t = setTimeout('runSlideShow()', speed);
		}
	}


