window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Illuminated Lycra funnels pave the way for a contemporary style.",
	"Creating a marquee look with tents above the private boxes using coloured Casement makes for an aesthetical effect.",
	"Draped muslin in a two way colour scheme is managed to create an effective and eye catching ceiling treatment.",
	"A plush bar interior is created using Casement and Voile.",
	"An illuminated lycra funnel paves the way for a contemporary style.",
	"A swathe of blue cotton Casement fills the end semi circle glass window at Olympia to ensure a secure blackout of light."

)

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


