$(document).ready(
	function(){
/*
		$("#mi1").click(
			function(){
				if ($("#anketa").css("display") == "block"){
					$("#anketa").css("display", "none");
					return false;
				}
				$("#anketa").css("display", "block");
				return false;
			}
		);
*/

		var marr = new Array("mi1cont", "mi2cont", "mi3cont", "mi4cont", "mi5cont");
		//var marr = new Array("mi1^^mi1cont", "mi2^^mi2cont", "mi3^^mi3cont", "mi4^^mi4cont", "mi5^^mi5cont");
		//var larr = new Array("О центре", "О сотрудниках центра", "Техническое оснащение", "Услуги", "Контакты");

		for (i in marr){
			/*var spl = marr[i].split("^^");
			if (i != 0) $("#" + spl[1]).css("display", "none");*/
			if (i != 0) $("#" + marr[i]).css("display", "none");
		}

		$(".menu a").click(
			function(){
				$(".menu a").each(function(){
					// menu2 actions
					var name = ".menu2 #" + $(this).attr("id") + "c";
					// menu2 actions

					if ($(this).hasClass("msel")){
						$(this).removeClass("msel");

						// menu2 actions
						$(name).removeClass("msel");
						// menu2 actions
					}
					if ($("> strong", this).size() > 0){
						$("> strong", this).replaceWith($("> strong", this).text());
						$("#" + $(this).attr("id") + "cont").css("display", "none");

						// menu2 actions
						$(name + " > strong").replaceWith($(name + " > strong").text());
						// menu2 actions
					}
				});

				if (!$(this).hasClass("msel")){
					$(this).addClass("msel");
					$(this).wrapInner("<strong></strong>");
					$(this).css("outline", "none");
					$("#" + $(this).attr("id") + "cont").css("display", "block");

					// menu2 actions
					var name = ".menu2 #" + $(this).attr("id") + "c";
					$(name).addClass("msel");
					$(name).wrapInner("<strong></strong>");
					// menu2 actions
				}

				return false;
			}
		);
		$(".menu2 a").click(
			function(){
				$(".menu2 a").each(function(){
					// menu actions
					var len = $(this).attr("id").length - 1;
					var name = ".menu #" + $(this).attr("id").substring(0, len);
					// menu actions

					if ($(this).hasClass("msel")){
						$(this).removeClass("msel");

						// menu actions
						if ($(name).hasClass("msel")) $(name).removeClass("msel");
						// menu actions
					}
					if ($("> strong", this).size() > 0){
						$("> strong", this).replaceWith($("> strong", this).text());
						$("#" + $(this).attr("id") + "ont").css("display", "none");

						// menu actions
						if ($(name).size() > 0) $(name + " > strong").replaceWith($(name + " > strong").text());
						// menu actions
					}
				});

				if (!$(this).hasClass("msel")){
					$(this).addClass("msel");
					$(this).wrapInner("<strong></strong>");
					$(this).css("outline", "none");
					$("#" + $(this).attr("id") + "ont").css("display", "block");

					// menu actions
					var len = $(this).attr("id").length - 1;
					var name = ".menu #" + $(this).attr("id").substring(0, len);
					$(name).addClass("msel");
					$(name).wrapInner("<strong></strong>");
					// menu actions
				}

				return false;
			}
		);
});

/*
function ankshow(){
	var elem = document.getElementById("anketa");

	if (elem.style.display == "block"){
		elem.style.display = "none";
		return false;
	}
	elem.style.display = "block";
	return false;
}
*/
