function menu_selected(namex){
	// проверяем аргументы
	if(arguments.length > 1){
		// self
		function gID(idname){return document.getElementById(idname);}
	}else{
		// parent
		function gID(idname){return parent.document.getElementById(idname);}
	}
	
	// массив для hover-менюшек
	var nx = new Array();
	nx['tpr'] = 0;
	nx['tpp'] = 1;
	nx['tof'] = 2;
	nx['tls'] = 3;
	nx['lcs'] = 4;
	nx['lss'] = 5;
	nx['lus'] = 6;
	nx['lrs'] = 7;
	nx['lis'] = 8;
	nx['lpa'] = 9;
	nx['lpu'] = 10;
	nx['lrc'] = 11;
	nx['lcu'] = 12;
	nx['nrm'] = 13;
	nx['not'] = 14;
	nx['toc'] = 15;
	nx['tos'] = 16;
	nx['tou'] = 17;
	nx['tor'] = 18;
	nx['too'] = 19;
	nx['toh'] = 20;
	nx['pcy'] = 21;
	nx['psw'] = 22;
	nx['puk'] = 23;
	nx['pru'] = 24;
	nx['pro'] = 25;
	nx['pch'] = 26;
	
	// массив для hover-менюшек
	var srcx = new Array("top_profile", "top_people", "top_offices", "top_legalstatements", "left_menu_cyprus", "left_menu_switzerland", "left_menu_uk", "left_menu_russia", "left_menu_international", "left_menu_partners", "left_menu_publications", "left_menu_clients", "left_menu_contactus", "left_readmore", "left_other", "top_offices", "top_offices", "top_offices", "top_offices", "top_offices", "top_offices", "top_people", "top_people", "top_people", "top_people", "top_people", "top_people");
	
	// массив картинок для каждой страницы
	var imgx = new Array("right_profile", "right_people", "offices_cyprus", "space", "right_cyprus", "right_switzerland", "right_uk", "right_russia", "right_international", "right_partners", "right_publications", "right_clients", "right_contactus", "space", "right_other", "right_cyprus_office", "right_switzerland_office", "right_uk_office", "right_russia_office", "right_romain_office", "right_china_office", "right_cyprus_team", "right_switzerland_team", "right_uk_team", "right_russia_team", "right_romain_team", "right_china_team");
	
	// массив ширины странички
	var wix = new Array(322, 383, 366, 502, 322, 322, 322, 322, 322, 322, 373, 375, 365, 502, 365, 375, 375, 375, 375, 375, 375, 383, 383, 375, 383, 375, 375);
	
	// сбрасываем другие картинки
	for(var x in nx){
			if(x == "toc"){break;}
			gID(x).src = "images/" + srcx[nx[x]] + ".gif";
			gID(x).lang = "en";
	}
	
	// обычная офисы
	gID("tof").src = "images/" + srcx[2] + ".gif";
	
	// изменяем картинку
	if(nx[namex] < 15){
		gID(namex).src = "images/" + srcx[nx[namex]] + "_selected.gif";
		gID(namex).lang = "ru";
	}
	
	// изменяем картинку для офисов
	if(nx[namex] > 14 && nx[namex] < 21){
		gID("tof").src = "images/" + srcx[2] + "_selected.gif";
		gID("tof").lang = "ru";
	}
	
	// если выбрано что-то из AoF
	if(nx[namex] > 3 && nx[namex] < 9){
		gID("lma").src = "images/left_menu_areas_hover.gif";
		gID("lma").lang = "ru";
	}else{
		gID("lma").lang = "en";
	}
	
	// получаем элементы таблицы
	var ctd = gID("ctd");
	var rtd = gID("rtd");
	
	// меняем ширину 
	ctd.width = wix[nx[namex]];
	
	// убераем правый фрейм
	gID("rframe").style.display = "none";
	
	// изменяем мейнфрейм
	var mf = gID("mainframe");
	if(namex == "tls" || namex == "lpu" || namex == "tof" || namex == "tpp" || namex == "lrc" || namex == "pcy" || namex == "psw" || namex == "pro"){
		mf.height = 450;
	}else{
		mf.height = 350;
	}
	
	// изменяем другие элементы
	if(namex == "tls" || namex == "nrm"){
		// изменяем тдэшки
		ctd.style.conspan = "2";
		rtd.style.display = "none";
	}else{
		// изменяем стандартные вещи
		var ele2 = gID("rimg");
		ele2.src = "images/" + imgx[nx[namex]] + ".gif";
		
		// карта изображения
		if(namex == "not" || namex == "lpu"){
			ele2.useMap = "#map" + namex;
		}else{
			ele2.useMap = null;
		}
		
		// изменяем тдэшки
		ctd.style.conspan = "1";
		rtd.style.display = "block";
	}
}
