// JavaScript Document

var time = 8000;
var mediaType = 'slideshow';
var outsideSearch = true;
var outsideEmailPopUp = false;
var onThanks = 'false';
var debug = false;
var currentVideoIndex;

function loadingDebugFunction() {
	debug = true;
	if (debug == true) {
		alert('in debug!');
	}
}

var videos = new Array (
	"/images/video/widescreenflvs/ThisIsMarialBai.flv",			
	"/images/video/widescreenflvs/SchoolYard.flv",
	"/images/video/widescreenflvs/ParadeforGirlsEducation.flv",
	"/images/video/widescreenflvs/SmallerParade.flv",
	"/images/video/widescreenflvs/ComboniStudents.flv",
	"/images/video/widescreenflvs/AweilairstripIntroForWeb.flv",			
	"/images/video/widescreenflvs/WomanMakesTea.flv",
	"/images/video/widescreenflvs/RiverCrossing.flv",
	"/images/video/widescreenflvs/DaveSurveysPlotOfLand.flv",
	"/images/video/widescreenflvs/TreeChopping.flv",
	"/images/video/widescreenflvs/DanceTroupe.flv"
	
	
);

var videoCaptions = new Array (
	

"During the summer of 2007, Valentino returned to his hometown of Marial Bai in Southern Sudan. In the mid-1980s, Valentino was separated from his family when Marial Bai was destroyed during the second Sudanese Civil War. Here, he films villages around Marial Bai and the nearby state capital of Aweil.",
 
"As Southern Sudan rebuilds after twenty years of civil war, improving the educational infrastructure is essential. This video shows Marial Bai's primary school. The Foundation plans to build an educational center in the village, consisting of a secondary school, a library, athletic fields, and a community center.",

"In celebration of National Girls' Education Day, thousands of students from the region marched through Aweil, the state capital near Marial Bai, showing their commitment to education and support for girls' enrollment in school.",

"At another celebration, students carry banners and sing songs proclaiming the importance of education.",

"Since peace, new schools in Southern Sudan are bustling with activity. Here, students take a break from classes in the schoolyard, and a group of boys enjoy some horseplay before one of the school's administrators ushers them back into the classroom.",

"In July, Dave Eggers joined Valentino in Southern Sudan. Here they are filmed on an airstrip in the state capital of Aweil, explaining the current situation in Southern Sudan and the Foundation's plans to build an educational center in Marial Bai.",

"This video shows a woman who makes and sells tea in Marial Bai. The Foundation has established a Women's Action Group in the village, and aims to start a microfinance program to encourage entrepreneurship among women.",

"During the rainy season, Marial Bai can only be reached after crossing this river in a boat. Here, Valentino films Dave as he leaves Marial Bai, crossing to the nearby village of Nyamlel.",

"A generous plot of land in Marial Bai was given to the Foundation by local government for the purpose of building a secondary school, a library, athletic fields, and teacher and student housing. Here, Dave and Valentino survey the land with local chiefs.", 
 
"Local chiefs held a land-blessing ceremony on the future site of the educational center. In accordance with local custom, Valentino fells a tree while community members look on and a local leader sounds an ox horn.",

"A local dance troupe sang and performed traditional Dinka dances in celebration of the future school. The dancers hold their arms out wide to imitate the horns of cattle, which are vital to the Dinka community."
	
	
);





function selectMedia(theValue, type) {
	//alert(class);
	var ss = document.getElementById('slideshowHolder');
	var v = document.getElementById('videoHolder');
	var nb = document.getElementById('navButtons');
	var ch = document.getElementById('captionHolder');
	var chc = document.getElementById('captionHolderCell');
	var sel = document.getElementById('theSSSelect');
	var y = document.getElementById('caption');	
	
	
	if (type == 'slideshow') {
		mediaType = 'slideshow';
		swapShow(theValue);
		ss.style.display = 'block';
		v.style.display = 'none';
		nb.style.display = 'block';
		ch.style.display = 'block';
		document.getElementById('player').innerHTML = '<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.';
		
	}
	else if (type == 'video') {
		loadVideo(theValue, 'false');
		
	}
}

function loadVideo(theValue, autoStart) {
		var ss = document.getElementById('slideshowHolder');
		var v = document.getElementById('videoHolder');
		var nb = document.getElementById('navButtons');
		var sel = document.getElementById('theSSSelect');
		var y = document.getElementById('caption');	
		
		try {
		var nv = document.getElementById('nextVideoHolder');
		nv.style.display = 'none';
		}
		catch(e) {}
		mediaType = 'video';
		populateVideoThumbs(theValue);
		sel.selectedIndex = parseInt(theValue) + slideshows.length + 3;
		currentVideoIndex = parseInt(theValue);
		
		nb.style.display = 'none';
		v.style.display = 'block';
		ss.style.display = 'none';
		stopSlideshow();
		y.innerHTML = videoCaptions[theValue];
		if (debug == true) {
			s1 = new SWFObject("/images/swf/flvplayerTEST.swf","single","390","239","7");
		}	
		else {
			s1 = new SWFObject("/images/swf/flvplayer.swf","single","390","239","7");
		}
		
		s1.addParam("allowfullscreen","true");
		//s1.addVariable("file","images/video/flv/ThisisMarialBai.flv");
		s1.addVariable("image", "images/video/widescreenflvs/stills/still" + (parseInt(theValue) + 1) + ".jpg");
		//s1.addVariable("width","390");
		//s1.addVariable("height","239");
		s1.addVariable("file", videos[theValue]);
		s1.addVariable("autostart", autoStart);
		s1.write("player");
	
}

function populateVideoThumbs(theValue) {
	
	for(i=0; i<12; i++) {
	
			var x = document.getElementById('thumb' + i);
	
			if (videos[i] != null) {
				x.src = 'images/video/widescreenflvs/stills/thumbs/still' + (i+1) + '_thumb.jpg';	
			}
			else {
				x.src = 'images/blank.gif';
			}
			
			
		document.getElementById('thumb' + i).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + i).setAttribute("className", "thumbBlur");
	
	
	}
	
	document.getElementById('thumb' + theValue).setAttribute("class", "thumbActive");
	document.getElementById('thumb' + theValue).setAttribute("className", "thumbActive");	
			
}

function clickThumb(index) {
	//alert(mediaType);
	if (mediaType == 'slideshow') {
		showSlide(index);
	}
	else if (mediaType == 'video') {
		selectMedia(index, 'video');
	}
}

