// Set parameters
// Set timer interval (in milliseconds)
var timer_intv = 10000;    // 10 seconds

// Set as 1 to turn the timer on, 0 (or anything else) to turn off.
var timer_set = 1;

// Set image URLs
var my_imgs = new Array();
my_imgs[0] = "clothes/angel.gif";
my_imgs[1] = "clothes/wmnSack.gif";
my_imgs[2] = "clothes/babycart.gif";
my_imgs[3] = "clothes/wmnKissing.gif";
my_imgs[4] = "clothes/basket.gif";
my_imgs[5] = "clothes/wmn_1514.gif";
my_imgs[6] = "clothes/cpl_1490.gif";
my_imgs[7] = "clothes/wmn_1483.gif";
my_imgs[8] = "clothes/lacing_01.gif";
my_imgs[9] = "clothes/wmn_1480.gif";
my_imgs[10] = "clothes/lacing_02.gif";
my_imgs[11] = "clothes/wmn_1476.gif";
my_imgs[12] = "clothes/lacing_03.gif";
my_imgs[13] = "clothes/wmn_1475.gif";
my_imgs[14] = "clothes/man_01.gif";
my_imgs[15] = "clothes/wmn_1472.gif";
my_imgs[16] = "clothes/man_02.gif";
my_imgs[17] = "clothes/wmn_1462.gif";
my_imgs[18] = "clothes/man_03.gif";
my_imgs[19] = "clothes/wmn_1460.gif";
my_imgs[20] = "clothes/man_04.gif";
my_imgs[21] = "clothes/wmn_1453.gif";
my_imgs[22] = "clothes/man_05.gif";
my_imgs[23] = "clothes/wmn_1442.gif";
my_imgs[24] = "clothes/man_06.gif";
my_imgs[25] = "clothes/wmn_1441.gif";
my_imgs[26] = "clothes/man_07.gif";
my_imgs[27] = "clothes/wmn_1435.gif";
my_imgs[28] = "clothes/man_08.gif";
my_imgs[29] = "clothes/wmn_1413.gif";
my_imgs[30] = "clothes/man_09.gif";
my_imgs[31] = "clothes/wmn_1405.gif";
my_imgs[32] = "clothes/man_10.gif";
my_imgs[33] = "clothes/wmn_05.gif";
my_imgs[34] = "clothes/man_11.gif";
my_imgs[35] = "clothes/wmn_04.gif";
my_imgs[36] = "clothes/man_12.gif";
my_imgs[37] = "clothes/wmn_03.gif";
my_imgs[38] = "clothes/man_13.gif";
my_imgs[39] = "clothes/wmn_02.gif";
my_imgs[40] = "clothes/man_14.gif";
my_imgs[41] = "clothes/wmn_01.gif";
my_imgs[42] = "clothes/man_15.gif";
my_imgs[43] = "clothes/trumpet.gif";
my_imgs[44] = "clothes/man_16.gif";
my_imgs[45] = "clothes/trinity loom.gif";
my_imgs[46] = "clothes/man_17.gif";
my_imgs[47] = "clothes/tailor and scissors.gif";
my_imgs[48] = "clothes/man_18.gif";
my_imgs[49] = "clothes/shirt_02.gif";
my_imgs[50] = "clothes/man_19.gif";
my_imgs[51] = "clothes/shirt_01.gif";
my_imgs[52] = "clothes/man_20.gif";
my_imgs[53] = "clothes/men_1500.gif";
my_imgs[54] = "clothes/man_21.gif";
my_imgs[55] = "clothes/man_1527.gif";
my_imgs[56] = "clothes/man_22.gif";
my_imgs[57] = "clothes/man_1520.gif";
my_imgs[58] = "clothes/man_23.gif";
my_imgs[59] = "clothes/man_1506.gif";
my_imgs[60] = "clothes/man_24.gif";
my_imgs[61] = "clothes/man_1505.gif";
my_imgs[62] = "clothes/man_25.gif";
my_imgs[63] = "clothes/man_1500.gif";
my_imgs[64] = "clothes/man_26.gif";
my_imgs[65] = "clothes/man_1490s.gif";
my_imgs[66] = "clothes/man_27.gif";
my_imgs[67] = "clothes/man_1474.gif";
my_imgs[68] = "clothes/man_1420.gif";
my_imgs[69] = "clothes/man_1465.gif";
my_imgs[70] = "clothes/man_1430.gif";
my_imgs[71] = "clothes/man_1462.gif";
my_imgs[72] = "clothes/man_1460s.gif";
 
