$(function() {
	var current;
	$('ul.sub_products li ul').each(function() {
		if (this.className !== 'init_hide') {
			current = $(this);
		}
	});

	$('ul.sub_products > li').click(function(ev) {
		if ($(this).find('ul').size() > 0 && current) {
			if (ev.target.parentNode.parentNode.parentNode.tagName.toLowerCase() === 'li') { return ;}
			if (current.parent().get(0) === this) return;
			ev.preventDefault();
			current.slideUp();
			current = $(this).find('ul');
			current.slideDown();
		}
	});
});

