// JavaScript Document


var mypic = new Array();

var mybigpic = new Array();

var curcaps = new Array();

var currthumbspage;

var numthumbspage;

var currpagelastimg;

var currpagefirstimg;

var galhtml;



function genpics(iscountry)

{



if(iscountry=="Thailand") 

	{

	n=21;

	curcaps=thaicaps;

	}

if(iscountry=="Vietnam") 

	{

	n=18;

	curcaps=vietcaps;



	}

if(iscountry=="Cambodia") 

	{

	n=53;

	curcaps=camcaps;

	}

if(iscountry=="Ecuador") 

	{

	n=14;

	curcaps=eccaps;

	}




if(n<19)

{

	galhtml="<div id=\"mainimgcontainter\"><div id=\"mainimgplace\"><img src=\"\" id=\"mainimg\" alt=\"Gallery\" onclick=\"bigpic(currimg);\" onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/></div><div id=\"playcontrols\"><img src=\"/images/back.gif\" id=\"backimg\" alt=\"back\" onclick=\"pushback();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/><img src=\"/images/pause.gif\" id=\"playimg\" alt=\"play\" onclick=\"pushplay();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/><img src=\"/images/next.gif\" id=\"nextimg\" alt=\"next\" onclick=\"pushnext();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/></div><div id=\"photocaptions\"></div><div id=\"thumbs_pages\">";

	for(i=0;i<n;i++)

	{

		mypic[i]="/images/"+iscountry+"/"+iscountry+"-"+i+".jpg";		

		galhtml=galhtml+"<img src='"+mypic[i]+"' class='thumbs' alt='"+iscountry+"-"+i+"' id='thumb"+i+"' onclick='bigpic(\""+i+"\");' onmouseout='leaveimg(\"thumb"+i+"\");' onmouseover='changeimg(\"thumb"+i+"\", "+i+");'/>";

		mybigpic[i]="/images/"+iscountry+"/full/"+iscountry+"-"+i+".jpg";

	}

galhtml=galhtml+"<br/><br/>";

lastimg=n;

currpagelastimg=n;

currpagefirstimg=0;

document.getElementById("photocontent").innerHTML=galhtml;

document.getElementById("mainimg").setAttribute("src", mypic[0]);

document.getElementById("photocaptions").innerHTML=curcaps[0];





InitializeTimer();

}else{

	drawmultithumbs(iscountry, 0);

}



}



function drawmultithumbs(iscountry, currthumpage)

{

	

numthumbspage=Math.ceil(n/18);

lastimg=n;

var k=currthumpage*18;

currpagefirstimg=k;

galhtml="<div id=\"mainimgcontainter\"><div id=\"mainimgplace\"><img src=\"\" id=\"mainimg\" alt=\"Gallery\" onclick=\"bigpic(currimg);\" onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/></div><div id=\"playcontrols\"><img src=\"/images/back.gif\" id=\"backimg\" alt=\"back\" onclick=\"pushback();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/><img src=\"/images/pause.gif\" id=\"playimg\" alt=\"play\" onclick=\"pushplay();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/><img src=\"/images/next.gif\" id=\"nextimg\" alt=\"next\" onclick=\"pushnext();\"onmouseover=\"changepoint('1');\" onmouseout=\"changepoint('2');\"/></div><div id=\"photocaptions\"></div><div id=\"thumbs_pages\">";



var ktwo = k+18;	

for(i=k;i<ktwo;i++)

	{

		if(i<n)

		{

			

		mypic[i]="/images/"+iscountry+"/"+iscountry+"-"+i+".jpg";		

		galhtml=galhtml+"<img src='"+mypic[i]+"' class='thumbs' alt='"+iscountry+"-"+i+"' id='thumb"+i+"' onclick='bigpic(\""+i+"\");' onmouseout='leaveimg(\"thumb"+i+"\");' onmouseover='changeimg(\"thumb"+i+"\", "+i+");'/>";

		mybigpic[i]="/images/"+iscountry+"/full/"+iscountry+"-"+i+".jpg";

		currpagelastimg=i+1;

		}

	}





	galhtml=galhtml+"<br/><br/>";

var j;

for(i=0;i<numthumbspage;i++)

	{

		j=i+1;

		if(i!=currthumpage)

		{

		galhtml=galhtml+" <a href=\"javascript:drawmultithumbs('"+iscountry+"', '"+i+"')\">"+j+"</a>";

		}else{

		galhtml=galhtml+" "+j;

		}

	}
galhtml=galhtml+"</div>";


document.getElementById("photocontent").innerHTML=galhtml;

document.getElementById("mainimg").setAttribute("src", mypic[k]);

document.getElementById("photocaptions").innerHTML=curcaps[k];

currimg=currpagefirstimg;

InitializeTimer();



}







