$(document).ready(function() {
	
	var url = window.location.href.split('#');
	if(url[1] == 'management') {
		var section = $('div.accordion ul li:first');
		$(section).find('ul:first').slideDown();
		$(section).find('a:first').addClass('over');
	} else if(url[1] == 'transformation') {
		var section = $('div.accordion ul').children().get(1);
		$(section).find('ul:first').slideDown();
		$(section).find('a:first').addClass('over');
	} else if(url[1] == 'governance') {
		var section = $('div.accordion ul').children().get(2);
		$(section).find('ul:first').slideDown();
		$(section).find('a:first').addClass('over');
	}
	
	$('div.accordion ul li ul').each(function() {
		if($(this).find('li').hasClass('active') || $(this).parent().find('a:first').hasClass('active')) {
			$(this).slideDown();
			$(this).parent().find('a:first').addClass('over');
		}
	});
	
	$('div.accordion ul li a').click(function() {
		var target = $(this).parent().find('ul:first');
		if($(target).css('display') == 'none') {
			$(target).slideDown();
			$(this).addClass('over');
		} else {
			$(target).slideUp();
			$(this).removeClass('over');
		}
		if($(this).hasClass('level-1')) {
			return true;
		} else {
			return false;
		}
	});
	
	$('a.toggle').click(function() {
		var target = $(this).attr('href');
		
		if($(target).css('display') == 'none') {
			$(target).slideDown();
			$(this).find('span.show').hide();
			$(this).find('span.hide').show();
		} else {
			$(target).slideUp();
			$(this).find('span.hide').hide();
			$(this).find('span.show').show();
		}
		return false;
	});

	
});