
	$j.fn.nextUntil = function(expr, include) {
	var match = [];
	include = include ? true : false

	// We need to figure out which elements to push onto the array
	this.each(function(){
	// Traverse through the sibling nodes
	for( var i = this.nextSibling; i; i = i.nextSibling ) {
	// Make sure that we're only dealing with elements
	if ( i.nodeType != 1 ) continue;

	// Add it on to the stack if include is set
	if ( include ) {
	match.push( i );
	}
	// If we find a match then we need to stop
	if ( jQuery.filter( expr, [i] ).length ) break;

	// Add it on to the stack if include is not set
	if (! include ) {
	match.push( i );
	}
	}
	});
	return this.pushStack( match, arguments );
	}

$j(document).ready(function(){
		
	// hide studio column
	 //	$j(".schedule_header th:last-child").hide();
	 //	$j('.schedule tr td:last-child').hide();

	// remove (click for details)
		$j(".schedule_header th:nth-child(2) span").html("");
		$j(".schedule_header th:nth-child(3) span").html("");

	// hide footer links
		$j("img[alt='Healcode_footer']").hide();
		$j("img[alt='Mindbody_footer']").hide();

/* begin accordion functionality end 

	// hide schedule data
		$j("table.schedule tr:not(.schedule_header)").hide();

	// get current weekday from hash
		var todayIs = document.location.hash.replace(/#/, "");
		var headerSelect = $j(".hc_day:contains('"+ todayIs +"')").parent().parent()
			//headerSelect.nextUntil(".schedule_header").not("script").toggle();

	// set accordion toggle
	$j(".schedule_header").click(function(){
		     $j(this).nextUntil(".schedule_header").not("script").toggle(); return false;
	});		
	

	// highlight header row on hover
	$j("div.healcode .schedule th").hover(function() {
			$j(this).siblings().andSelf().css({'background-color' : '#8C1571', 'color' : '#FFFFFF'});
		},
		function() {
			$j(this).siblings().andSelf().css({'background-color' : '#DCAECB', 'color' : '#444444'});
		}
	);

	// helper text {tooltip}
		$j("tr.schedule_header").children("th:nth-child(2)").html('Class <span class="helperTxt">(click to open)</span>');
		$j("tr.schedule_header").children("th:nth-child(3)").html('Teacher <span class="helperTxt">(click to open)</span>');

	$j("tr.schedule_header").toggle(function() {
			$j(this).children("th:eq(1)").html('Class <span class="helperTxt">(click to close)</span>');
			$j(this).children("th:eq(2)").html('Teacher <span class="helperTxt">(click to close)</span>');
			$j(this).children().css({'font-weight' : 'bold'});
		},
		function() {
			$j(this).children("th:eq(1)").html('Class <span class="helperTxt">(click to open)</span>');
			$j(this).children("th:eq(2)").html('Teacher <span class="helperTxt">(click to open)</span>');
			$j(this).children().css({'font-weight' : 'normal'});
		}
	);  
	
	// show shedule for current day
		headerSelect.click(); 

		// display modified healcode widget
			$j("div.healcode").css("display", "inline");

 accordion functionality end */

	
	// hide anchor links
		$j(".week_links a[href^='#']").toggle();

	// duplicate anchor links
		$j(".header").clone().appendTo("div.healcode");
			// align right
		$j(".date_links:eq(1)").css("text-align", "right");

	// disable modal links
		$j(".classname a").attr("onclick", "");
		$j(".trainer a").attr("onclick", "");
		$j(".classname a, .trainer a").click(function(event){
			event.preventDefault();
		});
		
	// highlight shedule nav links
		$j(".sidenav a[title='schedule']").addClass("active");
		$j("img#schedule").attr("src", "http://www.yogapod.com/assets/images/mainnav_02rol.jpg");
	
});