// Set alt text for each image
var my_imgs_alt = new Array();
my_imgs_alt[0] = "An angel holds up a shirt in front of it.";
my_imgs_alt[1] = "A woman bent under a large sack.";
my_imgs_alt[2] = "A baby in a medieval walking frame.";
my_imgs_alt[3] = "A man and a woman kissing.";
my_imgs_alt[4] = "A woman carrying a basket on her head and another on her arm.";
my_imgs_alt[5] = "A 16th century woman with her hands togeather.";
my_imgs_alt[6] = "A man and a woman kissing.";
my_imgs_alt[7] = "A 15th century woman with her hands togeather.";
my_imgs_alt[8] = "The cross laced neck opening of a shirt.";
my_imgs_alt[9] = "A Woman, knealt down and working in her lap.";
my_imgs_alt[10] = "The neck opening of a shirt which closes with a tie.";
my_imgs_alt[11] = "A 15th century woman with her hands togeather.";
my_imgs_alt[12] = "Picture of a complex bodice lacing.";
my_imgs_alt[13] = "A woman dancing with her dress 'kirtled' up.";
my_imgs_alt[14] = "A 16th century man with his britches 'hung low'.";
my_imgs_alt[15] = "A 15th century woman with her hands togeather.";
my_imgs_alt[16] = "A 16th century man dancing.";
my_imgs_alt[17] = "A 15th century woman with her hands togeather.";
my_imgs_alt[18] = "A 16th century gentleman, bent as though old.";
my_imgs_alt[19] = "A 15th century woman with her hands togeather.";
my_imgs_alt[20] = "A 16th century man in hosen and doublet birches some-one.";
my_imgs_alt[21] = "A 15th century woman with her hands togeather.";
my_imgs_alt[22] = "A man with unusual hosen, viewed from behind.";
my_imgs_alt[23] = "A 15th century woman with her hands togeather.";
my_imgs_alt[24] = "A 14th century man aiming a crossbow.";
my_imgs_alt[25] = "A 15th century woman with her hands togeather.";
my_imgs_alt[26] = "A 15th century man with his hands togeather in prayer.";
my_imgs_alt[27] = "A 15th century woman with her hands togeather.";
my_imgs_alt[28] = "A 15th century man waiving.";
my_imgs_alt[29] = "A woman working in the fields with her dress 'kirtled' up.";
my_imgs_alt[30] = "A 15th century man with his hat in his hand.";
my_imgs_alt[31] = "A 15th century woman with her hands togeather.";
my_imgs_alt[32] = "A 15th century man using an auger.";
my_imgs_alt[33] = "A woman drawing a bucket of water from a well.";
my_imgs_alt[34] = "A man in his doublet and breeches.";
my_imgs_alt[35] = "A woman carrying a bundel of wheat.";
my_imgs_alt[36] = "A man in his doublet and hosen.";
my_imgs_alt[37] = "Two women, one helping the other to dress.";
my_imgs_alt[38] = "A 15th century man from behind with his hands raised.";
my_imgs_alt[39] = "A woman praying.";
my_imgs_alt[40] = "A man posing in his fine, close fitting clothes.";
my_imgs_alt[41] = "A woman spinnging from a distaff.";
my_imgs_alt[42] = "A 15th century man from behind with his arm raised.";
my_imgs_alt[43] = "A man blowing a trumpet.";
my_imgs_alt[44] = "A cook hands food to a serving woman.";
my_imgs_alt[45] = "A naked man working a large loom.";
my_imgs_alt[46] = "A man playing a violin";
my_imgs_alt[47] = "A tailor is cutting a garment and stealing the cuttings.";
my_imgs_alt[48] = "A man cutting bread for presentation.";
my_imgs_alt[49] = "A shirt with well gathered sleeves.";
my_imgs_alt[50] = "A 13th century man explaining.";
my_imgs_alt[51] = "A shirt with considerable tailoring in it.";
my_imgs_alt[52] = "A little boy with his mother and her infant in a cradle.";
my_imgs_alt[53] = "Two 16th century soldiers practicing.";
my_imgs_alt[54] = "A 13th century man threshing wheat.";
my_imgs_alt[55] = "A 16th century man with his hands togeather in prair.";
my_imgs_alt[56] = "A 13th century man with an axe.";
my_imgs_alt[57] = "A 16th century man twisting round.";
my_imgs_alt[58] = "A 13th century man threshing wheat.";
my_imgs_alt[59] = "Side view of a 16th century man.";
my_imgs_alt[60] = "A 15th century man with his hands togeather in prayer.";
my_imgs_alt[61] = "A 16th century man holding a pole.";
my_imgs_alt[62] = "A 15th century man waiving.";
my_imgs_alt[63] = "A 16th century man holding a pole.";
my_imgs_alt[64] = "A 15th century man with his hat in his hand.";
my_imgs_alt[65] = "A wealthy man, taking his shoes off.";
my_imgs_alt[66] = "A 15th century man using an auger.";
my_imgs_alt[67] = "An executioner in doublet and hosen, holding out of head.";
my_imgs_alt[68] = "A 15th century man chopping wood.";
my_imgs_alt[69] = "A poor man holding thread in his hands.";
my_imgs_alt[70] = "A 15th century man taking his hosen off.";
my_imgs_alt[71] = "A man posing in his fine, close fitting clothes.";
my_imgs_alt[72] = "A 15th century man in a short jacket, leaning forward.";
 
