			var rotate_delay = 5000; // delay in milliseconds (5000 = 5 secs)
			current = 0;

			function ap(text) 
			{
				document.Form1.slidebutton.value = (text == "Stop Show") ? "Start Show" : "Stop Show";
				rotate();
			}

			function updateImage(imageId, current)
			{
				document.images.show.src = "slideshow/" + imageId + "-large.jpg";
				document.Form1.slide.selectedIndex = current;
			}

			function next() 
			{
				if (document.Form1.slide[current+1]) {
				document.images.show.src = document.Form1.slide[current+1].value;
				document.Form1.slide.selectedIndex = ++current;
				}
				else first();
			}

			function previous() 
			{
				if (current-1 >= 0) {
				document.images.show.src = document.Form1.slide[current-1].value;
				document.Form1.slide.selectedIndex = --current;
				}
				else last();
			}

			function first() 
			{
				current = 0;
				document.images.show.src = document.Form1.slide[0].value;
				document.Form1.slide.selectedIndex = 0;
			}

			function last() 
			{
				current = document.Form1.slide.length-1;
				document.images.show.src = document.Form1.slide[current].value;
				document.Form1.slide.selectedIndex = current;
			}


			function rotate() 
			{
				if (document.Form1.slidebutton.value == "Stop Show") 
				{
					if (document.all)
						{
						document.images.show.style.filter="blendTrans(duration=1)"
						document.images.show.style.filter="blendTrans(duration=crossFadeDuration)"
						document.images.show.filters.blendTrans.Apply()
						document.images.show.filters.blendTrans.Play()      
						}
					current = (current == document.Form1.slide.length-1) ? 0 : current+1;
					document.images.show.src = document.Form1.slide[current].value;
					document.Form1.slide.selectedIndex = current;
					
					//This code is to preload the next image while the show is running
					nextimage = new Image();
					nextimage.src = document.Form1.slide[current+1];
					
					window.setTimeout("rotate()", rotate_delay);
				}
			}			
			
			
//Please do not edit below
duration=4;
ads=[]; ct=0;

function switchAd()
{
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) 
	{
	document["Ad_Image"].src = ads[ct=n].src;
	}
	ads[n=(ct+1)%src.length] = new Image;
	ads[n].src = src[n];
	setTimeout("switchAd()",duration*1000);
}
			
function doLink()
	{
	location.href = url[ct];
	} 
	onload = function()
	{
	if (document.images)
	switchAd();
	}			
			
			
			
//set image paths
src = ["image1.gif", "image2.gif", "image3.gif", "image4.gif"]

//set corresponding urls
url = ["http://freewarejava.com", "http://javascriptkit.com", "http://dynamicdrive.com", "http://www.geocities.com"]
