window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Central Bar feature work in casement and applied graphics to create a truly magnificent effect.",
	"Graphic inserts onto a casement ceiling to create a tunnel effect roof.",
	"Central Bar feature bar dressed in Lycra to create a luxurious and stunning effect.",
	"Central Bar feature bar dressed in Lycra to create a luxurious and stunning effect.",
	"A fantastic trompe l’oeil effect using vinyl graphics onto casement fabric.",
	"Central Bar feature bar dressed in Lycra to create a luxurious and stunning effect.",
	"Grand Designs Live – NEC Birmingham.",
	"Enterence areas",
	"WWF Dome.",    
    "Inside WWF Dome.",
    "NEC Birmingham. Illuminated columns of white casement make a glorious entrance feature for Grand Designs.",
	"Screwdrivers.",
	"Screwdrivers close-up.",
	"Screwdrivers",
	"A swathe of colour co-ordinated balloons give a vibrant and exciting edge to the bar area at Grand Designs.",
	"A unique feature restaurant with the tables and wall coverings draped in voile. The lanterns are also made of voile.",
	"Lycra funnels create maximum effect for show case branding."
	
	

)

function initAll() {
	document.getElementById("imgText").innerHTML = captionText[0];
	document.getElementById("prevLink").onclick = processPrevious;
	document.getElementById("nextLink").onclick = processNext;
}

function processPrevious() {
	newSlide(-1);
}

function processNext() {
	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 ="http://www.stitchexhibitionfabrics.co.uk/images/grand_designs_show/slideImg" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
}