// Set paragraph text for each image
var my_imgs_text = new Array();
my_imgs_text[0] = "These images were copied by Sarah from original sources.";
my_imgs_text[1] = "These images were copied by Sarah from original sources.";
my_imgs_text[2] = "These images were copied by Sarah from original sources.";
my_imgs_text[3] = "These images were copied by Sarah from original sources.";
my_imgs_text[4] = "These images were copied by Sarah from original sources.";
my_imgs_text[5] = "These images were copied by Sarah from original sources.";
my_imgs_text[6] = "These images were copied by Sarah from original sources.";
my_imgs_text[7] = "These images were copied by Sarah from original sources.";
my_imgs_text[8] = "These images were copied by Sarah from original sources.";
my_imgs_text[9] = "These images were copied by Sarah from original sources.";
my_imgs_text[10] = "These images were copied by Sarah from original sources.";
my_imgs_text[11] = "These images were copied by Sarah from original sources.";
my_imgs_text[12] = "These images were copied by Sarah from original sources.";
my_imgs_text[13] = "These images were copied by Sarah from original sources.";
my_imgs_text[14] = "These images were copied by Sarah from original sources.";
my_imgs_text[15] = "These images were copied by Sarah from original sources.";
my_imgs_text[15] = "These images were copied by Sarah from original sources.";
my_imgs_text[16] = "These images were copied by Sarah from original sources.";
my_imgs_text[17] = "These images were copied by Sarah from original sources.";
my_imgs_text[18] = "These images were copied by Sarah from original sources.";
my_imgs_text[19] = "These images were copied by Sarah from original sources.";
my_imgs_text[20] = "These images were copied by Sarah from original sources.";
my_imgs_text[21] = "These images were copied by Sarah from original sources.";
my_imgs_text[22] = "These images were copied by Sarah from original sources.";
my_imgs_text[23] = "These images were copied by Sarah from original sources.";
my_imgs_text[24] = "These images were copied by Sarah from original sources.";
my_imgs_text[25] = "These images were copied by Sarah from original sources.";
my_imgs_text[26] = "These images were copied by Sarah from original sources.";
my_imgs_text[27] = "These images were copied by Sarah from original sources.";
my_imgs_text[28] = "These images were copied by Sarah from original sources.";
my_imgs_text[29] = "These images were copied by Sarah from original sources.";
my_imgs_text[30] = "These images were copied by Sarah from original sources.";
my_imgs_text[31] = "These images were copied by Sarah from original sources.";
my_imgs_text[32] = "These images were copied by Sarah from original sources.";
my_imgs_text[33] = "These images were copied by Sarah from original sources.";
my_imgs_text[34] = "These images were copied by Sarah from original sources.";
my_imgs_text[35] = "These images were copied by Sarah from original sources.";
my_imgs_text[36] = "These images were copied by Sarah from original sources.";
my_imgs_text[37] = "These images were copied by Sarah from original sources.";
my_imgs_text[38] = "These images were copied by Sarah from original sources.";
my_imgs_text[39] = "These images were copied by Sarah from original sources.";
my_imgs_text[40] = "These images were copied by Sarah from original sources.";
my_imgs_text[41] = "These images were copied by Sarah from original sources.";
my_imgs_text[42] = "These images were copied by Sarah from original sources.";
my_imgs_text[43] = "These images were copied by Sarah from original sources.";
my_imgs_text[44] = "These images were copied by Sarah from original sources.";
my_imgs_text[45] = "These images were copied by Sarah from original sources.";
my_imgs_text[46] = "These images were copied by Sarah from original sources.";
my_imgs_text[47] = "These images were copied by Sarah from original sources.";
my_imgs_text[48] = "These images were copied by Sarah from original sources.";
my_imgs_text[49] = "These images were copied by Sarah from original sources.";
my_imgs_text[50] = "These images were copied by Sarah from original sources.";
my_imgs_text[51] = "These images were copied by Sarah from original sources.";
my_imgs_text[52] = "These images were copied by Sarah from original sources.";
my_imgs_text[53] = "These images were copied by Sarah from original sources.";
my_imgs_text[54] = "These images were copied by Sarah from original sources.";
my_imgs_text[55] = "These images were copied by Sarah from original sources.";
my_imgs_text[56] = "These images were copied by Sarah from original sources.";
my_imgs_text[57] = "These images were copied by Sarah from original sources.";
my_imgs_text[58] = "These images were copied by Sarah from original sources.";
my_imgs_text[59] = "These images were copied by Sarah from original sources.";
my_imgs_text[60] = "These images were copied by Sarah from original sources.";
my_imgs_text[61] = "These images were copied by Sarah from original sources.";
my_imgs_text[62] = "These images were copied by Sarah from original sources.";
my_imgs_text[63] = "These images were copied by Sarah from original sources.";
my_imgs_text[64] = "These images were copied by Sarah from original sources.";
my_imgs_text[65] = "These images were copied by Sarah from original sources.";
my_imgs_text[66] = "These images were copied by Sarah from original sources.";
my_imgs_text[67] = "These images were copied by Sarah from original sources.";
my_imgs_text[68] = "These images were copied by Sarah from original sources.";
my_imgs_text[69] = "These images were copied by Sarah from original sources.";
my_imgs_text[70] = "These images were copied by Sarah from original sources.";
my_imgs_text[71] = "These images were copied by Sarah from original sources.";
my_imgs_text[72] = "These images were copied by Sarah from original sources.";
 
