$(document).ready ( function() {

	$('#submenu li ul').each( function() {
		var id = $(this).attr('id');

		$(this).hide();
	});

	$('#submenu li.active ul').show();
	$('#submenu li.active ul li ul').hide();
	$('#submenu li.active ul li.active ul').show();

	$('#submenu a.sub').click( function() {

		var parent = $(this).parent();

		parent.toggleClass('active');
		var id = parent.attr('id');

		$('#submenu li ul#m_'+id).toggle();
		return false;
	});

	var height = $(document).height();

	$('#shadow').attr('style', 'height: '+height+'px;');
});