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/Exp15_Feature/images/NIS_back_button_2.gif';
		document.prevBtn.title='Back button diabled';
		document.prevBtn.alt='Back button diabled';
		document.nextBtn.src='../../../externalflash/Exp15_Feature/images/NIS_next_button.gif';
		document.nextBtn.title='Next';
		document.nextBtn.alt='Next';
	}
	else{
	document.nextBtn.src='../../../externalflash/Exp15_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
	document.nextBtn.alt='Next';
	document.prevBtn.src='../../../externalflash/Exp15_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/Exp15_Feature/images/NIS_back_button.gif';
		document.prevBtn.title='Back';
		document.prevBtn.alt='Back';
		document.nextBtn.src='../../../externalflash/Exp15_Feature/images/NIS_next_button_2.gif';
		document.nextBtn.title='Next button disabled';
		document.nextBtn.alt='Next button disabled';
	}
	else {
	document.prevBtn.src='../../../externalflash/Exp15_Feature/images/NIS_back_button.gif';
	document.prevBtn.title='Back';
	document.prevBtn.alt='Back';
	document.nextBtn.src='../../../externalflash/Exp15_Feature/images/NIS_next_button.gif';
	document.nextBtn.title='Next';
	document.nextBtn.alt='Next';
	}
changeImg(true);

}
imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_1.jpg", "The Expedition 15 mission patch changed several times during the mission. The Russian crew stayed the same the entire mission. But the U.S. crew changed two times! Each time the crew changed, the patch changed, too.", "This oval patch features a flat map of the globe. The Roman numeral XV (15) is superimposed on ground tracks that cross over the map. A white picture of a shuttle docked to the station is placed in the top center of the patch, with Russian and U.S. flags coming out from each side of the picture.");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_1.jpg", "In the center of the Expedition 15 patch is a flat map of the world. The yellow dots on the map show the mission control centers in the U.S. and Russia.<br /><br /> The artist formed the Roman numeral XV (15) in the middle of the patch.<br /><br /> The Russian and U.S. flags are shown coming out from each side of a picture of the International Space Station with the shuttle docked to it. The flags join to show that the two countries are working together to complete the station.", "This oval patch features a flat map of the globe. The Roman numeral XV (15) is superimposed on ground tracks that cross over the map. A white picture of a shuttle docked to the station is placed in the top center of the patch, with Russian and U.S. flags coming out from each side of the picture");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_2.jpg", "The patch in this picture shows the names of the first Expedition 15 crewmembers, Russia's Fyodor Yurchikhin and Oleg Kotov, and Sunita Williams from the United States.<br /><br />Fyodor Yurchikhin was the Expedition 15 commander. He last visited the station in October 2002 on shuttle mission STS-112. Oleg Kotov is a flight engineer and was the Soyuz commander for Expedition 15.<br /><br />Sunita Williams was a member of the Expedition 14 crew and stayed on the station as a flight engineer for Expedition 15 until departing on STS-117.", "The Expedition 15 mission patch with the names of the three original crewmembers Yurchikhin, Williams and Kotov, along the bottom");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_3.jpg", "The first Expedition 15 crewmember from the United States was astronaut Sunita Williams. She lived on the International Space Station from Dec. 9, 2006, to June 18, 2007.<br /><br />She traveled to the station on the space shuttle Discovery. She returned to Earth on the space shuttle Atlantis.", "Astronaut Sunita Williams' picture is shown placed on top of the Expedition 15 patch with a small arrow pointing to her name" );

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_4.jpg", "Russian cosmonaut Fyodor Yurchikhin was the Expedition 15 commander.<br /><br /> He visited the space station in 2002 on the STS-112 space shuttle mission.", "Russian cosmonaut Fyodor Yurchikhin's picture is shown placed on top of the Expedition 15 patch with a small arrow pointing to his name");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_5.jpg", "Russian cosmonaut Oleg Kotov was the Soyuz commander and one of the flight engineers for Expedition 15. He is a doctor who has studied how spaceflight changes people's bodies.<br /><br /> This was his first trip to the space station.", "Russian cosmonaut Oleg Kotov's picture is shown placed on top of the Expedition 15 patch with a small arrow pointing to his name");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_6.jpg", "Flight engineer Clayton Anderson flew to the space station on the STS-117 space shuttle mission.<br /><br /> He and Williams worked together while the shuttle was docked with the space station. Then, Williams returned home with the STS-117 shuttle crew.", "The Expedition 15 mission patch with the name Anderson above the names of the three original crewmembers: Yurchikhin, Williams and Kotov");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_7.jpg", "U.S. astronaut Clayton Anderson replaced Sunita Williams as U.S. flight engineer on the space station.<br /><br /> This mission was his first trip into space.", "Astronaut Clayton Anderson's picture is shown placed on top of the Expedition 15 patch with a small arrow pointing to his name");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_8.jpg", "After astronaut Sunita Williams returned home with the STS-117 shuttle crew, the patch changed again. Fyodor Yurchikhin, Oleg Kotov and Clayton Anderson worked together on the station until the Expedition 16 crew arrived.", "The Expedition 15 mission patch with Anderson's name between the names of original crewmembers Yurchikhin and Kotov");

imgInfoArray[imgCnt++] = new Array ("../../../externalflash/Exp15_Feature/images/pic_9.jpg", "This final version of the mission patch includes the names of all the U.S. astronauts who served on board the station with Fyodor Yurchikhin and Oleg Kotov on Expedition 15.", "The Expedition 15 mission patch with the name Anderson above the names of the three original crewmembers: Yurchikhin, Williams and Kotov");

if (document.getElementById||document.all)
	window.onload=Next;
