	
	var opacitySpeed = 2;	// Speed of opacity - switching between large images - Lower = faster
	var opacitySteps = 10; 	// Also speed of opacity - Higher = faster
	
	/* Don't change anything below here */
	var slideshow_largeImage = false;
	var slideshow_imageToShow = false;
	var slideshow_currentOpacity = 100;
	
	var currentUnqiueOpacityId = false;
	var slideshow_currentActiveImage = false;
	var slideshow_thumbDiv = false;
	var slideshow_thumbSlideInProgress = false;
	
	var browserIsOpera = navigator.userAgent.indexOf('Opera')>=0?true:false;
	var leftArrowObj;
	var rightArrowObj;
	var thumbsColIndex = 1;
	var thumbsLeftPos = false;
	
	function initGalleryScript()
	{
		slideshow_largeImage = document.getElementById('slideshow_largeImage').getElementsByTagName('IMG')[0];
		var innerDiv = document.getElementById('slideshow_thumbs_inner');
		slideshow_slideWidth = innerDiv.getElementsByTagName('DIV')[0].offsetWidth;
		slideshow_thumbDiv = document.getElementById('slideshow_thumbs_inner');
		slideshow_thumbDiv.style.left = '0px';
		
		var subDivs = slideshow_thumbDiv.getElementsByTagName('DIV');
		slideshow_thumbTotalWidth = 0;
		var tmpLeft = 0;
		for(var no=0;no<subDivs.length;no++){
			if(subDivs[no].className=='strip_of_thumbnails'){
				slideshow_thumbTotalWidth = slideshow_thumbTotalWidth + slideshow_slideWidth;
				subDivs[no].style.left = tmpLeft + 'px';
				subDivs[no].style.top = '0px';
				tmpLeft = tmpLeft + subDivs[no].offsetWidth;
			}
		}

		slideshow_viewableWidth = document.getElementById('slideshow_thumbs').offsetWidth;
		
		
		slideshow_currentActiveImage = slideshow_thumbDiv.getElementsByTagName('A')[0].getElementsByTagName('IMG')[0];
		slideshow_currentActiveImage.className='activeImage';
	}
	
	function showPreview(imagePath,inputObj)
	{		
		if(slideshow_currentActiveImage){
			if(slideshow_currentActiveImage==inputObj.getElementsByTagName('IMG')[0])return;
			slideshow_currentActiveImage.className='';
		}
		slideshow_currentActiveImage = inputObj.getElementsByTagName('IMG')[0];
		slideshow_currentActiveImage.className='activeImage';
		
		slideshow_imageToShow = imagePath;
		var tmpImage = new Image();
		tmpImage.src = imagePath;
		currentUnqiueOpacityId = Math.random();
		moveOpacity(opacitySteps*-1,currentUnqiueOpacityId);
	}
	
	function setOpacity()
	{
		if(document.all)
		{
			slideshow_largeImage.style.filter = 'alpha(opacity=' + slideshow_currentOpacity + ')';
		}else{
			slideshow_largeImage.style.opacity = slideshow_currentOpacity/100;
		}		
	}
	function moveOpacity(speed,uniqueId)
	{
		
		if(browserIsOpera){
			slideshow_largeImage.src = slideshow_imageToShow;
			return;
		}
		
		slideshow_currentOpacity = slideshow_currentOpacity + speed;
		if(slideshow_currentOpacity<=5 && speed<0){
		
			var tmpParent = slideshow_largeImage.parentNode; 
			slideshow_largeImage.parentNode.removeChild(slideshow_largeImage);
			slideshow_largeImage = document.createElement('IMG');
			tmpParent.appendChild(slideshow_largeImage);
			setOpacity();
			slideshow_largeImage.src = slideshow_imageToShow;
		
			speed=opacitySteps;
		}
		if(slideshow_currentOpacity>=99 && speed>0)slideshow_currentOpacity=99;		
		setOpacity();	
		if(slideshow_currentOpacity>=99 && speed>0)return;		
		if(uniqueId==currentUnqiueOpacityId)setTimeout('moveOpacity(' + speed + ',' + uniqueId + ')',opacitySpeed);		
	}