function checkCSS() {
	main_menu_load();
	// swap CSS classes
	var langAPath = location.href;
	var langAFolder = "de";
	var langAWords = langAPath.split("/");
	
	if (langAWords[3] !="de") {
		
		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 change_lang(selLang) 
{	


	

	
	var docPath = location.href;
	var strFolder = "de";
	// var selLang = document.language.language.value;
	var aWords = docPath.split("/");

	if (selLang!="de") {

		var newPath = "http://" + aWords[2];

		if (aWords[3] !="de") {
			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[4] =="de") {
//			newPath = newPath + "/" + aWords[3];
//		}
		if (aWords[3] != "de") {
			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;
}