function showDiv(which, caller, isOn) {
	
	
	var y = document.getElementById(caller);
	
	if (which != 'none') {
	var x = document.getElementById(which);
	
	x.style.display = 'block';
	}


	y.style.backgroundColor='#B1A495';
	y.style.color='#434131';
	
	try {
		
		if (which == 'bookOver' ||  which == 'learnOver' ) {
		var z = document.getElementById('theSSSelect');
		var zz = document.getElementById('player');
		z.style.visibility = 'hidden';
		z.selectedIndex=z.selectedIndex;
		//z.style.height = '0px';
		//z.enabled = 'false';
		zz.style.visibility = 'hidden';
		}
	}
	catch(e) {
	}
	
	
}

function hideDiv(which, caller, isOn) {
	
	var y = document.getElementById(caller);
	
	if (which != 'none') {
	var x = document.getElementById(which);
	x.style.display = 'none';
	}
	
	if(isOn != 'true') {
	y.style.backgroundColor='#4E4131';
	y.style.color='#DFD3BE';
	}
	else {
	y.style.backgroundColor='#ffffff';	
	y.style.color='#434131';
	}
	
	
	try {
			
			if (which == 'bookOver' ||  which == 'learnOver' ) {
			
				var z = document.getElementById('theSSSelect');
				z.style.visibility = 'visible';
				var zz = document.getElementById('player');
				zz.style.visibility = 'visible';
			}
		}
	
	catch(e) {
	}
	
}

function dropDrownRowColor(isOn, which) {
	
	var x = document.getElementById(which);

	if (isOn == 'on') {
	
	x.style.backgroundColor='#E07C26';
	x.style.color='#FFFFFF'
	//show the pointer
	
	}
	
	else if (isOn == 'off') {
	
	x.style.backgroundColor='#E0D3BE';
	x.style.color='#4E4131'
	}
	
}

function loadUrl(url) {
	
document.location.href = url;	
	
}

//slidehsows

var slideshows = new Array();
var slideshowCaptions = new Array();

slideshows[0] = new Array (

"2003slideshow_1",
"2003slideshow_2",
"2003slideshow_3",
"2003slideshow_4",
"2003slideshow_5",
"2003slideshow_6",
"2003slideshow_7",
"2003slideshow_8",
"2003slideshow_9",
"2003slideshow_10",
"2003slideshow_11",
"2003slideshow_12",
"2003slideshow_13",
"2003slideshow_14",
"2003slideshow_15",
"2003slideshow_16",
"2003slideshow_17",
"2003slideshow_18"


);

slideshows[1] = new Array (
 "2007slideshow_03",
"2007slideshow_02",
"2007slideshow_01b",
"2007slideshow_01c",
"2007slideshow_04",
"2007slideshow_04b",
"2007slideshow_05",
"2007slideshow_05b",
"2007slideshow_06",
"2007slideshow_07",
"2007slideshow_07b",
"2007slideshow_07c",
"2007slideshow_08",
"2007slideshow_09",
"2007slideshow_10",
"2007slideshow_11",
"2007slideshow_11b",
"2007slideshow_11c",
"2007slideshow_11d",
"2007slideshow_11e",
"2007slideshow_13",
"2007slideshow_14b",
"2007slideshow_15",
"2007slideshow_15b",
"2007slideshow_17",
"2007slideshow_18",
"2007slideshow_15c",
"2007slideshow_15d",
"2007slideshow_15e",
"2007slideshow_20b",
"2007slideshow_21",
"2007slideshow_22",
"2007slideshow_23",
"2007slideshow_24",
"2007slideshow_25",
"2007slideshow_26",
"2007slideshow_29",
"2007slideshow_37",
"2007slideshow_33",
"2007slideshow_31",
//"2007slideshow_34b",
//"2007slideshow_35",
"2007slideshow_36",
"2007slideshow_37b",
"2007slideshow_37c",
"2007slideshow_37d",
"2007slideshow_50",
"2007slideshow_50b",
"2007slideshow_50c",
"2007slideshow_50d",
"2007slideshow_50e",
"2007slideshow_50f"


);

slideshows[2] = new Array (

"groundslide_1",
"groundslide_2",
"groundslide_3",
"groundslide_4",
"groundslide_5",
"groundslide_6",
"groundslide_7",
"groundslide_8",
"groundslide_9",
"groundslide_10",
"groundslide_11",
"groundslide_12",
"groundslide_13",
"groundslide_14",
"groundslide_15",
"groundslide_16",
"groundslide_17",
"groundslide_18",
"groundslide_19"


);

slideshows[3] = new Array (

 "2008slideshow_01b",
"2008slideshow_02",
"2008slideshow_03",
"2008slideshow_06",
"2008slideshow_07",
"2008slideshow_08",
"2008slideshow_11",
"2008slideshow_12",
"2008slideshow_21",
"2008slideshow_29",
"2008slideshow_29a",
"2008slideshow_29b",
"2008slideshow_31a",
"2008slideshow_31b",
"2008slideshow_32",
"2008slideshow_33a",
"2008slideshow_34",
"2008slideshow_35",
"2008slideshow_39",
"2008slideshow_40",
"2008slideshow_41",
"2008slideshow_41a",
"2008slideshow_41b",
"2008slideshow_42a",
"2008slideshow_42b",
"2008slideshow_42c",
"2008slideshow_42d",
"2008slideshow_42e",
"2008slideshow_42f",
"2008slideshow_42g",
"2008slideshow_42h",
"2008slideshow_42i",
"2008slideshow_42j",
"2008slideshow_42k",
"2008slideshow_42l",
"2008slideshow_43",
"2008slideshow_44",
"2008slideshow_44b",
"2008slideshow_45",
"2008slideshow_45a",
"2008slideshow_45b",
"2008slideshow_47",
"2008slideshow_48",
"2008slideshow_49",
"2008slideshow_52",
"2008slideshow_54",
"2008slideshow_55",
"2008slideshow_56",
"2008slideshow_57",
"2008slideshow_58",
"2008slideshow_59",
"2008slideshow_60"
);

slideshows[4] = new Array (

 "updateslideshow_01",
"updateslideshow_02",
"updateslideshow_03",
"updateslideshow_04",
"updateslideshow_05",
"updateslideshow_06",
"updateslideshow_07",
"updateslideshow_08",
"updateslideshow_09",
"updateslideshow_10"

);

slideshows[5] = new Array (

"dave2008_01",
"dave2008_02",
"dave2008_03",
"dave2008_04",
"dave2008_05",
"dave2008_06",
"dave2008_07",
"dave2008_08",
"dave2008_09",
"dave2008_10",
"dave2008_11",
"dave2008_12",
"dave2008_13",
"dave2008_14",
"dave2008_15",
"dave2008_16",
"dave2008_17",
"dave2008_18",
"dave2008_19",
"dave2008_21",
"dave2008_22",
"dave2008_24",
"dave2008_25",
"dave2008_26",
"dave2008_27",
"dave2008_28",
"dave2008_29",
"dave2008_30",
"dave2008_32",
"dave2008_33",
"dave2008_33b",
"dave2008_34",
"dave2008_35",
"dave2008_35b",
"dave2008_37b",
"dave2008_36",
"dave2008_37",
"dave2008_38"

);

