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/STS117_Feature/images/NIS_back_button_2.gif';
		document.prevBtn.title='Back button disabled';
		document.prevBtn.alt='Back button disabled';
		document.nextBtn.src='../../../externalflash/STS117_Feature/images/NIS_next_button.gif';
		document.nextBtn.title='Next';
		document.nextBtn.alt='Next';
		
	}
	else{
	document.nextBtn.src='../../../externalflash/STS117_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
		document.nextBtn.alt='Next';
	document.prevBtn.src='../../../externalflash/STS117_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/STS117_Feature/images/NIS_back_button.gif';
		document.prevBtn.title='Back';
	    document.prevBtn.alt='Back';
		document.nextBtn.src='../../../externalflash/STS117_Feature/images/NIS_next_button_2.gif';
		document.nextBtn.title='Next button disabled';
	    document.nextBtn.alt='Next button disabled';
	}
	else {
	document.prevBtn.src='../../../externalflash/STS117_Feature/images/NIS_back_button.gif';
	document.prevBtn.title='Back';
	document.prevBtn.alt='Back';
	document.nextBtn.src='../../../externalflash/STS117_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
	document.nextBtn.alt='Next';
	}
changeImg(true);

}

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_1.jpg", "This is the STS-117 crew.<br /><br />Mission specialists Clay Anderson, Jim Reilly and Steven Swanson are on the left of the mission patch. Commander Rick Sturckow is holding the mission patch. Pilot Lee Archambault and mission specialists Patrick Forrester and John &quot;Danny&quot; Olivas are on the right.<br /><br /> Anderson is staying on the International Space Station as part of the Expedition 15 crew.", "The seven STS-117 astronauts, dressed in orange shuttle launch and entry suits, pose with their mission patch. An image of the ISS is in the background.");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_2.jpg", "The mission patch shows the International Space Station flying above the Earth. The part of the station that the STS-117 crew added is shown in gold. The shuttle and a banner of red, white and blue show that the United States is proud to explore the universe.<br /><br /> The names of the crew are above and below the orbiting station. The two gold astronaut symbols coming from the '117' at the bottom of the patch stand for the hard work needed to finish the station.", "The station is in the center of this patch, with the names of the crew placed above and below. The number 117, a red, white and blue banner, and a small space shuttle image complete the crew patch.");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_3.jpg", "Astronauts James Reilly and Danny Olivas trained on the middeck in the crew compartment trainer at Johnson Space Center in Houston, Texas. <br /><br />The middeck is below the flight deck of the shuttle.", "Two astronauts, dressed in orange training versions of their shuttle launch and landing suits, sit in a crew compartment trainer" );

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_4.jpg", "Astronaut Clay Anderson practiced using the ISS robotic arm at Johnson Space Center.<br /><br />This robotic arm is called the Canadarm 2.<br /><br /> Anderson joined Expedition 15 as a flight engineer after launching to the station on STS-117.", "Astronaut Clay Anderson is seen through a clear plastic window that surrounds the simulator he is sitting in");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_5.jpg", "Commander Rick Sturckow practiced in the space shuttle crew compartment trainer at Johnson Space Center.", "An astronaut in an orange, shuttle launch and entry suit looks at the control panels of a training simulator");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_6.jpg", "Astronaut Steven Swanson used a joystick in the virtual reality lab at Johnson Space Center to train for his mission.<br /><br /> He practiced using the robotic arm.", "An astronaut uses a joystick to practice for what he will be doing on the space station");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_7.jpg", "STS-117 pilot Lee Archambault checked out the cockpit of the space shuttle Atlantis before the mission.", "An astronaut dressed in a light green cleansuit sits in the cockpit of Atlantis");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/STS117_Feature/images/pic_8.jpg", "Astronaut Patrick Forrester put on a training version of the Extravehicular Mobility Unit space suit just before being put into the water of the Neutral Buoyancy Laboratory near Johnson Space Center in Houston, Texas.", "An astronaut gets help putting on a bulky white space suit");


if (document.getElementById||document.all)
	window.onload=Next;
