window.onload = rolloverInit;

var thisAd = 0;

function rotate() {
	var adImages = new Array("congregation.jpg","building.jpg");

	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("building").src = adImages[thisAd];


	setTimeout(rotate, 4 * 1000);
}	

function rolloverInit() {
	for (var i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A") {
			setupRollover(document.images[i]);
		}
	}
rotate()
}

function setupRollover(thisImage, heightImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = function() {
		this.src = this.outImage.src;
	}

	thisImage.overImage = new Image();
	thisImage.overImage.src = "web_files/enter2.gif";
	thisImage.onmouseover = function() {
		this.src = this.overImage.src;
	}
}




