$(function(){
	activateAccordion();
		/*HANDLE THE EXPANDABLE LINKS*/
	$('ul.expandable a.headline').not('ul.sitemap li.nochildren .headline').click(function(){
		if ($(this).parent().hasClass('.open')){
			$(this).siblings().slideUp();
			$(this).parent().removeClass('open').addClass('closed');
			return false;
		}
		else
		{
			$('ul.expandable li.expanding').children().not('.headline').slideUp();
			$('ul.expandable li.expanding').removeClass('open').addClass('closed');
			$(this).parent().removeClass('closed').addClass('open');
			$(this).siblings().slideDown();
			return false;
		}
	});
});

function activateAccordion(){
	if($('ul.expandable').hasClass('.sitemap')){
		$('ul.expandable li.expanding').addClass('closed');	
		$('ul.expandable li.closed').children().not('.headline').hide();
	}
	else
	{
	$('ul.expandable li.expanding').not('ul.expandable li li').addClass('closed');
	$('ul.expandable li.expanding:first-child').removeClass('closed').addClass('open');
	$('ul.expandable li.closed').children().not('.headline').hide();
	}
}