
		// You can modify these three values
		var slideshow2_noFading = false;	// Just normal show/hide without fading ?
		var slideshow2_timeBetweenSlides = 1500;	// Amount of time between each image(1000 = 1 second)
		var slideshow2_fadingSpeed = 20;	// Speed of fading


		/* Don't change any of these values */
		var slideshow2_galleryHeigh;	// Height of galery
		var slideshow2_galleryContainer;	// Reference to the gallery div
		var slideshow2_galleryWidth;	// Width of gallery
		var slideshow2_slideIndex = -1;	// Index of current image shown
		var slideshow2_slideIndexNext = false;	// Index of next image shown
		var slideshow2_imageDivs = new Array();	// Array of image divs(Created dynamically)
		var slideshow2_currentOpacity = 100;	// Initial opacity
		var slideshow2_imagesInGallery = false;	// Number of images in gallery
		var slideshow_Text = new Object;
		var slideshow_Lookup = new Object;
		var slideshow_catLookup = new Object;
		function getGalleryImageSize(imageIndex)
		{

			if(imageIndex==slideshow2_imagesInGallery){
				//debugObj.log("showGallery");
				showGallery();
			}else{
				var imgObj = document.getElementById('galleryImage' + imageIndex);
				var imgWidth = imgObj.width;
				var imgHeight = imgObj.height;
				if(imgWidth>50){
					//debugObj.group("1.getGalleryImageSize:"+imageIndex);
					var tmpDiv = document.createElement('DIV');
					tmpDiv.id = 'galleryDiv' + imageIndex;
					tmpDiv.style.visibility = 'hidden';
					tmpDiv.className='imageInGallery';
					slideshow2_galleryContainer.appendChild(tmpDiv);
					tmpDiv.appendChild(imgObj);
					//imgObj.style.left = Math.round((slideshow2_galleryWidth - imgWidth)/2)  + "px";
					//imgObj.style.top = Math.round((slideshow2_galleryHeight - imgHeight)/2)  + "px";
					imgObj.style.left = "0px";
					imgObj.style.top = "0px";
					tmpDiv.style.visibility = 'hidden';
					slideshow2_imageDivs.push(tmpDiv);
					imageIndex++;
					//debugObj.groupEnd("getGalleryImageSize:"+imageIndex);
					getGalleryImageSize(imageIndex);
					//arse();

				}else{
					//debugObj.group("2.getGalleryImageSize:"+imageIndex);
					setTimeout('getGalleryImageSize(' + imageIndex + ')',10);
					//debugObj.groupEnd("getGalleryImageSize:"+imageIndex);
				}
			}

		}

		function showGallery()
		{
			//debugObj.group("showGallery");
			if(slideshow2_slideIndex==-1)slideshow2_slideIndex=0; else slideshow2_slideIndex++;	// Index of next image to show
			if(slideshow2_slideIndex==slideshow2_imageDivs.length)slideshow2_slideIndex=0;
			slideshow2_slideIndexNext = slideshow2_slideIndex+1;	// Index of the next next image
			if(slideshow2_slideIndexNext==slideshow2_imageDivs.length)slideshow2_slideIndexNext = 0;

			slideshow2_currentOpacity=100;	// Reset current opacity

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


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


			setTimeout('revealImage()',slideshow2_timeBetweenSlides);
			//debugObj.groupEnd("showGallery");
		}
		var shownItem = 0;
		function revealImage()
		{
			//debugObj.log("* revealImage:"+slideshow2_slideIndex);
			if(slideshow2_noFading){
				//debugObj.log("in no fading");
				slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';
				//showGallery();
				return;
			}
			//debugObj.log("here1");
			slideshow2_currentOpacity--;
			//debugObj.log("here2: Opac="+slideshow2_currentOpacity);
			if(document.all){
				slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity='+slideshow2_currentOpacity+')';
				slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity)+')';
			}else{
				slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = Math.max(0.01,slideshow2_currentOpacity/100);	// Can't use 1 and 0 because of screen flickering in FF
				slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity/100)));
			}
			//debugObj.log("CO="+slideshow2_currentOpacity+" index="+slideshow2_slideIndex+" shownItem="+shownItem);

			if(slideshow2_currentOpacity > 85 && shownItem < 1) {
				shownItem = 1;
				var theText = slideshow_Text[slideshow2_slideIndex+1];
				var theDisplayObj = document.getElementById('thecaption');
				if(theDisplayObj && theText) {
					theDisplayObj.innerHTML = theText;
					var prodid = slideshow_Lookup[slideshow2_slideIndex+1];
					var catid = slideshow_catLookup[prodid];
					theProductLink = "<a class='captionLink' href='prod_detail.php?catid="+catid+"&prodid="+prodid+"'>"+theText+"</a>";

					theDisplayObj.innerHTML = theProductLink;
				}
			}

			if(slideshow2_currentOpacity < 5) {
				var theDisplayObj = document.getElementById('thecaption');
							if(theDisplayObj && theText) {
								theDisplayObj.innerHTML = "";
				}
				shownItem = 0;
			}

			if(slideshow2_currentOpacity>0){
				//debugObj.log("setting timeout");
				setTimeout('revealImage()',slideshow2_fadingSpeed);
			}else{
				slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';



				showGallery();
			}

		}

		function initImageGallery()
		{
			//debugObj.group("init");
			document.getElementById('imageSlideshowHolder').style.display = 'block';
			slideshow2_galleryContainer = document.getElementById('imageSlideshowHolder');
			slideshow2_galleryWidth = 550;
			slideshow2_galleryHeight = 325;
			galleryImgArray = slideshow2_galleryContainer.getElementsByTagName('IMG');
			for(var no=0;no<galleryImgArray.length;no++){
				//debugObj.log("in "+no);
				galleryImgArray[no].id = 'galleryImage' + no;
				var currName = 'textobj'+no;
				var textObj = document.getElementById(currName);
				if(textObj) {
					var theText = textObj.innerHTML;
					slideshow_Text[no] = theText;
				}
			}
			slideshow2_imagesInGallery = galleryImgArray.length;
			var randomnumber=Math.floor(Math.random()*slideshow2_imagesInGallery);
			getGalleryImageSize(0);
			//debugObj.groupEnd();

		}