$(document).ready(function() {
						   
	$(".btnLink").next("div").hide();
	$(".btnLink").click(function() {
		$(this).next("div").slideToggle("slow");
	});

	commentsText = "Ваш комментарий";
	
	$("#REVIEW_TEXT", ".comment_forma")
		.val(commentsText)
		.focus(function(){
			if ($(this).val()==commentsText)
				$(this).val("");
		})
		.blur(function(){
			if ($(this).val()=="")
				$(this).val(commentsText);
		})

	$("#commentsToggable").live("click", function(){
		$(".toggablediv").toggle();
	})

	$(".top_menu li").hover(
						 function() {$("table", this).css({visibility: "visible"})},
						 function() {$("table", this).css({visibility: "hidden"})}
	);

	$.ifixpng('/bitrix/templates/index/i/px.gif');
	$(".png_png_td2, .previous, .prev, .next").ifixpng('/bitrix/templates/index/i/px.gif');

	$(".blockhover")
		.click(function(){
			location.href = $("a:first", this).attr("href");
		})
		.hover(
			function(){ $(this).addClass("hover") },
			function(){ $(this).removeClass("hover") }
		);

	$(".fashion_img li")
		.click(function(){
			location.href = $("a:first", this).attr("href");
		})
		
// MenuTop ======================================================================================================
var flag = 1;

if ($("#active").length) {
	strToActive = strToShow = strToRemove = $("#active").attr('class');
	//alert(strToActive);
} else {
	strToRemove = "stars";
	strToShow = "stars";
	strToActive = "stars";
}

$(".menu_element_top_img")
	.oneTime("1s", 'refresh_pics', function() {
	$(this).css({visibility: "visible", display:"none"});
	$("#"+strToShow).css({display: "block"});
});

$("#"+strToShow).css({visibility: "visible"});

	
	$(".top_menu ul li")
		.mouseout(
			function() {
				$('#'.strToActive).oneTime("2s", 't1', function() {
			  		flag = 0;
					if(strToRemove != strToActive) {
						$("#"+strToRemove).css({"z-index": "1"});
						$("#"+strToActive).css({"z-index": "10"}).animate({opacity: "show"}, 2000, function() {
							$("#"+strToRemove).css({display: "none"});
							strToRemove = strToActive;
							flag = 1;
							//alert(strToActive + ", " +  strToShow + ", " + strToRemove);
						});	
					} else {
						flag = 1;
					}
				});
			}
		);
	
	$(".top_menu ul li")
		.mousemove(
			function() {
				$('#'.strToActive).stopTime('t1');
				if (flag == 1) {
					flag = 0;
					strToShow = $(this).attr('class');
					if(strToRemove != strToShow) {
						$("#"+strToRemove).css({"z-index": "1"});
						$("#"+strToShow).css({"z-index": "10"}).animate({opacity: "show"}, "slow", function() {
							$("#"+strToRemove).css({display: "none"});
							strToRemove = strToShow;
							flag = 1;
						});
					} else {
						flag = 1;
					}
				}
			}
		);
		
// MenuTop ======================================================================================================
	
	
	// popup banner on index
	$('.popup-banner a').click(function(){
		$('.popup-banner').hide();
		$('.banner-shadow').hide();
	})

})