//$(window).load(function(){  
$(document).ready(function(){
	$('.level1').hide();
	$('.level2').hide();
	$('.level3').hide();
	$('.level4').hide();
	
	if($('.active-cat').size()){
	
		var level = $('.active-cat').attr('class').substr(5,1);
		$('.active-cat').show();
		var parId = $('.active-cat').parent().parent().attr('id');
		if(level>0){
			$('#'+parId+' .level'+level).show();
		}
		if(level>1){
			var parId2 = $('#'+parId).parent().parent().attr('id');
			var lvl2 = level;
			--lvl2;
			$('#'+parId2+' .level'+lvl2).show();
		}
		if(level>2){
			var parId3 = $('#'+parId2).parent().parent().attr('id');
			var lvl3 = lvl2;
			--lvl3;
			$('#'+parId3+' .level'+lvl3).show();
		}
		if(level>3){
			var parId4 = $('#'+parId3).parent().parent().attr('id');
			var lvl4 = lvl3;
			--lvl4;
			$('#'+parId4+' .level'+lvl4).show();
		}
		++level;
		$('#'+$('.active-cat').attr('id')+' ul .level'+level).show();
		
		for(var i=(++level);i<5;i++){
			$('.level'+i).hide();
		}
	}
	if($('#selected-prod').size()){
		$('#menu-producer .menu-category').scrollTo('#selected-prod');
	}
	
	$('.product-similar .auction-small-name a, .auction-ad .auction-small-name a').hover(function(){
		$(this).parent().parent().parent().css('z-index','5');
		$(this).parent().parent().animate({
			height: "100px"
		});
	},function(){
		$(this).parent().parent().animate({
			height: "39px"
		},50);
		$(this).parent().parent().parent().css('z-index','1');
	});
});

