$(document).ready(
	function ()
	{
	    // ie7 sometimes puts the tab in the wrong place if #l-sitemap
	    // is initially visible
	    $('#l-sitemap').show();
		// set up sitemap
		//$('#l-sitemap div.with-tab').prepend('<div class="shade"></div>');
		//$('#l-sitemap div.shade').css({opacity:0.0}).show();
		$('#l-sitemap h3.tab span').show().toggle(
			function ()
			{
				// on click of tab, show sitemap proper
				$('#l-sitemap div.with-tab').animate({
					'height' : $('#l-sitemap div.sitemap-proper').height()+14
				});
				//$('#l-sitemap div.shade').fadeTo('normal', 0.2);
				$(this).addClass('open');
			},
			function ()
			{
				// hide on second click
				//$('#l-sitemap div.shade').fadeTo('normal', 0.0);
				$('#l-sitemap div.with-tab').animate({
					'height' : 16
				});
				$(this).removeClass('open');
			}
		);
		// set up main nav dropdowns
		$('#l-h div.nav ul.sub').each(
			function ()
			{
				// add a little submenu indicator to the parent link
				// (but only if it's not one of the roots)
				if (!$(this).parents('ul').eq(0).hasClass('main'))
				{
					$(this).siblings('a').addClass('with-sub').append('<span>&gt;</span>');
				}
			}
		);
		$('#l-h div.nav li').hover(
			function ()
			{
				// show submenu, if any
				$(this).children('a').addClass('open');
				$(this).children('ul').show();
			},
			function ()
			{
				// hide submenu, if any
				$(this).children('ul').hide();
				$(this).children('a').removeClass('open');
			}
		);
	}
);