slideshows[6] = new Array (

"A",
"B",
"C",
"D",
"E2",
"E1",
"F",
"F1",
"F7",
"F3",
"F4",
"F5",
"F6",
"G",
"I",
"J",
"K",
"L",
"M",
"08",
"09",
"09b",
"09c",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"26b",
"27",
"28",
"29",
"31",
"32",
"33",
"34",
"35",
"36",
"37",
"38",
"39",
"40",
"41",
"43",
"44",
"45",
"46",
"47"

);

slideshowCaptions[1] = new Array (
"Valentino returned to his home village of Marial Bai last summer to visit his family and speak with the community about the Foundation's plans to build an educational center in the village.",  

//"Valentino, seen here with family and colleagues, hikes from a nearby river crossing to the village of Marial Bai.",   

"Much has improved in Southern Sudan since 2003. The 20-year civil war ended with a peace agreement in 2005, and now the people of Marial Bai are rebuilding their community.",
 
"Valentino and colleagues from the Valentino Achak Deng Foundation hike from a nearby river crossing to the village of Marial Bai.",

"To arrive in Marial Bai during the rainy season, we must drive two hours from the state capital of Aweil, cross this river in a boat, then hike for an hour.",

"Some local children from Marial Bai. Valentino was around their age when the murahaleen attacked the village and he fled, about 21 years ago.", 

"This building used to hold the administrative offices of Marial Bai's main government primary school. Decades of war has left the school in disrepair.",

"When Valentino visited in 2003, there were no teachers and no books in Marial Bai. But conditions are improving, and currently more than 1,000 students are enrolled in primary school.", 

"This sign marks the Marial Bai Primary School. Currently there is no secondary school. The Foundation plans to build a large educational center in the village, beginning with a secondary school.",

"Valentino visiting a class at Comboni Primary School in Aweil, which is similar to the primary school in Marial Bai.", 

"Valentino seated with secondary school students. Monica (left) is 16 years old and aspires to be a doctor. Regina, 17, hopes to be a nurse.", 

"The Foundation supported the establishment of a Women's Action Group in Marial Bai. The members will participate in the management of the Foundation's planned community center.",

"The newly elected officers of the Marial Bai Women's Action Group. With a grant from the Foundation, the group will launch small business ventures, beginning with a restaurant.",

"The teachers' workroom in Marial Bai. There is a shortage of qualified teachers in the region, and classrooms are often overcrowded. Valentino hopes to create a teachers' training program.", 

"When school is not in session, this unfinished classroom in the town of Malualkon is taken over by a cow.", 

"Valentino visits the Ministry of Education, Science, and Technology in Aweil.", 

"An organizational chart of the different directors and their initiatives at the Aweil Ministry of Education, Science and Technology (MOEST).", 

"Valentino visits a newly constructed primary school near Marial Bai.",

"Construction workers adding a new classroom block for a primary school scheduled to open next year.",

"Construction workers during their lunch break.",

"A primary teacher training institute under construction near Marial Bai, which is becoming a regional center for education.",

"A view of the site where the Foundation will build a secondary school, a library, teachers' housing, and a sports facility. For more photos, please see The Marial Bai Educational Center slideshow.", 

"Nearly harvest-ready sorghum. One of the main staples in Northern Bahr al-Ghazal, sorghum grain can resist the region's extreme heat and drought.",

"The purpose of this trip was to speak with local communities about the Foundation's plan to build an educational center in Marial Bai. Here, Valentino talks with a man in the town of Maluakal.", 

"Valentino discussing the planned educational center with local government leaders in Marial Bai.",

"During this trip, Valentino focused on listening to the people to learn about their specific needs and goals for the community.", 

"On the left is Victor Deng, Northern Bahr el-Ghazal's Deputy Governor. Victor was with Valentino at Kakuma Refugee Camp, where he served as a catechist.", 

"A new house being built in Marial Bai, showing local masonry techniques.",

"The roofing techniques used by local builders on new homes in Marial Bai.",

"Local carpenter Santino Deng Arou received the Foundation's first microloan to help him start a business. Recently returned from Kenya, Santino had no money to purchase tools for his work.",

"Sunset over Marial Bai.", 

"After fleeing Marial Bai as a child during an attack by murahaleen, Valentino went to the town of Aweil to seek refuge in this compound, which was then owned by his uncle.",  

"Valentino points to the house where he and several relatives slept while seeking refuge in Aweil.", 

"A bullet hole in the front door of the house. During the civil war, the government of Sudan used Arab cattle herders as a proxy militia force, equipping them with AK-47s.", 

"In celebration of National Girls' Education Day, thousands of students marched through the state capital of Aweil, showing their commitment to education and support for girls' enrollment in school.", 

"The celebration emphasizes the importance of education for the future of Southern Sudan.", 

"Members of the Southern Sudanese army gather to celebrate the life of the late John Garang, the former leader of the SPLA.", 

"Youth joining the celebration in Aweil.", 

"The woman on the right was abducted by murahaleen during an attack in the 1980s, then enslaved for many years by a man living in the north. She was eventually rescued and returned to Marial Bai.", 

"Valentino interviews another woman, named Apobo, for an upcoming book of oral histories on the plight of displaced women in Sudan.",

"Apobo left Marial Bai during the civil war and went to Khartoum, where she was forced into marriage. Eventually she was granted a divorce, and she recently returned to Marial Bai.", 

"It is the hope of the Foundation that increasing access to education in the region will provide a better future for the children of Southern Sudan.", 

"Soccer is by far the most popular sport in Southern Sudan, but proper equipment is hard to come by. The Foundation presented the Marial Bai district team with new uniforms and shoes.",

"Here the Marial Bai district team challenges a team from a nearby town. The makeshift playing field is located next to the dilapidated buildings of Marial Bai's primary school.",

"The majority of the community came to watch the match.",

"A sign outside of Aweil erected by the Government of Southern Sudan (GOSS). In 2011, the south will be allowed to vote to secede from the north and become an independent nation.", 

"The GOSS Minister of Finance and the District Commissioner at the inauguration of the new District Commissioner's office. It is hoped that the new local government office will bring more development assistance to the district.",

"The state's marching band takes a break during the festivities.",

"Local schoolchildren dance to celebrate the inauguration.",

"An onlooker listens to government officials during the ceremony.",

"A sign in the Southern Sudanese capital city of Juba encourages passersby to work for peace."

);



