	var interval = 6000;
	var random_display = 0;
	var imageNum = 0;

  
   var myAnim;

	function imageItem(image_location) {
		this.image_item = new Image();
		this.image_item.src = image_location;
	}
	function get_ImageItemLocation(imageObj) { 
		return(imageObj.image_item.src)
	}

	function getNextImage() {    
		if (random_display) {
			imageNum = randNum(0, totalImages-1);
		}
		else {
			imageNum = (imageNum+1) % totalImages;
		}

 	var new_image = get_ImageItemLocation(imageArray[imageNum]);
	return(new_image);
	}

	function getPrevImage() {
		imageNum = (imageNum-1) % totalImages;
		var new_image = get_ImageItemLocation(imageArray[imageNum]);
		return(new_image);
	}

	function switchImage(place) {
    
    var img = document.getElementById(place);
    img.style.visibility = 'visible';
    
		var new_image = getNextImage();
		img.src = new_image;		
    
    
		var recur_call = "setTimeout('fadeOut.animate()', 4200);switchImage('"+place+"');";
		timerID = setTimeout(recur_call, interval);
		
		if (imageNum==1)
     setTimeout('fadeOut.animate()', 4500);
		recur_call = "fadeIn.animate();";
		timerID = setTimeout(recur_call, interval);
		
		
		
        }

