var index;
var photos = new Array(8);

function addPhoto(index, url)
{
	var p = new Object();
	p.image = new Image();
	p.image.src = url;
	photos[index] = p;
}

addPhoto(1,"images_/fist_chen_cl.jpg");
addPhoto(2,"images_/Silkworm01.jpg");
addPhoto(3,"images_/fist_chen_ink.jpg");
addPhoto(4,"images_/chen1.jpg");
addPhoto(5,"images_/chen2.jpg");
addPhoto(6,"images_/chen3.jpg");
addPhoto(7,"images_/chen_.jpg");

photos[1].title = "<span class='style1'>"+ "Tai chi form chen style -"+ "<br/>" + "Fist over Body Lean with Back."+ "</span>" +"<br/>" + "Acrilyc on unprimed canvas. 30x40 cm, 2005";
photos[2].title = "<span class='style1'>"+"Tai chi form chen style -"+ "<br/>" + "The Silkworm's Dream.(Lazily Tying One's Coat)."+
"</span>" +"<br/>" + "Acrylic on canvas. 50 x 40 cm, 2010";
photos[3].title ="<span class='style1'>"+ "Tai chi form chen style -"+ "<br/>" + "Fist over Body Lean with Back."+ "</span>" +"<br/>" + "Chinese ink on rice paper.18x20.5 cm, 2005";
photos[4].title = "<span class='style1'>"+"Tai chi form chen style -"+ "<br/>" + "Lazily Tying One's Coat."+ "</span>" +"<br/>" + "Chinese ink on rice paper.13.5x27.5 cm, 2009";
photos[5].title =  "<span class='style1'>"+"Tai chi form chen style -"+ "<br/>" + "Lazily Tying One's Coat."+ "</span>" +"<br/>" + "Chinese ink on rice paper.13.5x27.5 cm, 2009";
photos[6].title = "<span class='style1'>"+"Tai chi form chen style -"+ "<br/>" + "Lazily Tying One's Coat."+ "</span>" +"<br/>" + "Chinese ink on rice paper.13.5x27.5 cm, 2009";
photos[7].title = "<span class='style1'>"+"Tai chi form chen style -"+ "<br/>" + "Lazily Tying One's Coat."+ "</span>";

photos[1].text = "";
photos[2].text = "";
photos[3].text = "";
photos[4].text = "";
photos[5].text = "";
photos[6].text = "";
photos[7].text = "";

function moveUp()
{
	index=index+1;
	if (index==8)
	{
		index=1;
	}
	showPhoto(index);	
}

function moveDown()
{
	index=index-1;
	if (index==0)
	{
		index=7
	}
	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 Form')
	index = num;
}

