/***
 This module is copyrighted Pelmorex NewMedia (c)2003

 With those functions you can do a SlideShow on a WebPage
 Simply preload images in a "loopImages" array of Images.
 and then you can call nextMap/prevMap/firstMap/lastMap/
 playMap/stopMap.

													***/
periodMap = 1000;

function showMap() {

	if (typeof oidx == "undefined") { oidx=idx; }
	
	if (document.all && ( ( (idx-oidx)==1 ) || ( (idx-oidx)==-1 ) ) ) {
		document.images.map.style.filter="blendTrans(duration=1)";
		document.images.map.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.map.filters.blendTrans.Apply();
	}
	//document.write("<br>images="+loopImages[idx].src);
	document.images.map.src = loopImages[idx].src;
	if (document.all && ( ( (idx-oidx)==1 ) || ( (idx-oidx)==-1 ) ) ) {
		document.images.map.filters.blendTrans.Play();
	}

	stopMap();
	oidx=idx;
}

function nextMap() {
	idx++;
	if (idx >= loopImages.length) { idx = loopImages.length-1; }
	showMap();
}

function prevMap() {
	idx--;
	if (idx < 1) { idx = 1; }
	showMap();
}

function firstMap() {
	idx = 1;
	showMap();
}

function lastMap() {
	idx = loopImages.length-1;
	showMap();
}

function playMap() {
		tempPeriod=periodMap;
		idx++;
		if (idx>=loopImages.length) { idx=1; }
		if (idx==loopImages.length-1) { tempPeriod = periodMap*3; }
		showMap();
		timerMap = setTimeout("playMap()",tempPeriod);
}

function stopMap() {
	if (typeof timerMap != "undefined") { clearTimeout(timerMap); }
}