window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Close-up of central bar dressed in Lycra and Voile.",
	"Central Bar dressed in Lycra and Voile to create a luxurious and stunning effect.",
	"An illuminated catwalk. Cotton Casement and stretchy Lycra are bought together and utilised with the addition of coloured lighting.",
	"An elliptical design used for added interest - formed using Lycra and aluminium tubing.",
	"Pure",
	"Grand Hall entrance, 35,000 metres of cord used to create wig effect to maniquins.",
	"A feature at the Blue Bar is the creative use of a coloured mannequin to create a topical focal point.",
	"A fine example of a temporary staircase covering using cotton Casement and metal work.",
	"A seven metre drum suspended above the Catwalk which maximises show branding and creates a central focal point.",
	"Central bar feature dressed in Lycra and Voile to create a luxurious and stunning effect.",
	"Central bar feature dressed in Lycra and Voile to create a luxurious and stunning effect.",
	"Part of nine 6 metre drop drums used to indicate different areas of the show."
)

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/pure_london/slideImg" + currImg + ".jpg";
	document.getElementById("imgText").innerHTML = captionText[currImg];
}