// Variables to track what's happening.
var slide_count = start_image;     // Which image are we showing.
var keep_going = 1;                    // Did the timer start successfully?
var slide_HTML = "";       // HTML to display.

function change_slide() {
	// Only change the picture if we've not set the stop flag.
	if (timer_set == 1){

		// We can't create slide_div if we can't find the XHTML item
		if (document.getElementById && document.createTextNode) {
			var slide_div = document.getElementById("slide_show")

			// Set image to display and alt text for it.
			slide_HTML      = "<p> "
							+ "<img src='" + my_imgs[slide_count]
							+ "' alt='" + my_imgs_alt[slide_count] + "' /> "
							+ "</p> "
							+ "<p> "
							+ my_imgs_text[slide_count] + " " 
							+ "</p> ";
			slide_div.innerHTML = slide_HTML;
        }

		// Increment the image index
		slide_count += increment_by;

		// When we've viewed all images, start again.
		if (slide_count >= my_imgs.length) {
			slide_count = 0;
		}
	}

	// Set the timer to run this function again.
	keep_going = setTimeout("change_slide()",timer_intv);
}

function stop_slides() {
	// Stops the slides changing (for accecibility standards).
	if (timer_set == 1) {
		timer_set = 0;
		document.getElementById("btnStopPics").innerHTML = "Resume changing pictures";
	}
	else {
		timer_set = 1;
		document.getElementById("btnStopPics").innerHTML = "Pause changing pictures";
	}
}


