jQuery(function(){
	if (!document.getElementById) return
	jQuery('.subnav').css('height', '0px');
	
	jQuery('li.pulldown').hover(function(){
		var openBlock = jQuery(this).find('.subnav');
		var h = 0;
		jQuery(this).find('.subnav li').each(function(count){
			h += 32;
		});
		openBlock.animate({ height: h+'px' },'fast', 0, "swing", function(){ openBlock.css('height', 'auto'); });
	}, function(){
		var closeBlock = jQuery(this).find('.subnav');
		this.timeID = setTimeout(function(){
			closeBlock.animate({ height: '0px' },'fast');
		}, 300);
		jQuery(this).mouseover(function(){
			clearTimeout(this.timeID);
		});
	});
});