
// empty structure for the pre-loaded images
var aImgRot = new Array(
		new Array(),
		new Array(),
		new Array(),
		new Array()
		);

// set the current index of each array
var aCurIndex = new Array(0,0,0,0);

// set the array of panes to rotate
var aImgRotAry = new Array(0,1,2,3);

function RotateAccent(iTime,bRnd){
	if (document.images) { // ensure browser can do JavaScript rollovers.

		// grab a random number from the array of available panes
		var iSelIndex=parseInt(Math.random()*(aImgRotAry.length));

		// grab the pane selected found
		iPaneSelected=aImgRotAry[iSelIndex];

		// delete the selected value
		aImgRotAry.splice(iSelIndex,1);
		
		if (aImgRotAry.length<1) { aImgRotAry = new Array(0,1,2,3); } // reset the items available
				
		//increment the current index
		aCurIndex[iPaneSelected]++;
		if (aCurIndex[iPaneSelected]>(aImgRot[iPaneSelected].length-1)) { aCurIndex[iPaneSelected]=0; }

//		alert('aCurIndex[' + iPaneSelected + ']='+aCurIndex[iPaneSelected])

		var selAccent;
		eval("selAccent=document.imgquad" + iPaneSelected);
		
		selAccent.src=aImgRot[iPaneSelected][aCurIndex[iPaneSelected]].src;
		selAccent.alt=aImgRot[iPaneSelected][aCurIndex[iPaneSelected]].alt;
		
		setTimeout('RotateAccent('+iTime+','+bRnd+');',iTime*1000);
	}
}

function LoadAccents(){
	if (document.images) { // ensure browser can do JavaScript rollovers.
		for (icnt=0;icnt<=3;icnt++) {
			eval("aImgs=aPane" + icnt);
			// load each image with the defined image from array
			// also preloads the image on the browser
			for (ii=0;ii<aImgs.length;ii++) {
				aImgRot[icnt][ii] = new Image();
				aImgRot[icnt][ii].alt = aImgs[ii][0];
				aImgRot[icnt][ii].src = aImgs[ii][1];
			}
		}
	}
}

