//set image paths
imgArr = ['29','30','31','32','33','27','25','26','28']
altArr = ['Scenic Overlook','Coolidge Park','Chattanooga\'s Three Bridges','Canoeing at Ross\'s Landing','Rock Climbing','Hunter Holmberg Bridge','Aquarium Finale','River Pier','Waterfront Finale']
txtArr = ['Chattanooga is a mecca for outdoors enthusiasts who enjoy scenic vistas. The city’s mild climate – the annual average temperature is 60.5 degrees – allows for year-round outdoor pleasures.','Coolidge Park features a beautifully restored antique carousel, a pavilion and an interactive fountain. It\'s a popular park in a community that devotes over 800 acres to public green spaces.','Lookout Mountain rises majestically on the western boundary of Chattanooga, a city of 155,000, located within a two-hour drive of Atlanta, Nashville, Knoxville and Birmingham.','The 21st Century Waterfront features the addition of floating and fixed docking space adjacent to downtown. Jets from the Tennessee Aquarium expansion spray into the Tennessee River.','Outside Magazine says: "Just outside Chattanooga is a jackpot of rock- and water-based diversions – forests, trailheads, put-ins and caves – all close enough for junkets before or after work.”','Connecting First Street to the Hunter Museum of American Art, the Holmberg Pedestrian Bridge features a translucent illuminated walking deck.','The Tennessee Aquarium(center) and Ocean Journey(left) are accessible through The Passage(far left), a pedestrian link from First Street, and by boat with 11 mooring posts at Ross\'s Landing.','The River Pier extends 140 feet out over the Tennessee River. Designed by architect Jamie Carpenter, each of its seven light masts is two feet in diameter and 40 feet tall.','A brilliant fireworks and laser show over the Tennessee River helped celebrate the completion of the transformation of Chattanooga’s waterfront in May 2005.']

//set duration for each image
duration = 10;

//Please do not edit below
ads=[];
ct=0;

function startImg( currID ) {
	if (currID != '') {
		for (i = 0; i < imgArr.length; i++) {
			if (imgArr[i] == currID) {ct = i}
			}
		var n=(ct+1)%imgArr.length;
		}
	else {
		var n=(ct+1)%imgArr.length;
		}
	if (ads[n] && (ads[n].complete || ads[n].complete == null)) {
		window.document.homeImg.src = ads[ct=n].src;
		window.document.homeImg.alt = altArr[n];
		document.getElementById("homeImgText").innerHTML = txtArr[n];
		}
	ads[n=(ct+1)%imgArr.length] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';

	chkCT = (ct-1)%imgArr.length
	if (chkCT == -1) {chkCT = imgArr.length - 1};
	ads[n=chkCT] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';
	imgTimeOut = window.setTimeout('nextImg()',duration*1000);
	}

function nextImg() {
	var n=(ct+1)%imgArr.length;
	if (ads[n] && (ads[n].complete || ads[n].complete == null)) {
		window.document.homeImg.src = ads[ct=n].src;
		window.document.homeImg.alt = altArr[n];
		document.getElementById("homeImgText").innerHTML = txtArr[n];
		}
	ads[n=(ct+1)%imgArr.length] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';

	chkCT = (ct-1)%imgArr.length
	if (chkCT == -1) {chkCT = imgArr.length - 1};
	ads[n=chkCT] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';
	window.clearTimeout(imgTimeOut)
	imgTimeOut = window.setTimeout('nextImg()',duration*1000);
	}

function prevImg() {
	var n=(ct-1)%imgArr.length;
	if (n == -1) {n = imgArr.length - 1};
	if (ads[n] && (ads[n].complete || ads[n].complete == null)) {
		window.document.homeImg.src = ads[ct=n].src;
		window.document.homeImg.alt = altArr[n];
		document.getElementById("homeImgText").innerHTML = txtArr[n];
		}
	ads[n=(ct+1)%imgArr.length] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';

	chkCT = (ct-1)%imgArr.length
	if (chkCT == -1) {chkCT = imgArr.length - 1};
	ads[n=chkCT] = new Image;
	ads[n].src = '/images/home_images/img' + imgArr[n] + '.jpg';
	window.clearTimeout(imgTimeOut)
	imgTimeOut = window.setTimeout('nextImg()',duration*1000);
	}