$(document).ready(function(){
	
	$(".weAreBikram p:last").addClass("noMargin");
	$(".subnavMid ul li a:first").addClass("subnavFirst");
	$(".subnavMid ul li:last").addClass("subnavLast");
	$(".testimonialItem:first").addClass("testItemFirst");
	$(".test_close:first").addClass("testCloseFirst");


    $(".featureInfo").delay(6000);
	$(".featureInfo").fadeIn(600);
    $("#featureSliderNext").delay(6000);
	$("#featureSliderNext").fadeIn(600);
    $("#featureSliderPrev").delay(6000);
	$("#featureSliderPrev").fadeIn(600);
	
    $('.featureSlider').cycle({
		fx: 'fade',
    	speed:    600,
    	timeout:  6000,
    	pause:  1,
	    next:   '#featureSliderNext', 
	    prev:   '#featureSliderPrev'    	
   	});
	
/*
	$(".headerSchedTrigger").click(function(){
	  	$(".headerSched").slideDown(400);
	  	$(".headerSchedTodayCTA").hide();
	  	$(".headerSchedFullCTA").fadeIn();
	});
*/
	
	$(".schedClose").click(function(){
		$(".headerSched").slideUp(400);	
	  	$(".headerSchedFullCTA").hide();
	  	$(".headerSchedTodayCTA").fadeIn();
	});	

	var fixed = false;
	
	$(document).scroll(function() {
	    if( $(this).scrollTop() >= 132 ) {
	        if( !fixed ) {
	            fixed = true;
	            $('.subnavWrap').css({position:'fixed',top:25});
	        }
	    } else {
	        if( fixed ) {
	            fixed = false;
	            $('.subnavWrap').css({position:'static'});
	        }
	    }
	});

	$(".scrollable").scrollable();
	$(".postureItem").hide();
	$(".postureItem").first().show();
	
	$(".posture").click(function(){
		$('.postureItem').hide();
		/* Can Use commented line, or the 2 lines below it */
		/* $("#p_" + $(this).attr("id")).show(); */				
		targetId = $(this).attr("id").replace("thumb_", "#p_");
		$(targetId).show();
	});	
	
	
	$(".test_close").click(function(){
		$(this).siblings(".test_copy").slideToggle();
		$(this).toggleClass("test_open");
	});

	$(".test_name").click(function(){
		$(this).siblings(".test_copy").slideToggle();
		$(this).siblings(".test_close").toggleClass("test_open");
	});
		
});
