imgContainer = false;
img = -1;
imgCnt = 0;
imgInfoArray = new Array();

function changeImg(arg){
	if (arg){	
		if (++img==imgCnt)
		img=0;		
	}else{
		if (img==0)
		img=imgCnt;
		img--;
	}
	Update();
}

function getobject(obj){
	if (document.getElementById)
		return document.getElementById(obj)
		else if (document.all)
		return document.all[obj]
}

function Update(){
	getobject("imgContainer").src = imgInfoArray[img][0];
	getobject("txtContainer").innerHTML = imgInfoArray[img][1];
	getobject("imgContainer").alt = imgInfoArray[img][2];
	getobject("imgContainer").title = imgInfoArray[img][2];
}


function loadImg(){
	if (imgContainer)
		window.setTimeout("Tick()", timeOutInSec*1000);
}
		
function Tick(){
	if (imgContainer)
		Next();
}


function Prev(){
	if(img==0){
		img++;
		document.prevBtn.src='../../../externalflash/Exp16_Feature/images/NIS_back_button_2.gif';
		document.prevBtn.title='Back button diabled';
		document.prevBtn.alt='Back button diabled';
		document.nextBtn.src='../../../externalflash/Exp16_Feature/images/NIS_next_button.gif';
		document.nextBtn.title='Next';
		document.nextBtn.alt='Next';
	}
	else{
	document.nextBtn.src='../../../externalflash/Exp16_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
	document.nextBtn.alt='Next';
	document.prevBtn.src='../../../externalflash/Exp16_Feature/images/NIS_back_button.gif';
	document.prevBtn.title='Back';
	document.prevBtn.alt='Back';
	}
changeImg(false);
}
function Next(){
	if(img==imgCnt-1){
		img--;
		document.prevBtn.src='../../../externalflash/Exp16_Feature/images/NIS_back_button.gif';
		document.prevBtn.title='Back';
		document.prevBtn.alt='Back';
		document.nextBtn.src='../../../externalflash/Exp16_Feature/images/NIS_next_button_2.gif';
		document.nextBtn.title='Next button disabled';
		document.nextBtn.alt='Next button disabled';
	}
	else {
	document.prevBtn.src='../../../externalflash/Exp16_Feature/images/NIS_back_button.gif';
	document.prevBtn.title='Back';
	document.prevBtn.alt='Back';
	document.nextBtn.src='../../../externalflash/Exp16_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
	document.nextBtn.alt='Next';
	}
changeImg(true);

}

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_1.jpg", "The Expedition 16 crew is on the International Space Station!<br /><br />NASA astronaut Peggy Whitson, on the left, is the Expedition 16 commander. Cosmonaut Yuri Malenchenko is on the right. He is a flight engineer and the Soyuz commander. Both of them have lived on the space station as part of previous expeditions. ",
 "Whitson and Malenchenko pose in front of a large picture of Earth with the Expedition 16 mission patch in the foreground");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_2.jpg", "NASA astronaut Peggy Whitson and cosmonaut Yuri Malenchenko traveled to the space station in a Russian Soyuz spacecraft.<br /><br /> They launched on Oct. 10, 2007. They will stay on the space station until the spring of 2008. ",
 "A Soyuz rocket after launch on its way to space");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_3.jpg", "Astronaut Clayton Anderson was already on the space station when Whitson and Malenchenko arrived.<br /><br /> Anderson traveled to the space station in June 2007 aboard the space shuttle Atlantis. ",
 "Astronaut Clayton Anderson poses in front of a window on the space station" );

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_4.jpg", "Anderson will live and work with Whitson and Malenchenko on the space station until early November 2007, when he returns to Earth aboard space shuttle Discovery.",
 "Anderson, Whitson and Malenchenko pose in front of a large picture of the Earth with the space station shown in orbit and the Expedition 16 mission patch in the foreground");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_5.jpg", "As part of the STS-120 crew on space shuttle Discovery, astronaut Daniel Tani will travel to the space station. He is scheduled to launch in late October.<br /><br />He will take Clayton Anderson's place on the space station as a flight engineer. Anderson will return to Earth on Discovery.",
 "Astronaut Daniel Tani poses in front of a picture of the space shuttle");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_6.jpg", "Tani will live and work with Whitson and Malenchenko on the space station until December 2007.",
 "Tani, Whitson and Malenchenko pose in front of a large picture of Earth with the space station shown in orbit and the Expedition 16 mission patch in the foreground");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_7.jpg", "As part of the STS-122 crew on space shuttle Atlantis, Leopold Eyharts will travel to the space station. He is a European Space Agency astronaut from France.<br /><br />Eyharts is scheduled to launch in December 2007. He will take Daniel Tani's place on the space station as a flight engineer. Tani will return to Earth on Atlantis.",
 "Astronaut Leopold Eyharts poses in front of the NASA logo");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_8.jpg", "Eyharts will live and work with Whitson and Malenchenko on the space station until February 2008.",
 "Eyharts, Whitson and Malenchenko pose in front of a large picture of Earth with the space station shown in orbit and the Expedition 16 mission patch in the foreground");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_9.jpg", "As part of the STS-123 crew on space shuttle Endeavour, astronaut Garrett Reisman will travel to the space station. He is scheduled to launch in February 2008. <br /><br />He will take Leopold Eyhart's place on the space station as a flight engineer. Eyhart will return to Earth on Endeavour.", 
 "Astronaut Garrett Reisman poses in a bulky white spacesuit");
imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_10.jpg", "Reisman will live and work with Whitson and Malenchenko on the space station until the Expedition 17 crew arrives.",
  "Malenchenko, Whitson and Reisman pose in front of a large picture of Earth, with the Expedition 16 mission patch in the foreground");
imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_11.jpg", "Before its mission, the Expedition 16 crew designed a mission patch. This patch shows the space station as it will look when it is completely finished. The letters XVI are Roman numerals for the number 16.<br /><br />The black circle represents the moon. The space station is shown in the upper right of the circle. The patch symbolizes how work on the station will help the astronauts who will one day go to the moon and beyond.",
 "The round Expedition 16 patch showing the space station and the letters XVI");
 imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp16_Feature/images/pic_12.jpg", "The Expedition 16 mission is an important step toward going to the moon and Mars. NASA can study how astronauts' bodies change when they stay in space for months at a time. What they learn on the space station will help NASA plan for long trips to the moon, Mars and beyond!",
 "An artist's image of Earth with the moon and Mars in the background");


if (document.getElementById||document.all)
	window.onload=Next;