var secs;

var timerID = null;

var timerRunning = false;

var delay = 1000;

var currimg = currpagefirstimg;

var lastimg;

var lastbord = 0;

var thumbnum = currpagefirstimg;

var nowsecs=5;

var n;



function InitializeTimer()

{

	secs = nowsecs;

	

	StopTheClock();

	StartTheTimer();

	

}



function StopTheClock()

{

	if(timerRunning)

		clearTimeout(timerID)

	timerRunning = false;

}



function StartTheTimer()

{

if (secs==0)

	{

		StopTheClock()

		if(currimg<currpagelastimg-1)

		{

		currimg = currimg + 1;

		document.getElementById("mainimg").setAttribute("src", mypic[currimg]);

		document.getElementById("photocaptions").innerHTML=curcaps[currimg];

		}else{

		document.getElementById("mainimg").setAttribute("src", mypic[currpagefirstimg]);

		document.getElementById("photocaptions").innerHTML=curcaps[currpagefirstimg];

		currimg = currpagefirstimg;

		}

	nowsecs=5;

	InitializeTimer();

	}

	else

	{

		

		secs = secs - 1;

		timerRunning = true;

		timerID = self.setTimeout("StartTheTimer()", delay);

	}

}



function pushnext()

{

	StopTheClock();

	document.getElementById("playimg").setAttribute("src", "/images/play.gif");

	if(currimg<currpagelastimg-1)

	{

		currimg = currimg + 1;

	}else{

		currimg=currpagefirstimg;

	}

	

	document.getElementById("mainimg").setAttribute("src", mypic[currimg]);

	document.getElementById("photocaptions").innerHTML=curcaps[currimg];

	

}

function pushback()

{

	StopTheClock();

	document.getElementById("playimg").setAttribute("src", "/images/play.gif");

	if(currimg==currpagefirstimg)

	{

		currimg = currpagelastimg-1;

	}else{

		currimg=currimg - 1;

	}

	

	document.getElementById("mainimg").setAttribute("src", mypic[currimg]);

	document.getElementById("photocaptions").innerHTML=curcaps[currimg];

}			

function pushplay()

{

	if (timerRunning)

	{

		StopTheClock();

		document.getElementById("playimg").setAttribute("src", "/images/play.gif");

	}else{

		document.getElementById("playimg").setAttribute("src", "/images/pause.gif");

		nowsecs=0;

		InitializeTimer();

	}

}



function changeimg(thumbid, thumbnum)

{

if (timerRunning)

	{

		StopTheClock();

		document.getElementById("playimg").setAttribute("src", "/images/play.gif");

	}

var thmbsrc= document.getElementById(thumbid).src;

document.getElementById("mainimg").setAttribute("src", thmbsrc);

document.getElementById("photocaptions").innerHTML=curcaps[thumbnum];

document.body.style.cursor='pointer';

currimg=thumbnum;

}



function leaveimg(thumbid)

{

document.getElementById(thumbid).border='0';

document.body.style.cursor='default';

}



function bigpic(img)

{

var newwin = window.open("","","");

newwin.document.write("<html><head></head><body border='0' padding='0' topmargin='0' leftmargin='0' rightmargin='0' bottommargin='0'><img src='"+mybigpic[img]+"'></body></html>");

}


function tempfillnot()

