	var imageArray = Array('http://wieler.com/harvest.slideshow/slides/harvest_live_grow.jpg','http://wieler.com/harvest.slideshow/slides/harvest_modern_rural.jpg','http://wieler.com/harvest.slideshow/slides/harvest_preserved.jpg','http://wieler.com/harvest.slideshow/slides/harvest_architecture.jpg','http://wieler.com/harvest.slideshow/slides/harvest_jordan_lake.jpg','http://wieler.com/harvest.slideshow/slides/harvest_properties.jpg','http://wieler.com/harvest.slideshow/slides/harvest_trails.jpg','http://wieler.com/harvest.slideshow/slides/harvest_working_farm.jpg','http://wieler.com/harvest.slideshow/slides/harvest_diverse_landscape.jpg','http://wieler.com/harvest.slideshow/slides/harvest_room_to_grow.jpg');
	var linkArray = Array();
//	var linkArray = Array('http://wieler.com/communities/harvest/');	
	var autoSwitch = true;  // automatically start slideshow
        var autoSpeed = 4000;   // pause between each slide
        var fadeSpeed = 7;      // crossfade speed (1-100)
	function stopButton() {
		clearInterval(autoSwitchInt);
		autoSwitch = false;
		drawImageNav(); 
	}
	function playButton() {
		autoSwitch = true; 
		step(1);
		drawImageNav(); 
	}
	function jumpToImage(imageNo) {
		clearInterval(autoSwitchInt);
		currentImage = imageNo;
		loadImage();
		drawImageNav(); 
	}
	function drawImageNav() {
		var divHTML = "";
		for (var i=0;i<imageArray.length;i++) {
			if (i == currentImage) {
				divHTML += '<img border="0" src="http://wieler.com/harvest.slideshow/icons/icon_on.gif" alt="" class="nav_icons" />';
			}
			else  {
				divHTML += '<a href="javascript:jumpToImage('+i+')"><img border="0" src="http://wieler.com/harvest.slideshow/icons/icon_off.gif" alt="" class="nav_icons" /></a>';
			}
		}
		var imageNav = document.getElementById("slide_nav_elements");
		divHTML += '<a href="javascript:step(-1);"><img border="0" src="http://wieler.com/harvest.slideshow/icons/icon_prev.gif" alt="" /></a>';
		divHTML += '<a href="javascript:step(1);"><img border="0" src="http://wieler.com/harvest.slideshow/icons/icon_next.gif" alt="" /></a>';
		if (imageArray.length > 1) {
			if (autoSwitch) {
				divHTML += '<a href="javascript:stopButton();"><img style="width: 55px;" border="0" src="http://wieler.com/harvest.slideshow/icons/icon_pause.gif" alt="" /></a>';
			}
			else {
				divHTML += '<a href="javascript:playButton();"><img style="width: 55px;" border="0" src="http://wieler.com/harvest.slideshow/icons/icon_play.gif" alt="" /></a>';
			}
		}
//		divHTML += '<a href="http://wieler.com/"><img border="0" src="http://wieler.com/harvest.slideshow/icons/icon_archives.gif" alt="archive" /></a>';		
		imageNav.innerHTML = divHTML;
	}

	var callBackFunction = "drawImageNav";
	var fadeInt;
	var autoSwitchInt;
	var currentOp;
	var currentImage = 0;
	var loadStatus = 1;
	var didCallBack;
	if (!autoSpeed) {	
		var autoSpeed = 4000;
	}
	if (!fadeSpeed) {
		var fadeSpeed = 7;
	}
	function getImageLink() {
		if (linkArray.length > 0) {
			loadStatus = 1;
			document.location = linkArray[0];
			alert(linkArray[0]);
//			document.location = linkArray[currentImage];			
		}
	}
	function setMainImage() {
		if (autoSwitch) {
			autoSwitchInt = setInterval("step(1)",autoSpeed);
		}
		var topImage = document.getElementById("topLayerImage");
		topImage.src = imageArray[0];
//	alert(imageArray[0]);
		
	}
	function step(direction) {
		clearInterval(autoSwitchInt);
		if (loadStatus == 1) {
			loadStatus = 0;
			currentImage = currentImage + direction;
			if (currentImage >= imageArray.length) {
				currentImage = 0;
			}
			else if (currentImage < 0) {
				currentImage = imageArray.length - 1;
			}
			loadImage();
		}
	}
	function loadImage() {
		clearInterval(fadeInt);
		didCallBack = false;
		var newImage = document.getElementById("bottomLayerImage");
		newImage.onload = function() {
			var top = document.getElementById("topLayer");
			setOpacity(top, 100);
			currentOp = 100;
			fadeInt = setInterval("fadeTop()",10);
		}
		newImage.src = imageArray[currentImage];
	}
	function fadeTop() {
		currentOp = currentOp - fadeSpeed;
		if ((currentOp <= 50)&&(! didCallBack)&&(callBackFunction)) {
			eval(callBackFunction+"()");
			didCallBack = true;
		}
		if (currentOp >= 0) {
			var top = document.getElementById("topLayer");
			setOpacity(top, currentOp);
		}
		else {
			var newImage = document.getElementById("topLayerImage");
			newImage.onload = function() {
				document.getElementById("topLayer").style.opacity = 1;
				loadStatus = 1;

			}
			newImage.src = imageArray[currentImage];
			clearInterval(fadeInt);
			if (autoSwitch) {
				autoSwitchInt = setInterval("step(1)",autoSpeed);
			}
		}
	}
	function setOpacity(obj, opacity) {
  		opacity = (opacity == 100)?99.999:opacity;
	  	// IE/Win
  		obj.style.filter = "alpha(opacity:"+opacity+")";
  		// Safari<1.2, Konqueror
  		obj.style.KHTMLOpacity = opacity/100;
  
  		// Older Mozilla and Firefox
  		obj.style.MozOpacity = opacity/100;
  
  		// Safari 1.2, newer Firefox and Mozilla, CSS3
  		obj.style.opacity = opacity/100;
}