$('document').ready( function(){
	//Find out which nested list item has the current class then add the current class to its parent if it has one
	$('li ul li.current').parent('ul').parent('li').addClass('current').parent('ul').parent('li').addClass('current');

	//Populate #submenu with current children, if they exist. And build a UL around it.
	if( $('#header .sitemenu ul li.current ul li.current').length  > 0 ) {
		var subMenuHTML = $('#header .sitemenu ul li.current ul').html();
		$('#submenu').html( '<ul class="secondary">' + subMenuHTML + '</ul>' );
	}
	
	// initialise lightbox function.
	doLightbox();
});
