jQuery(document).ready(function(){	
	
	var active_subpage = window.location.hash;
	if (active_subpage == ''){
		var active_subpage = '#what';
	}
	var show_content = active_subpage;
	var active_link = active_subpage + '_link'
	
	$('.subpage_content').addClass('hide');
	$(active_link).addClass('active');
	$(show_content).removeClass('hide').addClass('show');

	/*//subpage link mouseover effects
	$('.subpage_link').mouseover(function(){
		$(this).not('.active').css('text-decoration','underline');
	}).mouseout(function(){
		$(this).not('.active').css('text-decoration','none');
	});*/
	
	//toggle subpage content visibility on click
	$('.subpage_link').click(function(){
		var link_id = "#" + $(this).attr('id');
		var content_id = link_id.replace('_link','');
		window.location.hash = content_id;
		if ( ! $(this).hasClass('active') ) {
			$(this).addClass('active').siblings().removeClass('active');
			$('.show').fadeOut(300, function(){
				$(this).removeClass('show');
				$(content_id).fadeIn(300).addClass('show');
			});
			return false;
		}
	});

});