﻿
	
	
	var slideshow3_noFading = false;
	var slideshow3_timeBetweenSlides = 1500;	// Amount of time between each image(1000 = 1 second)
	var slideshow3_fadingSpeed = 10;	// Speed of fading	(Lower value = faster)
	
	var slideshow3_galleryContainer;	// Reference to the gallery div
	var slideshow3_galleryWidth;	// Width of gallery
	var slideshow3_galleryHeight;	// Height of galery
	var slideshow3_slideIndex = -1;	// Index of current image shown
	var slideshow3_slideIndexNext = false;	// Index of next image shown
	var slideshow3_imageDivs = new Array();	// Array of image divs(Created dynamically)
	var slideshow3_currentOpacity = 100;	// Initial opacity
	var slideshow3_imagesInGallery = false;	// Number of images in gallery
	var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;
	function createParentDivs3(imageIndex3)
	{
		if(imageIndex3==slideshow3_imagesInGallery){			
			showGallery3();
		}else{
			var imgObj3 = document.getElementById('galleryImage' + imageIndex3);	
			if(Opera)imgObj3.style.position = 'static';
			slideshow3_imageDivs[slideshow3_imageDivs.length] =  imgObj3;
			imgObj3.style.visibility = 'hidden';	
			imageIndex3++;
			createParentDivs3(imageIndex3);	
		}		
	}
	
	function showGallery3()
	{
		if(slideshow3_slideIndex==-1)slideshow3_slideIndex=0; else slideshow3_slideIndex++;	// Index of next image to show
		if(slideshow3_slideIndex==slideshow3_imageDivs.length)slideshow3_slideIndex=0;
		slideshow3_slideIndexNext = slideshow3_slideIndex+1;	// Index of the next next image
		if(slideshow3_slideIndexNext==slideshow3_imageDivs.length)slideshow3_slideIndexNext = 0;
		
		slideshow3_currentOpacity=100;	// Reset current opacity

		// Displaying image divs
		slideshow3_imageDivs[slideshow3_slideIndex].style.visibility = 'visible';
		if(Opera)slideshow3_imageDivs[slideshow3_slideIndex].style.display = 'inline';
		if(navigator.userAgent.indexOf('Opera')<0){
			slideshow3_imageDivs[slideshow3_slideIndexNext].style.visibility = 'visible';
		}
		
		if(document.all){	// IE rules
			slideshow3_imageDivs[slideshow3_slideIndex].style.filter = 'alpha(opacity=100)';
			slideshow3_imageDivs[slideshow3_slideIndexNext].style.filter = 'alpha(opacity=1)';
		}else{
			slideshow3_imageDivs[slideshow3_slideIndex].style.opacity = 0.99;	// Can't use 1 and 0 because of screen flickering in FF
			slideshow3_imageDivs[slideshow3_slideIndexNext].style.opacity = 0.01;
		}		
		

		setTimeout('revealImage3()',slideshow3_timeBetweenSlides);		
	}
	
	function revealImage3()
	{
		if(slideshow3_noFading){
			slideshow3_imageDivs[slideshow3_slideIndex].style.visibility = 'hidden';
			if(Opera)slideshow3_imageDivs[slideshow3_slideIndex].style.display = 'none';
			showGallery3();
			return;
		}
		slideshow3_currentOpacity--;
		if(document.all){
			slideshow3_imageDivs[slideshow3_slideIndex].style.filter = 'alpha(opacity='+slideshow3_currentOpacity+')';
			slideshow3_imageDivs[slideshow3_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow3_currentOpacity)+')';
		}else{
			slideshow3_imageDivs[slideshow3_slideIndex].style.opacity = Math.max(0.01,slideshow3_currentOpacity/100);	// Can't use 1 and 0 because of screen flickering in FF
			slideshow3_imageDivs[slideshow3_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow3_currentOpacity/100)));
		}
		if(slideshow3_currentOpacity>0){
			setTimeout('revealImage3()',slideshow3_fadingSpeed);
		}else{
			slideshow3_imageDivs[slideshow3_slideIndex].style.visibility = 'hidden';	
			if(Opera)slideshow3_imageDivs[slideshow3_slideIndex].style.display = 'none';		
			showGallery3();
		}
	}
	
	function initImageGallery3()
	{
		slideshow3_galleryContainer = document.getElementById('imageSlideshowHolder3');
		slideshow3_galleryWidth = slideshow3_galleryContainer.clientWidth;
		slideshow3_galleryHeight = slideshow3_galleryContainer.clientHeight;
		galleryImgArray1 = slideshow3_galleryContainer.getElementsByTagName('IMG');
		for(var no=0;no<galleryImgArray1.length;no++){
			galleryImgArray1[no].id = 'galleryImage' + no;
		}
		slideshow3_imagesInGallery = galleryImgArray1.length;
		createParentDivs3(0);		
		
	}
	