{

for(i=0;i<n;i++)

{

	notcaps[i]="";

}

}





function changepoint(pointval)

{

	if(pointval==1)

	{

		document.body.style.cursor='pointer';

	}

	else

	{

		document.body.style.cursor='default';

	}

}







var thaicaps = new Array();

var vietcaps = new Array();

var camcaps= new Array();

var notcaps = new Array();

var eccaps = new Array();



thaicaps[0] = "View overlooking one of the beautiful beaches in Pattaya.";

thaicaps[1]="LanguageCorps teachers dine at Mike's Mexican Restaurant in downtown Pattaya.";

thaicaps[2]="Picturesque beach on the island of Koh Chang.";

thaicaps[3]="Local children enjoy the warm tropical waters.";

thaicaps[4]="Nearby resorts and hotels.";

thaicaps[5]="Nearby resorts and hotels.";

thaicaps[6]="Nearby resorts and hotels.";

thaicaps[7]="Nearby resorts and hotels.";

thaicaps[8]="Fishing boats return home to Koh Chang after a (hopefully) large catch.";

thaicaps[9]="At the end of the Laos excursion, LanguageCorps teachers enjoy a party with the locals, including home-cooked traditional Laotian food.";

thaicaps[10]="Arrival at Bangkok's new airport can be hectic.";

thaicaps[11]="Training to be a teacher:  All work and no play?  Not exactly!";

thaicaps[12]="Hanging out in the restaurant/bar onboard the night-train.";

thaicaps[13]="The teachers pass the time on the train with some apple juice... right?";

thaicaps[14]="More fun on the night-train.";

thaicaps[15]="The view from the train the next morning.";

thaicaps[16]="Child in traditional hill tribe dress at the Cultural Center.";

thaicaps[17]="Traditional Thai dance, also at the Cultural Center.";

thaicaps[18]="Butterflies the size of your hand are all over - especially at the Butterfly and Orchid farm!";

thaicaps[19]="More of the Butterfly and Orchid farm.";

thaicaps[20]="A temple in Thailand.";



vietcaps[0]="Street vendor in traditional garb in Saigon.";

vietcaps[1]="Typical housing for teachers in Vietnam.";

vietcaps[2]="Typical housing for teachers in Vietnam.";

vietcaps[3]="Typical western style bathroom for teachers in Vietnam.";

vietcaps[4]="Typical housing for teachers in Vietnam.";

vietcaps[5]="View from one of the teacher's rooms in Saigon.";

vietcaps[6]="A typical street full of hotels and restaurants where the teachers stay in the backpacking district of Saigon.";

vietcaps[7]="The kids at the waterpark were excited to have their picture taken.";

vietcaps[8]="This speedboat is one of the means of transportation to the beaches of Vung Tau.";

vietcaps[9]="A traditional Vietnamese wedding party.";

vietcaps[10]="One of the many beaches of Vung Tau.";

vietcaps[11]="Local girls enjoying the beach.  Who needs a swim suit?.";

vietcaps[12]="A girl plays in the sand.";

vietcaps[13]="Girls on a park bench in Saigon enjoying the warm afternoon.";

vietcaps[14]="The street in front of the LanguageCorps school in Saigon.";

vietcaps[15]="Shops and restaurants are just around the corner from the LanguageCorps school.";

vietcaps[16]="One the classrooms at the LanguageCorps school.";

vietcaps[17]="French colonial influence can still be seen in parts of Vietnam.";



camcaps[0]="The National Art Museum in Phnom Penh.";

camcaps[1]="Street kids love having their pictures taken.";

camcaps[2]="A full service gas station outside of Phnom Penh.";

camcaps[3]="One of the beaches in Sihanoukville.";

camcaps[4]="A mobile toy store.";

camcaps[5]="One of the several marketplaces in Phnom Penh.";

camcaps[6]="Pannasastra University, where LanguageCorps TESOL classes are held in partnership with the school.";

camcaps[7]="Street kids love having their pictures taken.";

camcaps[8]="Typical western style bathroom in the LanguageCorps Villa in Cambodia.";

