function checkCSS() {
	main_menu_load();
	// swap CSS classes
	var langAPath = location.href;
	var langAFolder = "en";
	var langAWords = langAPath.split("/");
	
	if (langAWords[3] !="en") {
		
		document.getElementById("lang1").className = 'lang_selected';
		document.getElementById("lang2").className = 'lang_unselected';
		}
	else {
		
		document.getElementById("lang2").className = 'lang_selected';
		document.getElementById("lang1").className = 'lang_unselected';
		}
	
	}



window.onload = checkCSS;



function changeLang(lang) 
{
	var docPath = location.href;
	var strFolder = "en";
	var selLang = lang;
	var aWords = docPath.split("/");

	if (selLang!="en") {

		var newPath = "http://" + aWords[2];

		if (aWords[3] !="en") {
			newPath = newPath + "/" + aWords[3];
		}
		if (aWords[4] != null) {
			newPath = newPath + "/" + aWords[4];
		}
		if (aWords[5] != null) {
			newPath = newPath + "/" + aWords[5];
		}
		if (aWords[6] != null) {
			newPath = newPath + "/" + aWords[6];
		}
		if (aWords[7] != null) {
			newPath = newPath + "/" + aWords[7];
		}
		if (aWords[8] != null) {
			newPath = newPath + "/" + aWords[8];
		}
		if (aWords[9] != null) {
			newPath = newPath + "/" + aWords[9];
		}
		if (aWords[10] != null) {
			newPath = newPath + "/" + aWords[10];
		}
		if (aWords[10] != null) {
			newPath = newPath + "/" + aWords[10];
		}
	} else {

		var newPath = "http://" + aWords[2] + "/" + strFolder;

		if (aWords[3] != "en") {
			newPath = newPath + "/" + aWords[3];
		}
		if (aWords[4] != null) {
			newPath = newPath + "/" + aWords[4];
		}
		if (aWords[5] != null) {
			newPath = newPath + "/" + aWords[5];
		}
		if (aWords[6] != null) {
			newPath = newPath + "/" + aWords[6];
		}
		if (aWords[7] != null) {
			newPath = newPath + "/" + aWords[7];
		}
		if (aWords[8] != null) {
			newPath = newPath + "/" + aWords[8];
		}
		if (aWords[9] != null) {
			newPath = newPath + "/" + aWords[9];
		}
		if (aWords[10] != null) {
			newPath = newPath + "/" + aWords[10];
		}
	}

	//alert(newPath);
	location.href = newPath;
}

