var index;
var photos = new Array(9);

function addPhoto(index, url)
{
	var p = new Object();
	p.image = new Image();
	p.image.src = url;
	photos[index] = p;
}

addPhoto(1,"images_/small_dipper.jpg");
addPhoto(2,"images_/Na_cha.jpg");
addPhoto(3,"images_/Saber_cl.jpg");
addPhoto(4,"images_/seven_stars.jpg");
addPhoto(5,"images_/rhino_.jpg");
addPhoto(6,"images_/Na_Cha_ink.jpg");
addPhoto(7,"images_/ursa_ minor.jpg");
addPhoto(8,"images_/saber_1_ink.jpg");


photos[1].title = "<span class='style1'>"+ "Tai chi form - small dipper."+ "</span>" +"<br/>" + "Acrylic on unprimed canvas on wood. 40x60 cm, 2007 ";
photos[2].title = "<span class='style1'>"+"Tai chi Sword - Na - Cha Sounding the Sea."+"</span>" +"<br/>" + "Acrylic on canvas 45 x 60 cm, 2004 ";
photos[3].title ="<span class='style1'>"+ " Tai chi form - Saber - Broad Sword."+ "</span>" +"<br/>" + "Acrylic on canvas. 24.5 x 13.5 cm, 2009";
photos[4].title = "<span class='style1'>"+"Tai chi Sword - seven stars. "+ "</span>" +"<br/>" + "Chinese ink on rice paper.";
photos[5].title =  "<span class='style1'>"+"Tai chi Sword - Rhinoceros Looks at the Moon."+ "</span>" +"<br/>" + "Chinese ink on rice paper. 22.5 x 28 cm, 1998 ";
photos[6].title = "<span class='style1'>"+"Tai chi Sword - Na - Cha Sounding the Sea."+ "</span>" +"<br/>" + "Chinese ink on rice paper. 24 x 19 cm, 2005";
photos[7].title = "<span class='style1'>"+"Tai chi Sword - ursa minor."+ "</span>" +"<br/>" + "Chinese ink on rice paper. 16.5 x 24.5 cm, 2008 ";
photos[8].title = "<span class='style1'>"+"Tai chi broad Sword - saber."+ "</span>" +"<br/>" + "Chinese ink on rice paper. 24 x 17 cm, 2009 ";

photos[1].text = "";
photos[2].text = "";
photos[3].text = "";
photos[4].text = "";
photos[5].text = "";
photos[6].text = "";
photos[7].text = "";
photos[8].text = "";

function moveUp()
{
	index=index+1;
	if (index==9)
	{
		index=1;
	}
	showPhoto(index);	
}

function moveDown()
{
	index=index-1;
	if (index==0)
	{
		index=8
	}
	showPhoto(index);
}

function showPhoto(num) 
{
	var photo = photos[num];
	document.mag.src=photo.image.src;
	document.getElementById('title_').innerHTML = photo.title;
	document.getElementById('description_').innerHTML = photo.text;
	document.mag.alt = ('Tai Chi Sword')
	index = num;
}

