$(function() {

	$('div#menu li:has(ul) > a').each(function() {
		$(this).append('<span class="opener">+</span>');
	});
	
	$('div#menu .is_context').each(function() {
		$(this).parents('ul').show();
		$(this).next('ul').show();
		$(this).parents('li').each(function() {
			$(this).find('span.opener').eq(0).each(function(){
				$(this).addClass('open').html('-');
			});
		});		
	});
	
	$('div#menu span.opener').click(function() {
		if($(this).hasClass('open')) {
			$(this).html('+');
			$(this).parents('li').eq(0).find('ul').hide();
			$(this).removeClass('open');
		} else {
			$(this).html('-');
			$(this).parents('li').eq(0).find('ul').eq(0).show();
			$(this).addClass('open');
		}
		return false;
	});
	
	$('div#menu').each(function() {
		$(this).css('min-height',$(this).parent().height()-2);
	});
	
});
