window.onload = initAll;

var currImg = 0;
var captionText = new Array(
	"Muslin fabric used to dress an entrance, overlaid vinyl graphics to brand the show.",
	"A two way colour combination creating an effective ceiling treatment using casement fabric.",
	"A Champagne bar dressed in white Voile to create a luxurious and stunning effect with maximum impact.",
	"A two way colour combination creating an effective ceiling treatment using casement fabric.",
    "Ceiling treatment dressed in casement to enhance the overall look of the venue, offering a cool and contemporary edge.",
	"Pantone dyed muslin to create an effective and eye catching ceiling treatment.",
	"Muslin fabric used to dress an entrance overlaid vinyl graphics to brand the show.",
	"Use of colour co-ordinated strips of casement used to dress the venue to create a stunning effect in such a large area.",
	"Use of colour co-ordinated strips of casement used to dress the venue, from a different angle.",
	"Use of colour co-ordinated strips of casement used to dress the venue to create a stunning effect in such a large area.",
	"Use of colour co-ordinated strips of casement used to dress the venue. Xamas Lunettes.",
	"Use of colour co-ordinated strips of casement used to dress the venue. Xamas Lunettes."

)

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


