// Home Page Image Scroller
myPix = new Array("images/homerot/bridge1.jpg","images/homerot/bridge2.jpg","images/homerot/bridge3.jpg","images/homerot/bridge4.jpg","images/homerot/racehome.jpg","images/homerot/ridehome.jpg","images/homerot/buildhome.jpg")
adURL = new Array("default1.asp","default1.asp","default1.asp","default1.asp","default1.asp","default1.asp")
thisPic = 0
imgCt = myPix.length -1
imgCb = myPix.length
firstTime = true

function chgSlide(direction) {
	if(document.images) {
		thisPic = thisPic + direction
		if (thisPic > imgCt) {
			thisPic = 0
		}
		if (thisPic < 0) {
			thisPic = imgCt
		}
		document.myPicture.src=myPix[thisPic]
	}
}
function newLocation() {
	document.location.href = adURL[thisPic]
}

function rotate() {
	if (document.images) {
		if (firstTime) {
			thisAd = Math.floor((Math.random() * imgCb))
			firstTime = false
		}
		else {
			thisAd++
			if (thisAd == imgCb) {
				thisAd = 0
			}
		}
		document.myPicture.src=myPix[thisAd]
		setTimeout("rotate()", 6 * 1000)
	}
}

function setDisplay(objectID,state) {
	var object = document.getElementById(objectID);
	object.style.display = state;
}
