
// array of pic names, maybe paths too
var arrPic2 = fetchImgNames2() 
// array of preloaded image objects
var preLoad2 = null
var t2
var j2 = 0
var p2 = 0



if (arrPic2 != null)
{
	p2 = arrPic2.length
	preLoad2 = new Array()
	for (i = 0; i < p2; i++)
	{
	   preLoad2[i] = new Image()
	   preLoad2[i].src = arrPic2[i]
	}
	runSlideShow2()
}

/**
 * Entry point. Idea is to get pic-names from a tag by id and the img-names
 * are in the tags value.
 */
function runSlideShow2()
{

		var slideShowSpeed = 4000
		var crossFadeDuration = 3

   if (document.all){
      document.images.SlideShow2.style.filter="blendTrans(duration=2)"
      document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow2.filters.blendTrans.Apply()      
   }
   document.images.SlideShow2.src = preLoad2[j2].src
   if (document.all){
      document.images.SlideShow2.filters.blendTrans.Play()
   }
   j2 = j2 + 1
   if (j2 > (p2-1)) j2=0
   t2 = setTimeout('runSlideShow2()', slideShowSpeed)
}

function fetchImgNames2()
{
		var strImgTagName = "imgNames2"
		var arrPic = null
		var objElement = document.getElementById(strImgTagName)
		
		if (objElement != null)
		{
			var strNames = objElement.value
			// alert("got name? " + strNames)
			
			arrPic = strNames.split("|")
	
		}
		else
		{
			alert("Images tag: " +strImgTagName+ " was not set!");
		}

		return arrPic
}
  


