	// You can modify these three values
	var slideshow2_noFading = false;	// Just normal show/hide without fading ?

	/* Don't change any of these values */

	var slideshow2_galleryContainer	= new Array();		// Reference to the gallery div
	var slideshow2_slideIndex 			= new Array();		// Index of current image shown
	var slideshow2_slideIndexNext 	= new Array();		// Index of next image shown
	var slideshow2_currentOpacity 	= new Array();		// Initial opacity
	slideshow2_imageDivs						= new Array();		// Array of image divs(Created dynamically)

	for(var no=0;no<10;no++)
	{
		slideshow2_slideIndex[no] 		= -1;				// Index of current image shown
		slideshow2_slideIndexNext[no] = false;		// Index of next image shown
		slideshow2_currentOpacity[no] = 100;			// Initial opacity
		slideshow2_imageDivs[no] 			= new Array();		// Array of image divs(Created dynamically)
	}

	function getGalleryImageSize(ShowNo,DivNm,imageIndex,FADESpeed,WaitTimer,ImgCnt,DivWidth,DivHeight)
	{
		if(imageIndex==ImgCnt){
			showGallery(ShowNo,FADESpeed,WaitTimer);
			
		}else{
			var imgObj = document.getElementById('galleryImage' +ShowNo + imageIndex);
			var imgWidth = imgObj.width;
			var imgHeight = imgObj.height;

			var tmpDiv = document.createElement('Temp'+DivNm);
			tmpDiv.id = 'galleryDiv' + imageIndex;
			tmpDiv.style.visibility = 'hidden';
			tmpDiv.style.width 			= DivWidth + 'px';
			tmpDiv.style.height 		= DivHeight + 'px';
			tmpDiv.style.position 	= 'absolute';
			slideshow2_galleryContainer[ShowNo].appendChild(tmpDiv);

			tmpDiv.appendChild(imgObj);

			slideshow2_imageDivs[ShowNo].push(tmpDiv);
			imageIndex++;
			getGalleryImageSize(ShowNo,DivNm,imageIndex,FADESpeed,WaitTimer,ImgCnt,DivWidth,DivHeight);
		}
	}
	function showGallery(ShowNo,FADESpeed,WaitTimer)
	{
		if(slideshow2_slideIndex[ShowNo]==-1)
			slideshow2_slideIndex[ShowNo]=0; 
		else 
			slideshow2_slideIndex[ShowNo]++;	// Index of next image to show
			
		if(slideshow2_slideIndex[ShowNo]==slideshow2_imageDivs[ShowNo].length)
			slideshow2_slideIndex[ShowNo]=0;
		
		slideshow2_slideIndexNext[ShowNo] = slideshow2_slideIndex[ShowNo]+1;	// Index of the next next image
		
		if(slideshow2_slideIndexNext[ShowNo]==slideshow2_imageDivs[ShowNo].length)
			slideshow2_slideIndexNext[ShowNo] = 0;

		galleryImgWaitTimer = document.getElementById(WaitTimer+slideshow2_slideIndex[ShowNo]).value;
		
		slideshow2_currentOpacity[ShowNo]=100;	// Reset current opacity

		// Displaying image divs
		slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.visibility = 'visible';
		if(navigator.userAgent.indexOf('Opera')<0){
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndexNext[ShowNo]].style.visibility = 'visible';
		}

		if(document.all){	// IE rules
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.filter = 'alpha(opacity=100)';
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndexNext[ShowNo]].style.filter = 'alpha(opacity=1)';
		}else{
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.opacity = 0.99;	// Can't use 1 and 0 because of screen flickering in FF
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndexNext[ShowNo]].style.opacity = 0.01;
		}
		setTimeout("revealImage('"+ShowNo+"','"+FADESpeed+"','"+WaitTimer+"')",galleryImgWaitTimer);
	}

	function revealImage(ShowNo,FADESpeed,WaitTimer)
	{
		if(slideshow2_noFading){
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.visibility = 'hidden';
			showGallery(ShowNo,FADESpeed,WaitTimer);
			return;
		}
		slideshow2_currentOpacity[ShowNo]--;
		if(document.all){
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.filter = 'alpha(opacity='+slideshow2_currentOpacity[ShowNo]+')';
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndexNext[ShowNo]].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity[ShowNo])+')';
		}else{
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.opacity = Math.max(0.01,slideshow2_currentOpacity[ShowNo]/100);
			// Can't use 1 and 0 because of screen flickering in FF
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndexNext[ShowNo]].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity[ShowNo]/100)));
		}

		if(slideshow2_currentOpacity[ShowNo]>0){
			setTimeout("revealImage('"+ShowNo+"','"+FADESpeed+"','"+WaitTimer+"')",document.getElementById(FADESpeed+slideshow2_slideIndex[ShowNo]).value);
		}else{
			slideshow2_imageDivs[ShowNo][slideshow2_slideIndex[ShowNo]].style.visibility = 'hidden';
			showGallery(ShowNo,FADESpeed,WaitTimer);
		}
	}

	function initImageGallery(ShowNo,DivNm,FADESpeed,WaitTimer,ImgCnt,DivWidth,DivHeight)
	{
		slideshow2_galleryContainer[ShowNo] = document.getElementById(DivNm);
		galleryImgArray = slideshow2_galleryContainer[ShowNo].getElementsByTagName('IMG');

		for(var no=0;no<ImgCnt;no++)
		{
			galleryImgArray[no].id = 'galleryImage' +ShowNo + no;
		}
		var imageIndex = 0;
		getGalleryImageSize(ShowNo,DivNm,imageIndex,FADESpeed,WaitTimer,ImgCnt,DivWidth,DivHeight);
	}