slideshowCaptions[0] = new Array (
"Here we offer a slideshow of photos from Valentino's trip back to Marial Bai with Dave Eggers in 2003, during the writing of <em>What Is the What</em>.", 


"Though the village was peaceful at the time, it had only been one year since the most recent militia attacks. Here, boys gather in Marial Bai's marketplace.", 

"A plane flown by the aid organization Save the Children lands on the Marial Bai airstrip.", 

"Pictured here is a typical village home with goats eating grass in a field.", 

"Valentino rides a bicycle on the main road leading in and out of Marial Bai.", 

"The village is located between two of the largest rivers in the region. Local people fish, collect water, and bring their cows to drink from the rivers.", 

"This boat is used to transport people and goods across the river, to and from the neighboring village of Nyamlal.", 

"Shelter for storing grain and a typical home behind it. Before war, homes were often made of bricks and cement, but inexpensive thatch huts were built once attacks began coming regularly.", 

"Marial Bai is a regional trading center. Valentino's father owned a shop like this one, which sells items like sugar, flour, tea leaves, and soap.", 

"Marial Bai is beginning to rebuild itself since peace was restored in 2005, after twenty years of civil war. In the background are women cutting sorghum.", 

"The primary school in Marial Bai. No classes were in session when Valentino and Dave visited in 2003.", 

"Valentino with his uncle outside his family's home.", 

"Local women and children standing in their yard. The fence in the background surrounds their home.", 

"Local men visit various shops. The large mango tree was planted by Valentino's father many years ago.", 

"This shop is being rebuilt after it was destroyed during the civil war. The owner traveled to Khartoum to purchase corrugated iron sheets for the roofing.", 

"Valentino stands outside a neighbor's home taking video of the family.", 

"Marial Bai's village doctor. Under the tree is the former clan chief's home and courthouse, where marriages, divorces, and civic disputes were settled.", 

"Valentino's cousin stands under an akuel tree, surrounded by calves relaxing in the cool shade."						  

);



slideshowCaptions[2] = new Array (

"A large plot of land in Marial Bai was given to the Foundation by the local government for the purpose of building an educational center. Groundbreaking will occur in January 2008.",

"This land is the future site of a secondary school, a library, athletic fields, and teacher and student housing. Here, two local chiefs survey the land.",

"Dave and Valentino tour the land and discuss the site for the new secondary school.",

"Here, Valentino helps the elders bless the land.",

"Valentino with a Ministry of Education official holding the horn from a ram sacrificed to bless the land.",

"Dave Eggers with one of the local leaders, who is holding an ox horn instrument used to celebrate the land.",

"In accordance with local custom, Valentino fells a tree on the site of the future secondary school, while community members look on.",

"Dave participates in the tree-chopping.",

"People from Marial Bai gather to celebrate on the land. Local youth began clearing small shrubs and bushes to prepare the land for construction.",

"A local dance troupe performed traditional Dinka dances.",

"A feast of chicken, goat, and rice was prepared by the women to accompany the celebration.",

"The dancers hold their arms out wide to imitate the horns of cattle, which are vital to the Dinka community.",

"Hundreds of community members attended the celebration.",

"Valentino joins in with the dancers.",

"This celebration was the first official step toward realizing Valentino's dream of building an educational center in Marial Bai. Valentino's mother is pictured in the center, wearing a yellow headscarf.",

"A member of the dance troupe celebrates the land.",

"The singing and dancing continued late into the evening.",

"One dance includes traditional role-playing in which a woman chases her husband. Here, the woman pretends to chase Dave, who holds the camera.",

"The Marial Bai community is very excited about the prospect of a new school in the region. Valentino returned to Southern Sudan in January 2008, during the dry season, to begin construction on the Marial Bai educational center."
			
);


