$(document).ready(function(){
				$(".page .box .left .main-menu li ul").css({"display":"none"});

				$(".page .box .left .main-menu li a").each(function(){
				var hreflink = $(this).attr("href");

				if (hreflink.toLowerCase()==location.href.toLowerCase() || location.href.toLowerCase().search(hreflink.toLowerCase())>=0) {
					$("ul",$(this).parents("li")).css({"display":"block"});
					$(this).attr({"class":"active"});
				}
				});

				$(".page .box .left .main-menu li ul li a").each(function(){
				var hreflink = $(this).attr("href");

				if (hreflink.toLowerCase()==location.href.toLowerCase() || location.href.toLowerCase().search(hreflink.toLowerCase())>=0) {
					$("ul",$(this).parents("li")).css({"display":"block"});
					$(this).attr({"style":"font-weight:bold;"});
				}
				});  

				$(".page .box .left .main-menu li").click(function(){
				if ($("ul li",this).length){       
				 	$(".page .box .left .main-menu li ul").hide(0);   
					if ($("ul",this).css("display") == "none"){
						$("ul", this).show(0);
					}
					else{
						$("ul",this).hide(0);
					}
				 }
				else{
					location.href = $("a",this).attr("href");
				 }
				return false;
				});

				
				//Кнопочки в правой колонке
				$('.bcontent').hide();
				$('.bhead-silver').css({'cursor':'pointer'});
				$('.bhead-silver').click(function(){
					var thisId = $(this).attr('id');
					if($('#show-'+thisId).css('display') == 'none')
					{
						$('#show-'+thisId).slideDown();
						$(this).removeClass('bhead-silver');
						$(this).addClass('bhead-pink');
					}
					else{
					
						$('#show-'+thisId).slideUp();						
						$(this).addClass('bhead-silver');
						$(this).removeClass('bhead-pink');
					}
				});

				/*$('.bhead-pink').click(function(){
					var thisId = $(this).attr('id');
					alert(1);
					
					if($('#show-'+thisId).css('display') != 'none')
					{
						$('#show-'+thisId).slideUp();						
						$(this).addClass('bhead-silver');
						$(this).removeClass('bhead-pink');
					}
				});*/
				
			});
