bnrArray = new Array(
new Array(
	'ies_REL.jpg',
	'/ncee/edlabs/',
	'The Regional Educational Laboratory Program (REL) consists of a network of ten laboratories that serve the educational needs of a designated region by providing access to high quality scientifically valid education research through applied research and development projects, studies, and other related technical assistance activities.'
	),
new Array(
	'ies_WWC.jpg',
	'/ncee/wwc/',
	'What Works Clearinghouse-a trusted source of scientific evidence of what works in education'
	),
new Array(
	'ies_ERIC.jpg',
	'/ncee/projects/eric.asp',
	'Education Resources Infromation Center-The world’s largest digital library of education literature'
	)
);

var prd=5000;
var tmr;
var sts=0;
var idx=0;
var ida='homeRBa';
var idi='homeRBimg';

function bnrInit()
{
	idx=mod(new Date().getSeconds(),bnrArray.length);
	document.write('<a href="'+bnrArray[idx][1]+'" id="'+ida+'">');
	document.write('<img src="/ncee/images/'+bnrArray[idx][0]+'" alt="'+bnrArray[idx][2]+'" id="'+idi+'" width="367" height="120" border="0">');
	document.write('</a>');
	bnrStart();
}

function bnr(step,e)
{
	if(step=='0')
	{
		if(sts==1){bnrStop();}else{bnrStart();}
		e.src=(sts==1?'/images/stop.gif':'/images/play.gif');
		e.title=(sts==1?'Stop Banners':'Start Banners');
	}
	else if(sts==1){bnrStep(step);}
	else if(sts==0){bnrStep(step);bnrStop();}
}

function bnrStart()
{
	idx++;
	if(idx>=bnrArray.length){idx=0;}
	document.getElementById(ida).href=bnrArray[idx][1];
	document.getElementById(idi).src='/ncee/images/'+bnrArray[idx][0];
	document.getElementById(idi).alt=bnrArray[idx][2];
	tmr=setTimeout('bnrStart()',prd);
	sts=1;
}

function bnrStop()
{
	clearTimeout(tmr);
	sts=0;
}

function bnrStep(step)
{
	bnrStop();
	if(step=='-1')
	{
		if(idx==1){idx=bnrArray.length-1;}
		else if(idx==0){idx=bnrArray.length-2;}
		else{idx-=2;}
	}
	bnrStart();
}

function mod(X,Y)
{
	return(X-Math.floor(X/Y)*Y);
}