slideshowCaptions[3] = new Array (

"Valentino returned to Southern Sudan in January to begin work on the educational center he is building in his hometown of Marial Bai. This is an aerial shot of Aweil, the regional capital.",

"When Valentino and Dave visited Aweil in 2003, many buildings were still damaged from war. Today, the region is rebuilding and expanding. New roads are being built on a grid system.",

"Many thousands of Sudanese who were displaced during the war have recently returned, to reunite with loved ones or to resettle in new camps that have been set up for returnees.",

"Most flights into Southern Sudan are operated by relief organizations like Concern or Save the Children. The white land cruiser in this picture is a United Nations vehicle.",

"Solar panels provide electricity for this building at the airstrip.",

"Valentino (far right) holds the camera out to take a picture of his fellow travelers. As Southern Sudan rebuilds, there are many aid workers and westerners in the region.",

"Dancers in traditional Dinka costumes perform outside of Aweil.",

"The dancers hold their arms out to imitate the horns of cattle, which are vital to Dinka culture.",

"Marial Bai is located a few hours northwest of Aweil. Whenever Valentino returns, the community welcomes him and celebrates with singing, dancing, and cooking.",

"Valentino visiting the home of a friend who has just returned to Marial Bai after spending many years in northern Sudan. She now lives in a camp for returnees.",

"Hundreds of thousands of Southern Sudanese who were displaced during the war are now returning home. If they don't still have family in Sudan, many settle in makeshift huts like this one.",

"Most returnees have very little to come back to, and there are scant resources to help them readjust. Most families move into these types of temporary settlements.",

"Valentino at the Lol River, which runs through Marial Bai.",

"Southern Sudanese practice traditional fishing techniques. Here, Valentino casts a throw net into the Lol River.",

"Fishing in the Lol River.",

"Families in Marial Bai keep a lot of livestock on their homesteads. Here, Valentino holds a young lamb.",

"A family's cattle in Marial Bai.",

"A neighbor milking a cow.",

"The giant Marabou stork is a common bird in sub-Saharan Africa.",

"A flock of Marabou storks outside Marial Bai.",

"Deng Malek Athum, a friend of Valentino's. After fleeing Sudan during the war, Athum resettled in Australia. This was his first time back to Marial Bai.",

"Students from the primary school in Marial Bai, participating in community service on a Saturday. The tent in the background belongs to UNICEF, which has been helping Marial Bai rebuild.",

"Secondary school students meeting to discuss student government. Since there is no secondary school in Marial Bai, these students attend class in an old boarding house.",

"Before the war, Marial Bai was known as a center for education in the Northern Bahr al-Ghazal region. This is the old dining hall at the Marial Bai Primary School, now in disrepair.",

"This building used to be teachers' housing, but was also destroyed during the war.",

"The only school structures still standing in Marial Bai are the boarding houses and a few classrooms. Today, more than 1,000 students attend classes in these buildings.",

"It is Valentino's goal to eventually help repair and renovate these old school buildings in Marial Bai, in cooperation with local government.",

"Bricks for Valentino's educational complex are being supplied by a local brick-making factory.",
 
"The factory is located near Aweil, in a place called Agor.",

"There are many brick-makers around Aweil, and finding quality bricks can be difficult. In Agor, they have very fine sand, which is ideal for making strong bricks.",

"There is a lot of inflation in Southern Sudan, and Valentino negotiated with many brick-makers before obtaining a good price.",

"This is the brick-making kiln that will produce bricks for Valentino's secondary school in Marial Bai.",

"Rather than make bricks ourselves, Valentino prefers to support local brick-makers.",

"Supporting local businesses creates jobs for Southern Sudanese, and helps stimulate the economy.",

"By helping local businesses grow, we can help Southern Sudan redevelop.",

"Due to inflation in Southern Sudan, construction materials like cement, timber, and sheet metal are cheaper in Uganda. Shipping costs are also exorbitant; it's cheapest to buy your own truck.",

"In February, Valentino traveled to the Ugandan capital of Kampala to purchase this Mitsubishi Fuso, a 10-wheel cargo hauler.",

"Valentino brought the truck to a garage, since it needed a top before it could be loaded with cement, iron rods, and wheelbarrows.",

"The truck also needed new tires. The original tires were Japanese-made, which can burst under the heat and sun of East Africa.",

"We fitted all ten wheels on the truck with thick rubber tires.",

"The trucks were loaded with 500 bags of cement and hundreds of iron rods before departing Kampala for the 5-day trip to Marial Bai.",

"We also purchased a Toyota Hilux double-cabin pickup truck, to transport smaller materials around the construction site in Marial Bai.",

"This truck can also be loaded with barrels of water for the construction workers. There is no water pump at the construction site, and the Lol River is three miles away.",

"Valentino on a regional flight with Kenyan aid workers.",

"Valentino in Kampala with officials from the Government of Southern Sudan. To Valentino's right is David Amor, the Head of Sudan Relief and Rehabilitation Commission.",

"Amor, who used to be a teacher, taught Valentino briefly during his time in Kakuma Refugee Camp. Many of Valentino's friends from Kakuma are now working for the Southern Sudanese government.",

"These top Sudanese officials and ambassadors were in Uganda because the President of Southern Sudan, Salva Kiir Mayardit, was visiting to meet with the Ugandan president.",

"Here, the officials welcome Kiir as his plane lands in Kampala. Valentino was honored to be invited to this welcoming reception, and was allowed to photograph all of the festivities.",

"President Kiir is greeted at the Kampala airport by Sudanese and Ugandan ministers.",

"Also in attendance were the Ugandan Minister of Defense and many top military leaders from the Sudan People's Liberation Army (SPLA), the army of the Southern Sudanese government.",

"President of Southern Sudan and Vice President of Sudan, the Honorable Salva Kiir Mayardit.",

"At the conference, President Kiir encouraged Sudanese students to return to Southern Sudan and participate in rebuilding and redevelopment efforts in their home country."

);

slideshowCaptions[4] = new Array (

"The Valentino Achak Deng Foundation has started construction on the educational center we are building in Valentino's hometown of Marial Bai.",

"The first phase of construction is a secondary school. A local engineer poured the foundation in late May.",

"The entire community is supporting the project; all of the workers are from Marial Bai, and local students, teachers, and parents visit the site often to see the progress.",

"In the coming weeks, the roof will be built and the walls will be plastered and painted.",

"Even before construction is complete on this five-classroom school structure, we will start work on an adjacent four-classroom building.",

"Local primary school students from Marial Bai visiting the construction site.",

"The school is being built on a large plot of land that was donated to the Foundation last year by the local government.",

"We have established an Advisory Council composed of local chiefs, regional administrators, women's leaders, and representatives from the education, health, and commercial sectors.",

"Ngong, a local primary school student who lives near the school-building site. He hopes to attend the school when it is completed.",

"Students in front of the Marial Bai Primary School. There are several primary schools in the region, but no functioning secondary school for those who want to continue their education."

);

slideshowCaptions[5] = new Array (

"In September 2008, Valentino Achak Deng and Dave Eggers traveled back to Valentino's hometown of Marial Bai in Southern Sudan, where the Valentino Achak Deng Foundation is constructing a secondary school.", 

"Valentino designed the 6-building school complex and has been overseeing the construction. The first classroom building has an arched facade and will house a science lab and computer lab.", 

"The second building, adjacent to the first, will hold five classrooms. The walls will be plastered and painted, and gabled roofs will provide a shady veranda where students can spend time between classes.", 

"Valentino and Dave at the brick factory where the school’s bricks are made, near the Lol River in Marial Bai. The brick makers are at the kiln in the background.",

"While bricks are locally available, materials such as timber, iron sheets, and cement must be purchased in Uganda and transported to Marial Bai.", 

"A close-up of the wide veranda being constructed along the front of the school. Valentino based the designs for his secondary school on those he attended in Kakuma Refugee Camp in Kenya.",  

"Head engineer Leek Deng lays bricks on the veranda, on an afternoon when most of the workers have already gone home.", 

"Leek demonstrates how the exterior of the school will be plastered and painted. During the civil war in Southern Sudan, Leek left Marial Bai to work as a builder in Khartoum, but has returned since the peace was signed in 2005.",

"In addition to the secondary school, the Foundation’s educational complex in Marial Bai will include a library, a teacher-training college, a community center, and sports facilities.", 

"An arched passageway is being built through the middle of the 4-classroom building, which will lead from the courtyard to the student dormitories behind the school.", 

"The secondary school is being built on a large undeveloped plot of land that was donated to the Foundation by the local government.", 

"The campus quad will be built around a central courtyard, flanked by the two school buildings, the library, and the teachers' offices. The community center will be built closer to the market center.",

"Cattle wander the road leading to the school site.",  

"A view from a thatched fence over sorghum fields.",  

"Sorghum ready for harvest. In the distance is the Marial Bai Primary School, which was heavily damaged during the war and is still in disrepair.", 

"This large tree is right outside Valentino's family compound. Valentino remembers climbing in it when he first saw the murahaleen raiders arrive in Marial Bai.",

"Garang Deng and Deng Deng, two of the Foundation's staff members in Marial Bai, help oversee the school construction.", 

"Valentino explains the designs for the teachers' compound to the workers and local students.", 

"Valentino gives a tour of the school site to community members.", 

"Valentino and Dave in front of Valentino's family compound.", 

"Volleyball, along with soccer, is a popular sport in Marial Bai.", 

"Arou Deng, Valentino's older brother, is the head supervisor at the construction site.",

"View from inside one of Marial Bai’s primary school classrooms. Most of these buildings are still in disrepair after being damaged during the war.", 

"The former headmaster's residence at the primary school, which was destroyed during the war. Today it’s used by community members for informal meetings.",  

"Gabriel Kuach Logo, a biology teacher from Marial Bai. For Valentino's secondary school, we will recruit and train local teachers, as well as members of the Sudanese diaspora living in Kenya and Uganda.",  

"Dave, Valentino's father Deng Nyibek, and Valentino, pictured inside Valentino's family's compound.", 

"On this trip, Valentino and Dave flew into Marial Bai with the first supply of textbooks and school materials that will be used in the secondary school.",	

"Arou Deng helps offload supplies from the plane to the Foundation's pickup truck.", 

"A view from inside the plane. Many children and community members came to watch the plane take off.",  

"Taken from Valentino's window during takeoff.", 

"An aerial view of the Marial Bai market and the primary school campus.",

"An aerial view of the road leading from the market to the school site.",

"View of the Lol River. Marial Bai is located in the Northern Bahr al-Ghazal state of Southern Sudan, a name that means 'river of gazelles.'",  

"The plane landed for refueling in Rumbek, a large town in Southern Sudan busy with NGO activity.", 

"The pilot with security officials in Rumbek.", 

"The airstrip in Rumbek, as Valentino talks on a satellite phone in the distance.",

"Most flights in Southern Sudan are operated by the United Nations.",

"Valentino and the pilot after landing in Lokichoggio, a town in northwest Kenya. During the war in Southern Sudan, this town was the major base of operations for relief organizations delivering aid into Southern Sudan." 

);