camcaps[9]="A bedroom in the LanguageCorps Villa.";

camcaps[10]="The kitchen of the LanguageCorps Villa in Phnom Penh.";

camcaps[11]="A local kid enjoys nature.";

camcaps[12]="Street kids love having their pictures taken.";

camcaps[13]="Street kids love having their pictures taken.";

camcaps[14]="LanguageCorps teachers in a pool in Siem Reap near Angkor Wat.";

camcaps[15]="A typical hotel room in Siem Reap.";

camcaps[16]="Fish come in all sizes";

camcaps[17]="Street kids love having their pictures taken.";

camcaps[18]="A busy boulevard along the river in Phnom Penh.";

camcaps[19]="Teachers and LanguageCorps staff at the Titanic Restaurant, riverfront in Phnom Penh.";

camcaps[20]="A few minutes of Cambodian culture at the Titanic Restaurant.";

camcaps[21]="One of hundreds of pickup trucks heading for a Buddhist celebration outside the city.";

camcaps[22]="LanguageCorps teachers exploring Phnom Penh.";

camcaps[23]="Street kids love having their pictures taken.";

camcaps[24]="LanguageCorps teachers visit the Royal Palace on their tour of Phnom Penh.";

camcaps[25]="The kids at one of the LanguageCorps partnered orphanges.";

camcaps[26]="A LanguageCorps teacher gets to know one of the orphans.";

camcaps[27]="More of the orphans.";

camcaps[28]="More of the orphans.";

camcaps[29]="More of the orphans.";

camcaps[30]="More of the orphans.";

camcaps[31]="The boys bedroom at the orphanage.";

camcaps[32]="Schoolgirls at another orphanage across town.";

camcaps[33]="The tradgedy of the Pol Pot years is made abundantly clear with exhibits like this one at the Stuka at the Killing Fields outside of Phnom Penh.";

camcaps[34]="A local wedding party happens down the street from the LanguageCorps Villa.";

camcaps[35]="Another busy boulevard near the river in Phnom Penh.";

camcaps[36]="Some of the many magnificent temples and ruins of Angkor Wat.";

camcaps[37]="Some of the many magnificent temples and ruins of Angkor Wat.";

camcaps[38]="Some of the many magnificent temples and ruins of Angkor Wat.";

camcaps[39]="The floating village of boat people outside Siem Reap.";

camcaps[40]="The floating village of boat people outside Siem Reap.";

camcaps[41]="The floating village of boat people outside Siem Reap.";

camcaps[42]="The floating village of boat people outside Siem Reap.";

camcaps[43]="The floating village of boat people outside Siem Reap.";

camcaps[44]="The floating village of boat people outside Siem Reap.";

camcaps[45]="&quot;For just a dollar, you too can take my picture&quot;";

camcaps[46]="The floating school.";

camcaps[47]="Some boys from the orphanage in Phnom Penh";

camcaps[48]="Some boys from the orphanage in Phnom Penh";

camcaps[49]="Some boys from the orphanage in Phnom Penh";

camcaps[50]="Some boys from the orphanage in Phnom Penh";

camcaps[51]="Some boys from the orphanage in Phnom Penh";

camcaps[52]="Some boys from the orphanage in Phnom Penh";


eccaps[0]="Snow Covered Pichincha";
eccaps[1]="Ingapirca - Temple of the Sun";
eccaps[2]="In front of the Temple of the Sun";
eccaps[3]="On the way to Santa Cruz";
eccaps[4]="Overlooking crater Sierra Negra on Isla Isabela";
eccaps[5]="On top of El Tren going to Cotopaxi";
eccaps[6]="Overlooking Quito";
eccaps[7]="Rafting in Tena";
eccaps[8]="Waterfall in Tena";
eccaps[9]="Krystle and Mono Bella";
eccaps[10]="Tanning on the beach";
eccaps[11]="Overlooking Quito while taking a cable car up Teleferico";
eccaps[12]="Krystortoise";
eccaps[13]="Chatting with the tortoises in the Galapagos";







