/*========== JAVASCRIPT TO GET THE CONTENT IN SPECIFIC LANGUAGE (P.TUKTA) =========
var loc=String(this.location);
loc=loc.split("/");

// Format of path: loc_path1/loc_path2/xxx.html
loc_path1=loc[loc.length-3];
loc_path2=loc[loc.length-2];

if(loc_path2 == 'eng'){
  path = "";  
}
else if(loc_path2 == 'th'){
  path = "";
}
else if (loc_path2 == 'connections' || 'compliance' || 'forms' || 'track_learning'){
  path = "../";
}

if((loc_path2 == 'pr2010') || (loc_path2 == 'pr2009') || (loc_path2 == 'pr2008') || (loc_path2 == 'pr2007') || (loc_path2 == 'pr2006') || (loc_path2 == 'pr2005') || (loc_path2 == 'pr2004') || (loc_path2 == 'pr2003') || (loc_path2 == 'pr2002')) {
  path = "../../";
}*/

/*========== JAVASCRIPT TO GET THE CONTENT IN SPECIFIC LANGUAGE (KEN) =========*/
var path = "";
var locAP = 0; //array position
var loc = String(this.location); //get the address of the page
var loc = loc.split("/"); //remove the "/" from the address

	//loop to find the position of folders, "eng" and "th"
	for(i=loc.length; i>=0; i--){
		//find the position of folders and put the value back to "locAP"
		if(loc[i] == 'eng' || loc[i] == 'th'){
			locAP = i;
			break;
		}
	}
	//create a "../" upon the length after minus AMOUNT with POSITION
	//number "2" is the differential of AMOUNT vs. POSITION >> can't be other numbers
	for(i=2; i<loc.length-locAP; i++){
		path += "../";
	}

//Begin resolve a folder's language
loc_num=loc.length;
for(i=0; i<=loc_num;i++)
{
	if(loc[i] == "eng")
	{
		lang = "eng";
	}
	else if (loc[i] == "th")
	{
		lang = "th";
	}
	
}
//End resolve a folder's language

/*========== JAVASCRIPT TO GET BACK TO PREVIOUS PAGE =========*/
function prevPage(year){
	if(year == 2010){
		window.location = "../../co/co_news-latest.html";
	}
	else if(year == 2009){
		window.location = "../../co/co_news_pressreleases2009.html";
	}
	else if (year == 2008){
		window.location = "../../co/co_news_pressreleases2008.html";
	}
	else if (year == 2007){
		window.location = "../../co/co_news_pressreleases2007.html";
	}
	else if (year == 2006){
		window.location = "../../co/co_news_pressreleases2006.html";
	}
	else if (year == 2005){
		window.location = "../../co/co_news_pressreleases2005.html";
	}
	else if (year == 2004){
		window.location = "../../co/co_news_pressreleases2004.html";
	}
	else if (year == 2003){
		window.location = "../../co/co_news_pressreleases2003.html";
	}
	else if (year == 2002){
		window.location = "../../co/co_news_pressreleases2002.html";
	}
}