window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	    "BExA 70th anniversary cake", 
	    "Geoffrey Clifton-Brown MP (Host)", 
	    "View of the Terrace Pavilion, House of Commons", 
	    "from left to right:  Geoffrey Clifton-Brown MP, Ed Davey MP (BIS Minister); Susan Ross (Chairman, BExA) (Aon Trade Credit); Hugh Bailey (Director, BExA); Sir Richard Needham PC (President, BExA)", 
	    "Susan Ross (Chairman), Sir Richard Needham PC (President), Ed Davey MP (BIS Minister)", 
	    "View of the Terrace Pavilion, House of Commons", 
	    "Robert Vaughan (Corus - Winner of GTR BExA Young Exporter Award 2010) with Ed Davey MP (BIS Minister) with Susan Ross (Chairman)", 
"Ed Davey MP cutting the 70th anniversary cake with  Susan Ross (Chairman) and Hugh Bailey (Director)",
"Susan Ross (Chairman, BExA)",
"Ed Davey MP (BIS Minister) addressing those present",
"Sir Richard Needham PC (BExA President) with Troy Wang (Rolls-Royce - Runner-up, GTR BExA Young Exporter Award 2010)",
"Susan Ross (Chairman) talking to Ed Davey MP (BIS Minister)",
"Geoffrey Clifton-Brown MP and Ed Davey MP (BIS Minister) talking to a guest",
"Sir Richard Needham PC (President, BExA) with Ed Davey MP (BIS Minister) and Geoffrey Clifton-Brown MP",
"Sir Richard Needham PC (President, BExA) making a presentation to Julian Barnes (BAE Systems - Runner-up, GTR BExA Young Exporter Award 2010)"
)

function initAll()
{
	document.getElementById("imgText").innerHTML = captionText[0];
	document.getElementById("curr").innerHTML = currImg+1;
	document.getElementById("total").innerHTML = captionText.length;
	document.getElementById("prevLink").onclick = function() { newSlide(-1); }
	document.getElementById("nextLink").onclick = function() { newSlide(1); }
}

function newSlide(direction)
{
	var imgCt = captionText.length;
	
	currImg = currImg + direction;
	if(currImg < 0)
	{
		currImg = imgCt-1;
	}
	if(currImg == imgCt)
	{
		currImg = 0;
	}
	document.getElementById("slideshow").src = "images/Spring Reception 2010/" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
	document.getElementById("curr").innerHTML = currImg+1;
}
