function initMenu() {
	$('.list_city ul').hide();
	$('.list_city ul.active').show();
	$('.list_city li a').click(
		function() {
			var checkElement = $(this).next();

			// населенный пункт
			if ($(this).hasClass("sity_el"))
			{
				// alert('переход на страницу населенного пункта');
				return true;
			}

			// район
			if ($(this).hasClass("county_el"))
			{
				return true;
				/*
				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
					$('.list_city ul li ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
				//	return false;
				}

				$.ajax({
					url: '/'+$('#the_body').attr('lang')+'/county/'+$(this).attr('el')+'/',
					cache: false,
					type: "POST",
					data: 'view=ajax',
					success: function(html){
						// $("#center_block");
						$('#center_block').slideUp('normal');
						var center_block_text = html;
						setTimeout(function() {
							$('#center_block').html(center_block_text).slideDown('normal');
						}, 500);
					}
				});
				*/
			}

			if ($(this).hasClass("county_el_new"))
			{
				//return true;

				$.ajax({
					url: '/'+$('#the_body').attr('lang')+'/county/'+$(this).attr('el')+'/',
					cache: false,
					type: "POST",
					data: 'view=ajax',
					success: function(html){
						// $("#center_block");
						$('#center_block').slideUp('normal');
						var center_block_text = html;
						setTimeout(function() {
							$('#center_block').html(center_block_text).slideDown('normal');
						}, 500);
					}
				});
				
			}
			// область
			if ($(this).hasClass("region_el"))
			{
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
					$('.list_city ul').slideUp('normal');
					return false;
				}


				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
					$('.list_city ul:visible').slideUp('normal');
					checkElement.slideDown('normal');
				//	return false;
				}


				$.ajax({
					url: '/'+$('#the_body').attr('lang')+'/region/'+$(this).attr('el')+'/',
					cache: false,
					type: "POST",
					data: 'view=ajax',
					success: function(html){
						// $("#center_block");
						$('#center_block').slideUp('normal');
						var center_block_text = html;
						setTimeout(function() {
							$('#center_block').html(center_block_text).slideDown('normal');
						}, 500);
					}
				});
			}

			return false;

		}
	);

	$('.list_region ul').hide();
	$('.list_region ul.active').show();
	$('.list_region li a').click(
		function() {
			var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('.list_region ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
}

$(document).ready(function(){
	initMenu();
	$("ul.tabs").idTabs();
})
