// ensure that Caption Array contains the same number of elements as BannerArray
var CaptionArray = new Array('Panel Session', 'NCER Commissioner Lynn Okagaki presides at Opening Plenary session', 'National Board for Education Sciences Vice Chair Beth Ann Bryant delivers Opening Remarks', 'Director Whitehurst, NCES Commissioner Mark Schneider, and NCEE Commissioner Phoebe Cottingham at Opening Plenary', 'IES Director Grover "Russ" Whitehurst delivers Plenary Address', 'Dr. Whitehurst during a light moment', 'NCEE Associate Commissioner Stuart Kerachsky (foreground)', 'Researchers talk with Dr. Whitehurst following Plenary Address', '<em>Solving for X: Research on Improving Student Learning in Algebra</em> Panel', 'Plenary Luncheon', 'Plenary Luncheon Speaker Gary Taubes, science writer and author', 'Attentive listeners at Plenary Luncheon', 'Researchers greet Plenary Luncheon Speaker Gary Taubes', '(l-r) Lynn Okagaki, Carol Connor, Shayne Piasta, Laura Justice, and Russ Whitehurst.  Both Laura Justice and Carol Connor are education science recipients of the Presidential Early Career Award for Scientist and Engineers, and Shayne Piasta is the inaugural recipient of the IES Predoctoral Fellow Award.', 'Panel Audience', 'Panelist Larry Hedges of Northwestern University at the <em>Using the Instrumental Variables Estimation Technique in Education Research</em> session');
var BannerArray;
var g;

function FillArray(filename,numfiles)
{
	BannerArray = new Array(numfiles);
	var y;
	for (var x=0;x<numfiles;x++)
	{
		y=x+1;
		y=(y<10)?('0'+y):y;
		BannerArray[x]=filename+'/'+filename+'_'+y+'.jpg';
	}
}

function AddHPBanner(ii, z)
{    
    if(!z){var z=0;}
    if(z!=0)
    {
		if(z==1||z==2)
        {
			g=(z==1)?GetPrevious(ii):GetNext(ii); 
			document.getElementById('imgGallery').src='/director/conferences/08ies_conference/photos/'+BannerArray[g];document.getElementById('divCaption').innerHTML=CaptionArray[g];document.getElementById('imgGallery').setAttribute('title',CaptionArray[g]);document.getElementById('imgGallery').setAttribute('alt',BannerArray[g]);
        }
    }
	else
    {
	    if(ii==null)
	    {
		    g=0; 
		    ii=0;
			document.getElementById('imgGallery').setAttribute('src','/director/conferences/08ies_conference/photos/'+BannerArray[g]);
			document.getElementById('imgGallery').setAttribute('title',CaptionArray[g]);
			document.getElementById('imgGallery').setAttribute('alt',BannerArray[g]);
			document.getElementById('divCaption').innerHTML=CaptionArray[g];
	    }
    }	
}

function GetNext(x)
{
	return((x>=BannerArray.length-1)?0:(x+1));
}

function GetPrevious(x)
{
	return(x==0?(BannerArray.length-1):(x-1));
}

FillArray('iesPhoto', 16);