	var x = 0
	var mainpic = new Array();

mainpic[0] = new Image();
mainpic[0].src = 'gfxtaking/main1.jpg';

mainpic[1] = new Image();
mainpic[1].src = 'gfxtaking/main2.jpg';

mainpic[2] = new Image();
mainpic[2].src = 'gfxtaking/main3.jpg';

mainpic[3] = new Image();
mainpic[3].src = 'gfxtaking/main4.jpg';

mainpic[4] = new Image();
mainpic[4].src = 'gfxtaking/main5.jpg';

mainpic[5] = new Image();
mainpic[5].src = 'gfxtaking/main6.jpg';

mainpic[6] = new Image();
mainpic[6].src = 'gfxtaking/main7.jpg';

mainpic[7] = new Image();
mainpic[7].src = 'gfxtaking/main8.jpg';

mainpic[8] = new Image();
mainpic[8].src = 'gfxtaking/main9.jpg';

mainpic[9] = new Image();
mainpic[9].src = 'gfxtaking/main10.jpg';

	function setImageDisplay()
	{
		var picBeingShown = document.getElementById("mainDisplay");
		picBeingShown.src = mainpic[x].src;
	}

	function setFirstGrey()
	{
		var firstButtonGreyed = document.getElementById("firstButton");
		firstButtonGreyed.style.color="#999999";
		firstButtonGreyed.style.cursor="default";
	}

	function setFirstUngrey()
	{
		var firstButtonUngreyed = document.getElementById("firstButton");
		firstButtonUngreyed.style.color="#669999";
		firstButtonUngreyed.style.cursor="pointer";
	}

	function setPreviousGrey()
	{
		var previousButtonGreyed = document.getElementById("previousButton");
		previousButtonGreyed.style.color="#999999";
		previousButtonGreyed.style.cursor="default";
	}

	function setPreviousUngrey()
	{
		var previousButtonUngreyed = document.getElementById("previousButton");
		previousButtonUngreyed.style.color="#669999";
		previousButtonUngreyed.style.cursor="pointer";
	}

	function setNextGrey()
	{
		var nextButtonGreyed = document.getElementById("nextButton");
		nextButtonGreyed.style.color="#999999";
		nextButtonGreyed.style.cursor="default";
	}

	function setNextUngrey()
	{
		var nextButtonUngreyed = document.getElementById("nextButton");
		nextButtonUngreyed.style.color="#669999";
		nextButtonUngreyed.style.cursor="pointer";
	}

	function setLastGrey()
	{
		var lastButtonGreyed = document.getElementById("lastButton");
		lastButtonGreyed.style.color="#999999";
		lastButtonGreyed.style.cursor="default";
	}

	function setLastUngrey()
	{
		var lastButtonUngreyed = document.getElementById("lastButton");
		lastButtonUngreyed.style.color="#669999";
		lastButtonUngreyed.style.cursor="pointer";
	}

	function setPicNumber()
	{
		var picNumber = x+1;
		document.getElementById("picNo").innerHTML=" "+picNumber+" of 10";
	}

	function setCaption()
	{
		if (x==0)
			{
			document.getElementById("picturecaption").innerHTML="Learning the ropes &mdash; heave-ho!";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==1)
			{
			document.getElementById("picturecaption").innerHTML="Learning the ropes &mdash; stowing up after the Southend match";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==2)
			{
			document.getElementById("picturecaption").innerHTML="The skipper takes a spell at the wheel";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==3)
			{
			document.getElementById("picturecaption").innerHTML="Sailing can be hard work and needs intense concentration!";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==4)
			{
			document.getElementById("picturecaption").innerHTML="Navigation lesson";
			document.getElementById("pictureCredit").innerHTML="&nbsp;";
			}
		else if (x==5)
			{
			document.getElementById("picturecaption").innerHTML="It&rsquo;'s not all work, work, work!";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==6)
			{
			document.getElementById("picturecaption").innerHTML="Steering the ship";
			document.getElementById("pictureCredit").innerHTML="&nbsp;";
			}
		else if (x==7)
			{
			document.getElementById("picturecaption").innerHTML="Timing the start of a race is all-important";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==8)
			{
			document.getElementById("picturecaption").innerHTML="Equally important is timing the finish";
			document.getElementById("pictureCredit").innerHTML="Photograph: Lynne Tait";
			}
		else if (x==9)
			{
			document.getElementById("picturecaption").innerHTML="We do like to dress smartly in all weathers!";
			document.getElementById("pictureCredit").innerHTML="&nbsp;";
			}
		else if (x==10)
			{
			document.getElementById("picturecaption").innerHTML="Simply messing about in boats after the Southend match";
			document.getElementById("pictureCredit").innerHTML="&nbsp;";
			}
	}

	function firstImage()
	{
		x = 0
		setImageDisplay();
		setFirstGrey();
		setPreviousGrey();
		setNextUngrey();
		setLastUngrey();
		setPicNumber();
		setCaption()
	}
	
	
	function previousImage()
	{
		x--
		if (x<0)
			{
			x = 0
			}
		else if (x==0)
			{
			setFirstGrey();
			setPreviousGrey();
			}
		else if (x==8)
			{
			setNextUngrey();
			setLastUngrey();
			}
		setImageDisplay();
		setPicNumber();
		setCaption()
	}
	
	
	function nextImage()
	{
		x++
		if (x>9)
			{
			x = 9
			}
		else if (x==9)
			{
			setNextGrey();
			setLastGrey();
			}
		else if (x==1)
			{
			setFirstUngrey();
			setPreviousUngrey();
			}
		setImageDisplay();
		setPicNumber();
		setCaption()
	}
	
	
	function lastImage()
	{
		x = 9
		setImageDisplay();
		setFirstUngrey();
		setPreviousUngrey();
		setNextGrey();
		setLastGrey();
		setPicNumber();
		setCaption()
	}
