$(function(){

$("#product_mnu ul[id]").css('display','none');


/**/

$('#product_mnu a.hot').parents('ul[id]:hidden').each(function (i) {
  $(this).css('display','block');
	//$(this).fadeIn('slow');
  var li=$(this).attr('id').replace(/pmnu_/,'');
  $("a[rel='"+li+"']").parent('li').removeClass("pl");
  $("a[rel='"+li+"']").parent('li').addClass("mn");
});

var hotrel=$('#product_mnu a.hot').attr('rel');
if (hotrel){
  $('#pmnu_'+hotrel).css('display','block');
	//$('#pmnu_'+hotrel).fadeIn('slow');
  var mli=$('#product_mnu a.hot').parent('li');
	$(mli).removeClass("pl");
	$(mli).addClass("mn");
}
//alert($('#product_mnu a.hot').attr('rel'));


$("#product_mnu li.mn span, #product_mnu li.pl span").click(function(){
//
  var mli=$(this).parent('li');
	
	//var mul=$(mli).next('ul'); // ненадужно, глючит, если перед UL стоит например пробел
	//var mul=$('#pmnu_'+this.rel); // требует указать в ссылке rel=pmnu_ и ID списка
	var mul=$('#pmnu_'+$(mli).find("a").attr('rel'));


	if (mli.hasClass('mn')){
	  //mul.css('display','none');
		mul.fadeOut('fast');
	  $(mli).removeClass("mn");
	  $(mli).addClass("pl");
    return false;
	}
	
	if (mli.hasClass('pl')){
	  //mul.css('display','block');
		mul.fadeIn('slow');
	  $(mli).removeClass("pl");
	  $(mli).addClass("mn");
    return false;
	}
/**/

});






var hotismnu= $('#product_mnu a.hot').parent('li.pl');
if (hotismnu.length==1){
  $('#product_mnu a.hot').click();
}

//$('#product_mnu').css('display','block');

}); 
