	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, November 2005

	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.

	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.

	Thank you!

	www.dhtmlgoodies.com
	Alf Magne Kalleland

	************************************************************************************************************/

	var slideshow01_noFading = false;
	var slideshow01_timeBetweenSlides = 1000;	// Amount of time between each image(1000 = 1 second)
	var slideshow01_fadingSpeed = 10;	// Speed of fading	(Lower value = faster)

	var slideshow01_galleryContainer;	// Reference to the gallery div
	var slideshow01_galleryWidth;	// Width of gallery
	var slideshow01_galleryHeight;	// Height of galery
	var slideshow01_slideIndex = -1;	// Index of current image shown
	var slideshow01_slideIndexNext = false;	// Index of next image shown
	var slideshow01_imageDivs = new Array();	// Array of image divs(Created dynamically)
	var slideshow01_currentOpacity = 100;	// Initial opacity
	var slideshow01_imagesInGallery = false;	// Number of images in gallery
	var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;
	function createParentDivs(imageIndex)
	{
		if(imageIndex==slideshow01_imagesInGallery){
			showGallery();
		}else{
			var imgObj = document.getElementById('galleryImage' + imageIndex);
			if(Opera)imgObj.style.position = 'static';
			slideshow01_imageDivs[slideshow01_imageDivs.length] =  imgObj;
			imgObj.style.visibility = 'hidden';
			imageIndex++;
			createParentDivs(imageIndex);
		}
	}

	function showGallery()
	{
		if(slideshow01_slideIndex==-1)slideshow01_slideIndex=0; else slideshow01_slideIndex++;	// Index of next image to show
		if(slideshow01_slideIndex==slideshow01_imageDivs.length)slideshow01_slideIndex=0;
		slideshow01_slideIndexNext = slideshow01_slideIndex+1;	// Index of the next next image
		if(slideshow01_slideIndexNext==slideshow01_imageDivs.length)slideshow01_slideIndexNext = 0;

		slideshow01_currentOpacity=100;	// Reset current opacity

		// Displaying image divs
		slideshow01_imageDivs[slideshow01_slideIndex].style.visibility = 'visible';
		if(Opera)slideshow01_imageDivs[slideshow01_slideIndex].style.display = 'inline';
		if(navigator.userAgent.indexOf('Opera')<0){
			slideshow01_imageDivs[slideshow01_slideIndexNext].style.visibility = 'visible';
		}

		if(document.all){	// IE rules
			slideshow01_imageDivs[slideshow01_slideIndex].style.filter = 'alpha(opacity=100)';
			slideshow01_imageDivs[slideshow01_slideIndexNext].style.filter = 'alpha(opacity=1)';
		}else{
			slideshow01_imageDivs[slideshow01_slideIndex].style.opacity = 0.99;	// Can't use 1 and 0 because of screen flickering in FF
			slideshow01_imageDivs[slideshow01_slideIndexNext].style.opacity = 0.01;
		}


		setTimeout('revealImage()',slideshow01_timeBetweenSlides);
	}

	function revealImage()
	{
		if(slideshow01_noFading){
			slideshow01_imageDivs[slideshow01_slideIndex].style.visibility = 'hidden';
			if(Opera)slideshow01_imageDivs[slideshow01_slideIndex].style.display = 'none';
			showGallery();
			return;
		}
		slideshow01_currentOpacity--;
		if(document.all){
			slideshow01_imageDivs[slideshow01_slideIndex].style.filter = 'alpha(opacity='+slideshow01_currentOpacity+')';
			slideshow01_imageDivs[slideshow01_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow01_currentOpacity)+')';
		}else{
			slideshow01_imageDivs[slideshow01_slideIndex].style.opacity = Math.max(0.01,slideshow01_currentOpacity/100);	// Can't use 1 and 0 because of screen flickering in FF
			slideshow01_imageDivs[slideshow01_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow01_currentOpacity/100)));
		}
		if(slideshow01_currentOpacity>0){
			setTimeout('revealImage()',slideshow01_fadingSpeed);
		}else{
			slideshow01_imageDivs[slideshow01_slideIndex].style.visibility = 'hidden';
			if(Opera)slideshow01_imageDivs[slideshow01_slideIndex].style.display = 'none';
			showGallery();
		}
	}

	function initSlide01()
	{
		slideshow01_galleryContainer = document.getElementById('slide01');
		slideshow01_galleryWidth = slideshow01_galleryContainer.clientWidth;
		slideshow01_galleryHeight = slideshow01_galleryContainer.clientHeight;
		galleryImgArray = slideshow01_galleryContainer.getElementsByTagName('IMG');
		for(var no=0;no<galleryImgArray.length;no++){
			galleryImgArray[no].id = 'galleryImage' + no;
		}
		slideshow01_imagesInGallery = galleryImgArray.length;
		createParentDivs(0);

	}