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/NKC_STS116_Feature/images/NIS_back_button_2.gif';
		document.nextBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_next_button.gif';
	}
	else{
	document.nextBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_next_button.gif';
	document.prevBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_back_button.gif';
	}
changeImg(false);
}
function Next(){
	if(img==imgCnt-1){
		img--;
		document.prevBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_back_button.gif';
		document.nextBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_next_button_2.gif';
	}
	else {
	document.prevBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_back_button.gif';
	document.nextBtn.src='../../../externalflash/NKC_STS116_Feature/images/NIS_next_button.gif';
	}
changeImg(true);

}

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_1.jpg", "The crew of space shuttle mission STS-116 is in space! <br /><br /> In this picture, pilot Bill Oefelein, mission specialist Joan Higginbotham and commander Mark Polansky are in the front row. Mission specialists Bob Curbeam, Nicholas Patrick, Sunita Williams and Christer Fuglesang are in the back row. Williams will stay on the International Space Station as part of the Expedition 14 crew. Credit: NASA", "The STS-116 space shuttle crew of seven poses in launch and entry suits");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_2.jpg", "Astronaut Christer Fuglesang practiced underwater for a spacewalk. He wore a training version of the Extravehicular Mobility Unit space suit. Credit: NASA", "Astronaut Christer Fuglesang floats underwater dressed in a large white space suit");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_3.jpg", "Astronaut Nicholas Patrick trained in the crew compartment trainer. It is a full-size working model of the space shuttle. The astronauts use the trainer to practice what they will do in space. Credit: NASA", "Astronaut Nicholas Patrick climbs through an opening in the crew compartment trainer" );

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_4.jpg", "Astronauts Sunita Williams and Joan Higginbotham used the virtual reality lab at NASA's Johnson Space Center in Houston, Texas. This activity helped them prepare for work on the space station. Credit: NASA", "Astronauts Sunita Williams and Joan Higginbotham work at a computer station");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_5.jpg", "Commander Mark Polansky and pilot Bill Oefelein practiced in the fixed-base shuttle mission simulator. They are in the commander and pilot's station. Their orange suits are training versions of the shuttle launch and entry suit. Credit: NASA", "Commander Mark Polansky and pilot Bill Oefelein dressed in orange training suits");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_6.jpg", "Astronaut Bob Curbeam got help with the training version of an Extravehicular Mobility Unit space suit. He was getting ready to go underwater at the Neutral Buoyancy Laboratory at Johnson Space Center. Credit: NASA", "Astronaut Bob Curbeam smiles as he is helped into a bulky white space suit");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_7.jpg", "Before the mission, the STS-116 crewmembers tasted different kinds of space food. This taste test helped them pick which foods they wanted to take on the mission. They had to select all of their meals before the launch. Credit: NASA", "Five astronauts sit around a table tasting food");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_8.jpg", "The main purpose of the STS-116 mission is continued assembly of the space station. Three spacewalks are planned during the mission.<br /><br />During the first space walk, the astronauts will add on to the space station's truss. The truss is the 'backbone' of the space station.<br /><br />During the other spacewalks, the astronauts will work on the station's wiring. The astronauts will go outside the space station and wait for the team on the ground to send commands to switch off the power. Then, the astronauts will unplug the power cables and plug them into new places. Credit: NASA", "An artist's drawing of the space station after the STS-116 mission");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/NKC_STS116_Feature/images/pic_9.jpg", "The STS-116 mission patch shows the space shuttle rising above the Earth and the International Space Station. Astronaut Christer Fuglesang is from Sweden. The other astronauts are from the United States. To show this, the U.S. and Swedish flags trail behind the orbiter. <br /><br />On the solar panels of the station, the patch shows a bright star. It is a symbol of the crew's important work on that part of the station. Credit: NASA", "A space shuttle flying above the space station forms the top middle section of the STS-116 mission patch, with American and Swedish flag contrails following. The names of the crewmembers encircle the patch.");

if (document.getElementById||document.all)
	window.onload=Next;
