	var interval = 6; 
	interval *= 1000;

	var image_index = 0;
	image_list = new Array();
	image_list[image_index++] = "images/home-image1.jpg";
	image_list[image_index++] = "images/home-image4.jpg";
	
	image_index = 0;
	image_list2 = new Array();
	image_list2[image_index++] = "images/home-image4.jpg";
	image_list2[image_index++] = "images/home-image1.jpg";

	

	function fadeIn(objId, opacity, secID) {
		if (document.getElementById){
			obj = document.getElementById(objId);
			if (opacity <= 100) {
				setOpacity(obj, opacity);
				opacity += 10;
				window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
			}
		}
	}

	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;
	}


	function rmi0(imageID){
		if (imageID > (image_index-1)) imageID = 0;
		document.getElementById('thephoto1').src = image_list[imageID];

		setOpacity(document.getElementById('thephoto1'), 0);
	
		document.getElementById('thephoto1').style.zIndex = 2;
		document.getElementById('thephoto2').style.zIndex = 1;

		fadeIn('thephoto1', 0, 'thephoto2');
		
		var recur_call = "rmi1("+imageID+")";
		setTimeout(recur_call, interval);

	}

	function rmi1(imageID){
		document.getElementById('thephoto2').src = image_list2[imageID];
		
		setOpacity(document.getElementById('thephoto2'), 0);
		document.getElementById('thephoto2').style.zIndex = 2;
		
		document.getElementById('thephoto1').style.zIndex = 1;
		
		fadeIn('thephoto2', 0, 'thephoto1');
		
		imageID = imageID + 1;

		var recur_call = "rmi0("+imageID+")";
		setTimeout(recur_call, interval);
	}


	function preloadImages(preload_array) {
		for(var loop = 0; loop < preload_array.length; loop++){
		 	var an_image = new Image();
			an_image.src = preload_array[loop];
		}
	}