// Start jQuery

$(document).ready(function() {
						   
	// Add "NEW" to new menu items
	//$('#header .page-item-846, #header .page-item-17').append('<span class="new">new</span>');
	
	// Wrap each list item. 
	$('.toggle ul li, .toggle ol li').wrap('<li><ul class="toggle-item"></ul></li>');
	
	// Prepend title to parent list item
	$('.toggle-item li h3').each(function() {
		$(this).prependTo(this.parentNode.parentNode.parentNode);
	});
	
	// Append +/– symbols to toggle titles
	$('.toggle h3, .slider-title').append('<span class="plus">+</span><span class="minus">–</span>');
	
	// Hide all toggle items
	$('.toggle-item, .toggle h3 .minus, .slider .minus, .slider-content').hide();
	
	// Toggle list items
	$('.toggle h3').click(function () {
		$(this).siblings('ul').slideToggle();
		$(this).children('.plus, .minus').toggle();
		$(this).toggleClass('active');
	});
	
	// Toggle Active Title State
	$(".slider-title").click(function () {
		$(this).siblings('.slider-content').slideToggle('slow');
		$(this).children('.plus, .minus').toggle();
		$(this).toggleClass('active');
	});
	
	
	// Programs: Slider Content without Children Bkd is White
	$('.page-id-8 .slider-content').each( function() {
		if ( $(this).children('.slider').length == 0 ) {
			$(this).addClass('noChildren');
		}
	});
	
	
	$('.page-item-1266 a').click(function() {
        _gaq.push(['_trackEvent', 'Outbound Links', 'Click', 'Online Community']);
    });
	
	$('a:not([href*="' + document.domain + '"])').click(function() {
        _gaq.push(['_trackEvent', 'Outbound Links', 'Click', $(this).attr('href')]);
    });
	
}); // End jQuery

function sort(field, dir, anchor)
{
	location.href='?sort=' + field + '&dir=' + dir + '#' + anchor;

	return false;
}

/*
function showHideProgram(index, programId, childProgramId)
{
	var programDiv = "program" + index + "-" + programId;
	
	if (!(typeof childProgramId == "undefined"))
	{
		programDiv += "-" + childProgramId;
	}
	
	$("#" + programDiv).slideToggle("slow");
}
*/
