// JavaScript Document
//rachelclarkart.com

//enter the drawing image titles below in the same order as the images are numbered
siteTitle = new Array(
					  	"<a href='http://www.rachelclarkart.com' title='Rachel Clark Art website' target='_blank'>Rachel Clark Art</a>",
						"<a href='http://www.undiscoveredvoices.com' title='Undiscovered Voices website' target='_blank'>Undiscovered Voices</a>",
						"<a href='http://www.beckychilcott.co.uk' title='Becky Chilcott Design website' target='_blank'>Becky Chilcott Design</a>",
						"<a href='http://www.nickyborowiec.co.uk' title='Nicky Borowiec website' target='_blank'>Nicky Borowiec</a>",
						"<a href='http://www.k-country.co.uk/bopepper' title='Bo Pepper website' target='_blank'>Bo Pepper</a>",
						"<a href='http://www.k-country.co.uk/ssc' title='Staines Sailing Club website' target='_blank'>Staines Sailing Club</a>"
					)

siteUrl = new Array(
					  	"<a href='http://www.rachelclarkart.com' title='Rachel Clark Art website' target='_blank'>www.rachelclarkart.com</a>",
						"<a href='http://www.undiscoveredvoices.com' title='Undiscovered Voices website' target='_blank'>www.undiscoveredvoices.com</a>",
						"<a href='http://www.beckychilcott.co.uk' title='Becky Chilcott Design website' target='_blank'>www.beckychilcott.co.uk</a>",
						"<a href='http://www.nickyborowiec.co.uk' title='Nicky Borowiec website' target='_blank'>www.nickyborowiec.co.uk</a>",
						"<a href='http://www.k-country.co.uk/bopepper' title='Bo Pepper website' target='_blank'>www.k-country.co.uk/bopepper (archived version)</a>",
						"<a href='http://www.k-country.co.uk/ssc' title='Staines Sailing Club website' target='_blank'>www.k-country.co.uk/ssc (archived version)</a>"
					)

siteClient = new Array(
					  	"Rachel Clark",
						"Becky Chilcott/SCBWI British Isles",
						"Becky Chilcott",
						"Nicky Borowiec",
						"Safe Management",
						"Staines Sailing Club"
					)
siteWork = new Array(
					  	"Coding to supplied design",
						"Coding to supplied design",
						"Coding to supplied design",
						"Coding to supplied design",
						"Design and coding",
						"Design and coding"
					)
siteCreate = new Array(
					  	"May 2009",
						"April 2009",
						"November 2007",
						"March 2007",
						"January 2007",
						"April 2006"
					)
siteStatus = new Array(
					  	"Active",
						"Active",
						"Active",
						"Active",
						"Inactive (archived version available to view)",
						"Control relinquished (archived version available to view)"
					)

var thumbPage=1;
//var thisPrintPic=1;
var thisDrawPic=1;
var siteCt=siteTitle.length;
var tb1 = 1
var tb2 = 2
var tb3 = 3
var tb4 = 4
var tb5 = 5


function addMake() {
			var name = 'design';
			var at = '@';
			var domain1 = 'k-country.';
			var domain2 = 'co.';
			var domain3 = 'uk';
			var mememail = document.getElementById('contacttext');
			var text = name+at+domain1+domain2+domain3;
			mememail.innerHTML = text;
	}

function preLoadThumbs()
		{
			for (i=1; i<=siteTitle.length; i++)	
				{
					var thumb = new Image
					var thumbid = "thumb"+i
					thumb.src = "images/"+thumbid+".jpg"		
				}
		}
		
