 function loadLanguage (shortLanguage){
	//split the URL into an array
	var arrOldPath = location.pathname.split('/');
	var arrAvailableLanguages = new Array('english', 'thai', 'dutch', 'swedish', 'german', 'chinese');
	var blLanguageFound = false;
	
	//see if the language we're passed is in the list of available languages
	for(thing in arrAvailableLanguages){
		if(arrOldPath[1] == arrAvailableLanguages[thing]){
			//if it's found, rewrite the array and mark that it's found
			arrOldPath[1] = shortLanguage;
			blLanguageFound = true;
			break;
		}
	}
	//if not found, no language currently specified, tack the language to the front of the URL
	if(!blLanguageFound){
		arrOldPath[0] = '/' + shortLanguage;
	}
	//join up URL and send the browser on its way:
	location.pathname = arrOldPath.join('/');
 }
 
function setLanguagePicker(shortLanguage){ 
	if(shortLanguage != ''){
		setSelectListToValue(shortLanguage, 'languagePicker');
	}else{
		setSelectListToValue('english', 'languagePicker');
	}
}
 
function setSelectListToValue(value, selectId){ //alert(value +" , "+ selectId);
	var i, si, v, args=setSelectListToValue.arguments;
	if ((obj=document.getElementById(args[1])) != null){
		v = args[0];
		for(i=0; i<obj.length; i++){
			if(obj.options[i].value == v){
				si = i;
			}
		}		
		obj.selectedIndex = si;
		//alert(obj.selectedIndex);
	}
}