slideshowCaptions[6] = new Array (


"Students from the Marial Bai Secondary School in Southern Sudan, which opened for classes in early May.",

"The 9-classroom facility is the first fully-functional secondary school in the entire region, where students have no other opportunities to continue their education.",

"Major emphasis at the school is being placed on providing girls with access to education. Currently, less than one percent of girls complete secondary school in Southern Sudan. The Foundation is raising funds to construct a boarding facility, to provide female students with a safe learning environment and an alternative to early marriage.", 

"Classes began in early May with eighty-five students. This group of first-year students will be the pilot class for the Marial Bai Secondary School; more advanced-level sections will be added later, as the school builds capacity and more students are admitted. More than a thousand students have applied to enroll at the school.",

"Elizabeth Alekiir Akoon, 17, and Angelina Adior Akueny, 16, two new students at the Marial Bai Secondary School. Elizabeth wants to be a doctor after she finishes her education, and Angelina wants to be a pilot.",

"To lead the school, a faculty of highly-qualified teachers were recruited from across Southern Sudan. From left: William Deng, Gabriel Kwach, and Mabior Deng. Later this year the faculty will be joined by teachers from other countries in Eastern Africa and teams of volunteer teachers from America, Canada, and Europe.",

"Math, Physics, Chemistry, and Biology classes are held in the Math & Sciences building.",

"The Math & Sciences building features a brand new science lab. Here, teacher Mabior Deng demonstrates how to use a microscope.",

"Students using a microscope for an in-class Biology experiment.",

"A student reads the Chemistry textbook to prepare for an experiment on dissolving fluids.",

"Assessing dissolved salts in a beaker of water.",

"Students play a game of soccer after lunch.",

"Plans are currently underway to build sports fields for soccer and volleyball behind the school.",

"Students in front of the school timetable during a break between classes.",

"Students relax under the shade of a tree in the school’s courtyard.",

"Students from a nearby primary school built a road to connect their school with the Marial Bai Secondary School. Here they arrive at the secondary school after clearing small trees and underbrush from the path, so that cars may pass.",

"There are more than 25 primary schools in the greater Marial Bai region, which will all feed into the Marial Bai Secondary School.",

"In April, we conducted entrance exams in every major village around Marial Bai to assess the students’ knowledge levels on subjects they learned in primary school.",

"Girls’ education is a sensitive issue in Southern Sudan. More than fifty girls applied to attend the Marial Bai Secondary School, but cultural and family pressures and the issue of early marriage deterred many of them from actually registering. There are currently nine girls enrolled. The Foundation is raising funds to construct boarding facilities, and we are working with the local community and women’s groups to help increase girls’ participation at the school.",

"Students enjoying themselves on the school veranda during a class break.",

"Students from all across the state of Northern Bahr al-Ghazal came to Marial Bai to attend the school.",

"Class in session. The typical class size in Southern Sudan is 30-40 students per section.",

"Mr. Logo Gabriel Kwach teaches Agriculture, Biology, and Commerce. He grew up in Kakuma Refugee Camp, was educated in Kenya, and recently returned to Southern Sudan to teach.",

"In April, the Foundation transported full sets of textbooks, uniforms for the student body, school supplies, and other educational materials from Nairobi to Marial Bai.",

"An aerial view from the cargo plane showing the completed school, with the student dining hall and meeting center behind the schoolhouses.",

"An aerial view of the school campus, with the thatched roofs of the newly-constructed teacher compound behind the school. The complex will eventually include a library, dormitories, a school farm, sports fields, a teacher-training college, and school offices.",

"The Foundation’s ground staff in Marial Bai touring the school complex. The dining hall is on the left, the kitchen is on the right, and the school is in the background.",

"In early May, the foundations were dug and poured for a school library, where learning resources will be available to the entire community and adult literacy classes will be offered in the evenings. The library will be located on the main school quad, facing the math and sciences building.", 

"Teacher houses are made of concrete with traditional thatched roofs.",

"The teacher houses are arranged around a central meeting hall, where the Foundation is developing a teacher-training college for aspiring teachers in the region. Programs will bring together local teachers with members of the Sudanese diaspora and Western educators through collaborative teaching methods and symposia.",

"A borehole was drilled and pump installed at the center of the campus to provide the school with a clean water source.",

"The student dining hall and meeting center, located behind the schoolhouses.",

"The school kitchen and storage house.",

"The Foundation plans to build more teacher houses as the school expands and the teacher-training college develops. Donations of $1,500 can build a teacher house.",

"The Foundation’s ground staff members Deng Deng and Stephen Mel with the head engineer Leek Majok.", 

"A view of the math and sciences building from the veranda of the 5-classroom school row.",

"Students arriving for classes during the first week of school.",

"Months before the school opened, the Foundation began recruiting and interviewing Sudanese teacher candidates by advertising in regional newspapers and working with the Ministry of Education. Here, a local teacher reads the Foundation’s vacancy announcement posted in front of the Ministry in the state capital of Aweil.",

"Students and community members in the town of Wanyjok reading a flyer posted in the market about the new Marial Bai Secondary School.",

"Mary Apok, Mary Adem, Maria Deng, and Maria Athiop run a tea shop at the school construction site. When the school began accepting applications from students, all four girls applied to attend the school.",

"Student applicants taking the entrance exam.",

"The students were tested in all the major subjects taught in primary school. Preference for enrollment was given to girls, disabled students, orphans and other disadvantaged youth.",

"Students from a nearby primary school visiting the Marial Bai Secondary School.",

"Many of these primary school students expressed hope that they would one day attend the Marial Bai Secondary School.",

"A student in the town of Aweil reads a message board with the Foundation’s postings about the Marial Bai Secondary School.",

"Orientation day for students.",

"The school’s new teachers led the meeting, stressing the importance of education and explaining the policies, procedures, rules, and regulations of the Marial Bai Secondary School.",

"After the orientation meeting, uniforms were distributed to the students. Hundreds of uniforms were generously donated and shipped to Sudan by Katy Marrotte of the Hunter Valley Grammar School in Maitland, New South Wales, Australia.",

"The students were overjoyed to receive the classy new uniforms.",

"Faculty members Mr. William Atak Deng, Mr. Lonyo James Lonyo, and Mr. Logo Gabriel Kwach meeting with the Foundation’s associate director Greg Larson to discuss the curriculum for the Marial Bai Secondary School.",

"All-school assembly on the first day of classes.",

"New students Elizabeth, Veronica, and Angelina enjoying a break between classes.",

"The school will follow the Southern Sudanese curriculum for secondary education, but since secondary-level textbooks are not currently available within Southern Sudan, they must be brought from neighboring Kenya.",

"Mr. Lonyo James Lonyo teaches Math, Physics, and Chemistry. Here, he gives his introductory lecture on the first day of Chemistry class.",

"Lunch is prepared daily for the students by the school’s three cooks. For the first few days of school, the meals were cooked under a tree while the kitchen was under construction.",

"The school’s cooking staff: Apuk, Mary, and Achol. In 2007, Achol was interviewed by Valentino Deng and Dave Eggers, and her narrative was featured in Out of Exile, a book of Sudanese oral histories published in 2008 as part of the Voice of Witness series.",

"To provide students with supplemental instruction and tutoring opportunities, classes at the Marial Bai Secondary School run from 8:00am to 4:30pm. Above, students head home after the first day of classes."						  

);

