
function toggleTeachers()
{
	if($('#other_teachers').is(":visible"))
	{
		jQuery.easing.def = "easeInBack";
		$('#other_teachers').slideUp('slow', function() { $("#other_teachers_arrow").attr('src', '/images/down-arrow-blue.png'); } );
	}
	else
	{
		jQuery.easing.def = "easeOutBack";
		$('#other_teachers').slideDown('slow', function(){ $("#other_teachers_arrow").attr('src', '/images/up-arrow-blue.png'); });
	}
}

function jumpTo(url)
{
	window.location = url;
}

function sort_by(type)
{
	$.ajax({ url: '/_ajax.php?sort_by=' + type, success: function(data) { window.location.href=window.location.href } });
}


function playAudio(id, file)
{
	target = 'audio_holder_' + id;

	var controls_json = {  
			fullscreen: false, 
			height: 30,
			durationColor: '#ffffff',
			backgroundColor: '#16517f',
			backgroundGradient: 'medium',
			progressGradient: 'medium',
			progressColor: '#528db9',
			bufferGradient: 'none',
			buttonOverColor: '#2f6186',
			sliderColor: '#d6dbd1',
			borderRadius: '0',
			timeColor: '#ffffff',
			bufferColor: '#ffffff',
			sliderGradient: 'none',
			buttonColor: '#528db9',
			play:true,      
			volume:true, 
			mute:false,  
			time:true,  
			stop:false, 
			playlist:false,  
			fullscreen:false, 
			scrubber:true
		};
					
	$f(target, "/includes/flowplayer-3.1.5.swf", { 
		plugins: { controls: controls_json }, 
		clip: 
		{ 
			url: "http://bibletalk.tv" + file, 
			autoPlay: true
		} 
	});
	
	$(".audio_holder").not("#audio_holder_" + id).slideUp();
	$(".audio_holder").not("#audio_holder_" + id).parent().removeClass("playing");
	$("#audio_holder_" + id).slideDown();
	$("#audio_holder_" + id).parent().addClass("playing");
}

function playFromQueue(index)
{
	$("#video_player").empty();

	for(q = 0; q <= index; q++)
	{
		jQuery.easing.def = 'easeInBack';
		$(".queue a:eq("+q+")").slideUp(1000);
	}
	
	playHomePageVideo(index);
}

function playHomePageVideo(index)
{
	vimeo_id = $(".home .queue a:eq("+index+")").attr('rel');
	$("#video_player").html('<iframe src="http://player.vimeo.com/video/' + vimeo_id + '?title=0&amp;byline=0&amp;portrait=0&amp;color=266fa8&amp;autoplay=1" width="100%" height="454" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>');
	
	$(".now_playing a").html( $(".home .queue a:eq("+index+") img").attr('alt') );
	$(".now_playing a").attr('href', $(".home .queue a:eq("+index+")").attr('href') );
}






