// timed swapping of multiple images v1.1 - david hirmes - 10/4/01
function initialize() {
	nextSpot = 0;
	
	spot1 = 1;
	spot2 = 2;
	spot3 = 3;
	
	link1="../pharaohs/index.html";
	link2="case_salem/index.html";
	link3="case_stonehenge/index.html";
	link4="case_jamestown/index.html";
	link5="case_zulu/index.html";
	link6="case_tomb/index.html";
	link7="case_syphilis/index.html";
	link8="hindenburg.html";
	link9="cannibals.html";
	link10="catastrophe.html";
	link11="vikings.html";
	link12="case_firsthuman/index.html";
	link13="case_plague/index.html";
	link14="case_titanic/index.html";
	link15="case_rome/index.html";
	link16="case_southpole/index.html";
	link17="case_nazidams/index.html";
	link18="case_kwai/index.html";
	link19="case_killerflu/index.html";
	link20="case_shroudchrist/index.html";
	link21="case_dday/index.html";
	link22="case_amazon/index.html";
	link23="case_naziscientists/index.html";
	link24="case_gangland/index.html";
	link25="case_killerflu/index.html";
	link26="case_courtesans/index.html";
	link27="case_andreadoria/index.html";
	link28="case_umbrella/index.html";
	link29="case_dogfight/index.html";
	link30="case_bible/index.html";

	swapper();
}

function swapper()
{
	// get random new spot (1-3)
	nextSpot++;
	if ( nextSpot > 3 ) {
		nextSpot = 1;
	}
	
	// get random new image, but make sure it isn't being displayed already
	while ( 1 ) {
		randomImage = Math.floor(Math.random() * 23)+1;
		if ( spot1 != randomImage && spot2 != randomImage && spot3 != randomImage) {
			eval("spot"+nextSpot+"="+randomImage);
			break;
		}	
	}
	
	// show the new image
	eval("document.img"+nextSpot+".src = 'images/th"+randomImage+".gif'");
	
	// repeat ad infinitum
	setTimeout('swapper()',10000);
}

function choseMaster(n) {

	where = eval("spot"+n);
	where = eval("link"+where);
	//alert(where);
	document.location = where;
}