which = 0; //the current slideshow
thumbGroup = 0;
currentThumb = 0;
maxThumb=11;
count=0;
grp=0;
mode = "playing";

function swapShow(whichShow) {
	
	//alert('flipped!!!');

	which = whichShow;
	
	clearInterval(myInterval);
	startSlideshow(which);
	
	
	
}




function startSlideshow(whichShow) {
	
	which = whichShow;
	
	
	thumbGroup = 0;
	currentThumb = 0;
	//maxThumb=11;
	count=0;
	grp=0;
	mode = "playing";
	var x = document.getElementById('toggleButton');	
	x.src = 'images/button_pause.gif';
	
	/*try {
	
	clearInterval(myInterval);
	}
	
	catch(e) {
	}*/
	
	myInterval = window.setInterval("advanceSlideshow()", time);	
	maxThumbGroup = Math.ceil(slideshows[which].length/12);	
	changeImage();
	populateThumbs();
	//alert(maxThumbGroup);
	
}

function advanceSlideshow() { //called by the interval

	
		if(count < slideshows[which].length - 1) {
		count++;
		}
		else {
		count = 0;
		}
	
	
	changeImage();
	advanceThumb();

}

function ssFwd() { //when fwd button is presssed
	
	advanceSlideshow();
	restartInterval();
	
}

function restartInterval() {
	
	if(mode == "playing") {
		clearInterval(myInterval);
		myInterval = window.setInterval("advanceSlideshow()", time);		
	}

}

function populateThumbs() {
	
	for(i=0; i<12; i++) {
	
			var x = document.getElementById('thumb' + i);
	
			if (slideshows[which][i + grp] != null) {
			x.src = 'images/slideshows/' + which + '/thumbs/' + slideshows[which][i + grp] + '.jpg';	
			
				
				maxThumb = i;
			}
			else {
				
			x.src = 'images/blank.gif';
			}
			
		document.getElementById('thumb' + i).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + i).setAttribute("className", "thumbBlur");
	
	
	}
	
	document.getElementById('thumb0').setAttribute("class", "thumbActive");
	document.getElementById('thumb0').setAttribute("className", "thumbActive");	
			
	
	
}

function advanceThumb() {
	
	if (currentThumb == maxThumb) {
	
	//flip all 12 to new images, set the first one to non blurred, increment the index
	currentThumb=0;	
	thumbGroup++;
	
	
	
	//cant hardcode!
	document.getElementById('thumb' + maxThumb).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + maxThumb).setAttribute("className", "thumbBlur");
	
	document.getElementById('thumb0').setAttribute("class", "thumbActive");
	document.getElementById('thumb0').setAttribute("className", "thumbActive");
	
	flipThumbs();
	}

	else {
	document.getElementById('thumb' + currentThumb).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + currentThumb).setAttribute("className", "thumbBlur");
	currentThumb++;
	document.getElementById('thumb' + currentThumb).setAttribute("class", "thumbActive");
	document.getElementById('thumb' + currentThumb).setAttribute("className", "thumbActive");
	}	
	
}


function deprecateThumb() {
	
	if (currentThumb == 0) {
	
			//this case is only if we're on the actual slide zero, first group
			if (thumbGroup == 0) {
				thumbGroup = maxThumbGroup - 1;
			}
			else {
				
				thumbGroup = thumbGroup - 1;
			}
			
			flipThumbs();
			currentThumb=maxThumb;	
			
			
			
			//cant hardcode!
			document.getElementById('thumb' + maxThumb).setAttribute("class", "thumbActive");
			document.getElementById('thumb' + maxThumb).setAttribute("className", "thumbActive");
			
			document.getElementById('thumb0').setAttribute("class", "thumbBlur");
			document.getElementById('thumb0').setAttribute("className", "thumbBlur");
			
			//flipThumbs();
	}

	else {
	document.getElementById('thumb' + currentThumb).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + currentThumb).setAttribute("className", "thumbBlur");
	currentThumb--;
	document.getElementById('thumb' + currentThumb).setAttribute("class", "thumbActive");
	document.getElementById('thumb' + currentThumb).setAttribute("className", "thumbActive");
	}	
	
}

