var timerID = 0;
var bannerIndex = 0;
var theBanners = [
	["http://www.bankofamerica.com","/banner/bofalogo.gif"],	
	["http://www.laxmanjethani.agentplace.com", "/banner/laxmanLogo.jpg"],
	["http://www.pierceytoyota.com","/banner/pierceyToyota.gif"],
	["http://www.siliconeer.com",	"/banner/siliconeer.gif"],
	["http://www.pashchimi.org/contact.html#SP","/banner/yourlogo.gif"]	
];

function replaceBanner(index) {
	document.bannerImage.src = theBanners[index][1];
	if (++bannerIndex > (theBanners.length-1)) bannerIndex = 0;
}

function startBanner() {
	replaceBanner(0);
	timerID = setInterval("replaceBanner(bannerIndex);",3000);
}
			
function privWin(winName,file,w,h) {
	var iWHalf = (screen.availWidth / 2) - (w / 2);
	var iTHalf = (screen.availHeight / 2) - (h / 2);
	winName = window.open(file,winName,'width='+w+',height='+h+',top='+iTHalf+',left='+iWHalf+', resizable=1,status=1,toolbar=1,scrollbars=0');
}
			
function bannerClicked(index) {
		//document.location = theBanners[(index == 0) ? (theBanners.length-1) : (index-1)][0];
		var fileLocation = theBanners[(index == 0) ? (theBanners.length-1) : (index-1)][0];
		privWin('Banner', fileLocation, 800, 600);
}

startBanner();