function loadThumbs()
		{
				thumbPage=1
				for (i=1; i<=5; i++)
				{
					//var icount=i+1;
					var thumbBoxId = 'thumbbox'+i;
					var thumbPic = "images/thumb"+i+".jpg";
					var thumbBox = document.getElementById(thumbBoxId);
					thumbBox.src = thumbPic;
				}
		}
				
		function loadLargeImage(picNum)
		{
		//alert('picnum='+picNum)
			var imageCell = document.getElementById('largeimg');
			var stTitle = document.getElementById('sitetitle');
			var entryUrl = document.getElementById('entryurl');
			var entryClient = document.getElementById('entryclient');
			var entryWork = document.getElementById('entrywork');
			var entryCreate = document.getElementById('entrycreate');
			var entryStatus = document.getElementById('entrystatus');
							var thePic = "images/large"+picNum+".jpg";
							imageCell.src = thePic;
							stTitle.innerHTML = siteTitle[picNum-1];
							entryUrl.innerHTML = siteUrl[picNum-1];
							entryClient.innerHTML = siteClient[picNum-1];
							entryWork.innerHTML = siteWork[picNum-1];
							entryCreate.innerHTML = siteCreate[picNum-1];
							entryStatus.innerHTML = siteStatus[picNum-1];
		}
								
		
		function processDrawNext(direction) {
		//thisPrintPic = thisPrintPic + direction;
		//alert('thisPrintPic='+thisPrintPic)
		var thumbCell1 = document.getElementById('thumbbox1');
		var thumbCell2 = document.getElementById('thumbbox2');
		var thumbCell3 = document.getElementById('thumbbox3');
		var thumbCell4 = document.getElementById('thumbbox4');
		var thumbCell5 = document.getElementById('thumbbox5');
		tb1 = tb1+1;
		tb2 = tb2+1;
		tb3 = tb3+1;
		tb4 = tb4+1;
		tb5 = tb5+1;
		if (tb1>siteCt){
			tb1 = 1
			}
		if (tb2>siteCt){
			tb2 = 1
			}
		if (tb3>siteCt){
			tb3 = 1
			}
		if (tb4>siteCt){
			tb4 = 1
			}
		if (tb5>siteCt){
			tb5 = 1
			}
		var picId1 = "images/thumb"+tb1+".jpg";
		var picId2 = "images/thumb"+tb2+".jpg";
		var picId3 = "images/thumb"+tb3+".jpg";
		var picId4 = "images/thumb"+tb4+".jpg";
		var picId5 = "images/thumb"+tb5+".jpg";
		thumbCell1.src=picId1;
		thumbCell2.src=picId2;
		thumbCell3.src=picId3;
		thumbCell4.src=picId4;
		thumbCell5.src=picId5;
		//alert('tb3='+tb3)
		loadLargeImage(tb3)
		}
		
		function processDrawPrevious(direction) {
		//thisPrintPic = thisPrintPic + direction;
		//alert('thisPrintPic='+thisPrintPic)
		var thumbCell1 = document.getElementById('thumbbox1');
		var thumbCell2 = document.getElementById('thumbbox2');
		var thumbCell3 = document.getElementById('thumbbox3');
		var thumbCell4 = document.getElementById('thumbbox4');
		var thumbCell5 = document.getElementById('thumbbox5');
		tb1 = tb1-1;
		tb2 = tb2-1;
		tb3 = tb3-1;
		tb4 = tb4-1;
		tb5 = tb5-1;
		if (tb1<1){
			tb1 = siteCt
			}
		if (tb2<1){
			tb2 = siteCt
			}
		if (tb3<1){
			tb3 = siteCt
			}
		if (tb4<1){
			tb4 = siteCt
			}
		if (tb5<1){
			tb5 = siteCt
			}
		var picId1 = "images/thumb"+tb1+".jpg";
		var picId2 = "images/thumb"+tb2+".jpg";
		var picId3 = "images/thumb"+tb3+".jpg";
		var picId4 = "images/thumb"+tb4+".jpg";
		var picId5 = "images/thumb"+tb5+".jpg";
		thumbCell1.src=picId1;
		thumbCell2.src=picId2;
		thumbCell3.src=picId3;
		thumbCell4.src=picId4;
		thumbCell5.src=picId5;
		loadLargeImage(tb3)
		}
