$(document).ready(function(){
	
	// Top Photo Story & Gallery
	
	$('#o_gallery').hide();
	$('#otpl_p').hide();
	
	$('.otpl').click(function(){
		if ($(this).children('span').html() == 'Photo Gallery') {
			$(this).children('span').html('Top Photo')
		} else {
			$(this).children('span').html('Photo Gallery')
		}
		$('#o_gallery').toggle();
		$('#otp').toggle();
	});
	
	$('#jumpto_gal').click(function(){
		if (!$('#o_gallery').is(':visible')) {
			$('#o_gallery').toggle();
			$('#otp').toggle();
			$('.optl').children('span').html('Top Photo')
		}
	});
	
	// AP Widgets & Local Athletes Accordions

	$('.accc').hide();
	$('#owa .expanded').show();
	
	$('.acch').click(function(){
		if ($(this).next('.accc').is(':visible')) {
			$(this).next('.accc').toggle();
			$(this).children('h4').removeClass('active').addClass('disabled');
			$(this).removeClass('active').addClass('disabled');
		} else {
			$(this).parent().children('.accc').hide();
			$(this).next('.accc').toggle();
			$(this).parent().children('.acch').children('h4').removeClass('active').addClass('disabled');
			$(this).parent().children('.acch').removeClass('active').addClass('disabled');
			$(this).children('h4').addClass('active').removeClass('disabled');
			$(this).addClass('active').removeClass('disabled');
		}
		
	});
	

	
});