function flipThumbs() {
	
	//alert('flipping?');
	
	if(thumbGroup < maxThumbGroup) {
	grp = (thumbGroup * 12);
	}
	else {
	grp = 0;	
	thumbGroup = 0;
	}
	
	populateThumbs();
	

}



function ssBack() {
	
	
	
	if(count > 0) {
	count--;
	}
	
	
	else {
	count = slideshows[which].length - 1;
	}
	
	
	//alert (x.src);
	changeImage();
	deprecateThumb();
	restartInterval();
	
	
}

function changeImage() {
	
	var x = document.getElementById('slide');	
	x.src = 'images/slideshows/' + which + '/' + slideshows[which][count] + '.jpg';	
	
	var y = document.getElementById('caption');	
	y.innerHTML = slideshowCaptions[which][count];
	
}

function ssToggle() {
	
	var x = document.getElementById('toggleButton');	
	
	if(mode == "playing") {
	
		stopSlideshow();
	}
	
	else {
		
	myInterval = window.setInterval("advanceSlideshow()", time);		
	mode="playing";
	x.src = 'images/button_pause.gif';
	}
	
}

function stopSlideshow() {
	var x = document.getElementById('toggleButton');	
	clearInterval(myInterval);
	mode="paused";
	x.src = 'images/button_play.gif';	
}


function ssRestart() {
	
	myInterval = window.setInterval("advanceSlideshow()", time);	

}




function showSlide(thisCount) {
//takes in the thumb position, might to add a multiple of 12, depending on the index var	
	var adder = thumbGroup * 12;

	
	document.getElementById('thumb' + currentThumb).setAttribute("class", "thumbBlur");
	document.getElementById('thumb' + currentThumb).setAttribute("className", "thumbBlur");
	
	document.getElementById('thumb' + thisCount).setAttribute("class", "thumbActive");
	document.getElementById('thumb' + thisCount).setAttribute("className", "thumbActive");

	
	
	//give this one the highlight and tell us where we are
	count = thisCount + adder;
	currentThumb = thisCount;
	
	changeImage();
	restartInterval();
}

function clearForm(which, text) {
	var x = document.getElementById(which);
	if (x.value == text) {
	 x.value = '';
	}
}

function submitMailForm(which) {


	if (which == 'mailinglistpage') {//done
		var x= document.getElementById('emailInput_ml');
		var form = document.getElementById('mailForm_ml');
		validateForm(x, form);
	}
	else if (which == 'topnav') {//done
		var x= document.getElementById('emailInput_topnav');
		var form = document.getElementById('mailForm_topnav');
		validateForm(x, form);
	}
	else if (which == 'sidebar') {//done
		var x= document.getElementById('emailInput_sidebar');
		var form = document.getElementById('mailForm_sidebar');
		validateForm(x, form);
	}
	else if (which == 'thanksform') {
		var form = document.getElementById('mailForm_thanksform');
		form.submit();
	}

	

}

function validateForm(x, form) {
	if(x.value == '' || x.value.indexOf('@') == -1 || x.value.indexOf('.') == -1) {
		alert('please enter a properly formatted email address');
	}
	else {
		form.submit();
	}
}
/*
function submitMailForm2() {



var x= document.getElementById('emailInput2');

		if(x.value == '' || x.value.indexOf('@') == -1 || x.value.indexOf('.') == -1) {
			
			alert('please enter a properly formatted email address');
		}
		else {
			document.getElementById('mailForm').submit()
		}

}*/

searchDisplay = false;

function popSearch() {
	var x = document.getElementById('searchInput');
	x.style.visibility = 'visible';
	searchDisplay = true;
}

function hideSearch() {
	try {
		var x = document.getElementById('searchInput');
		x.style.visibility = 'hidden';
		searchDisplay = false;
	}
	catch(e) {}
}


function submitSearch() {
	if (searchDisplay == true) {
		document.getElementById('searchbox_009365313097231326504:lezrkiwk1i4').submit();
	}
}

function closeSearch() {
	if (outsideSearch == true) {
		hideSearch();
	}
	if (outsideEmailPopUp) {
		//hideEmail();	
	}
}

function movieDone() {
	//alert ('done!');
	var v = document.getElementById('videoHolder');
	var nv = document.getElementById('nextVideoHolder');
	var nvtl = document.getElementById('nextVideoTextLink');
	var nvi = document.getElementById('nextVideoImage');
	var cap = document.getElementById('caption');	
	
	cap.innerHTML = '';
	v.style.display = 'none';
	nv.style.display = 'block';
	var sel = document.getElementById('theSSSelect');
	//TODO: if its last, looop back to 1
	nvtl.innerHTML = sel[currentVideoIndex + slideshows.length + 4].innerHTML; //+3 for the placeholder items, +1 to goto next
	nvi.src = "images/video/widescreenflvs/stills/still" + (currentVideoIndex + 2) + ".jpg" //normally +1, 2 gives us the next
}

function loadNextMovie() {
	//s1.addVariable("image", "images/video/widescreenflvs/stills/still" + (parseInt(theValue) + 1) + ".jpg");
	
	loadVideo(currentVideoIndex + 1, 'true');
	//if its last, looop back to 1
}


function popPhpListJoin(email) {
 	//alert(email);	
	//storedEmail = email;
	
	var h = document.getElementById('joinEmailListDiv');
	h.style.display = 'block';
	var f = document.getElementById('mailFrame');
	mailFrame.populateEmail(email);
	var gd = document.getElementById('greyDiv');
	gd.style.display = 'block';
	var cd = document.getElementById('emailConfirmDiv');
	cd.style.display = 'none';
	onThanks == 'true';
}

function hideEmail() {
	//alert('wtf!!!');
	if (onThanks == 'false') {
		var cd = document.getElementById('emailConfirmDiv');
		cd.style.display = 'block';
	}
	else {
		yesClose();
	}
	
}


function yesClose() {
	var gd = document.getElementById('greyDiv');
	gd.style.display = 'none';
	var h = document.getElementById('joinEmailListDiv');
	h.style.display = 'none';
	outsideEmailPopUp = false;
	var cd = document.getElementById('emailConfirmDiv');
	cd.style.display = 'none';
	//refresh the page, in case it was on thanks page
	top.mailFrame.location.href = '/lists/index.php?p=subscribe&id=1';
	
	
}

function noClose() {
	var cd = document.getElementById('emailConfirmDiv');
	cd.style.display = 'none';

}

/******* load phpList frame and prepopulate the email ********/

function loadMailConfirm(email) {
	loadUrl('/mailingList/join.php?email=' + email);
}













