/* all initialization */
$(document).ready(function() {

	$('.topmenu li').hover(function(){
		$(this).find('ul').show();
	}, function(){
		$(this).find('ul').hide();
	});	

	$('.mc a').hover(function(){
		$(this).stop().find('i').animate({opacity: 1}, 500);
	}, function(){
		$(this).stop().find('i').animate({opacity: 0}, 500);
	});	
	/* отменено заказчиком. Разворачивание пункта меню.
	$('.tree h3').click(function() {
		if ($(this).next('ul').length > 0) {
			$(this).next('ul').toggle();
			//return false;
		}
	}).next('ul').hide();*/
	
	//open active menu category
	$(".tree li a").each(function() {
		if ($(this).attr("href") == $(location).attr('pathname')) {
			//go up and find parent menu level
			//$(this).parent().parent().prev("h3").click();
                        $(this).parent().parent().show();
		}
	});
        //show category content in category root
        $(".tree h3 a").each(function() {
		if ($(this).attr("href") == $(location).attr('pathname')) {
			//go up and find parent menu level
			$(this).parent().next("ul").show();
		}
	});
	
	$('#readmore').click(function() {
		$('div.hide').show();
		$(this).hide();
		return false;
	});
});
