


$(document).ready(function(){
	
	// PNG Fix
	$(document).pngFix();
	
	// fix "external" links to open in new window									 
	$('a[rel="external"]').click(function(){
		window.open(this.href);
		return false;
	}).attr('title', 'Opens in New Window or Tab');

	// button style
	$("a.button-link").wrapInner("<span></span>");
	
	// homepage background slides
	$("#home-bkg-slideshow").fadeIn("slow").cycle({
		speed:800,
		timeout:5000
	});
	
	// gallery slideshow
	$("#home-slideshow").cycle({
		pause:1,
		speed:400,
		timeout:7000
	});
	
	// table sorter
	$("#table-classlist").tablesorter({ 
		sortList: [[1,0]],
		headers: { 
			0: { sorter: false }
		},
		textExtractionCustom: {
    			1: function(o) {
        			return $('h4',o).val();
 			   	}
 			},

	});
	// table sorter for schedule tables
	$("table.schedule-table").tablesorter({ 
		sortList: [[0,0],[1,0]]
	});
	
	// make tabs for schedule page
	$("#schedule-tabs").tabs("#schedule-panes > div", { effect: 'slide', history: 'true' });
	$("#schedule-tabs-weekday").tabs(".sched-container-weekday", { effect: 'slide' });
	$("#schedule-tabs-agegroup").tabs(".sched-container-agegroup", { effect: 'slide' });
	$("#schedule-tabs-skill").tabs(".sched-container-skill", { effect: 'slide' });
	$("#schedule-tabs-location").tabs(".sched-container-location", { effect: 'slide' });
	$("#schedule-tabs-instructor").tabs(".sched-container-instructor", { effect: 'slide' });
	
	// make tabs for news/events page
	$("#news-events-tabs").tabs("#news-events-panes > div", { effect: 'slide', history: 'true' });
	
	// 
	$("a.social-icon").click(function(){
		$("ul.social-link-list").hide("fast");
		$(this).next("ul.social-link-list").show("fast");
		return false;
	});
	
});

